What tags do you need to add within the asp:datagrid tags to
bind columns manually?
Answers were Sorted based on User's Feedback
Answer / sunayana
Set AutoGenerateColumns Property to false on the datagrid tag
Is This Answer Correct ? | 11 Yes | 0 No |
Answer / pramod prakash
<asp:DataGrid ID="gridename" runat="server">
<Columns>
<asp:BoundColumn ataField="fieldname"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
Is This Answer Correct ? | 9 Yes | 0 No |
Answer / joseph
First set AutoGenerateColumn False, then set the
DataSourceID and DataKeyNames properties. Of course, you
also need to specify the columns.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / 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 |
Answer / anand gopal makwa munger
First set AutoGenerateColumn False and write code like given below.Suppose you want to bind ID and name.
<asp:DataGrid ID="Datagrid1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundColumn DataField="Id" HeaderText="ID"></asp:BoundColumn>
<asp:BoundColumn DataField="Name" HeaderText="Name"></asp:BoundColumn>
</Columns>
</asp:DataGrid>
Is This Answer Correct ? | 1 Yes | 2 No |
What are Http handler ?
What are the types of validation in asp net?
What is the Intermittent crashing of application in production?
What are cookies in asp.net?
What is full trust in asp.net?
What is diff. Between abstract class and an interface?
Why session is more secure than cookies?
In the context of a comparison, what is object identity versus object equivalence?
How many types of validation are there?
what are the differences between windows services and web services?
How to compare two strings with out Case sensitive ?
explain about Back ground process control in .net
1 Answers Digital Mesh, Infronics,