What tags do you need to add within the asp:datagrid tags to
bind columns manually?

Answer Posted / nazakat ali

Set AutoGenerateColumns Property to false on the datagrid tag and then use Column tag and an ASP:databound tag
< asp:DataGrid runat="server" id="ManualColumnBinding" AutoGenerateColumns="False" >
< Columns >
< asp:BoundColumn HeaderText="Column1" DataField="Column1"/ >
< asp:BoundColumn HeaderText="Column2" DataField="Column2"/ >
< /Columns >
< /asp:DataGrid >


<asp:DataGrid id=ManualColumnBinding runat="server" AutoGenerateColumns="False">
<COLUMNS> <asp:BoundColumn HeaderText="Column2" DataField="Column2"></asp:BoundColumn>
</asp:DataGrid>

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is comparevalidator?

520


How to find out what version of asp.net I am using on my machine?

577


Explain the asp.net mvc request life cycle? : asp.net mvc

493


How does the service stream content?

580


Explain difference between dataset and datareader?

598






Which platform does Microsoft .NET use for exchanging data between applications?

578


How many web config files can be created for an application?

440


Explain the asp.net mvc folder conventions? : asp.net mvc

502


What is a web api?

542


What are sql notifications and sql invalidations?

525


What is clickid?

547


How can you ensure a permanent cookie?

549


Describe a Windows Service and its lifecycle ?

614


Explain the advantages of caching?

525


What is httpresponse?

502