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

Answers were Sorted based on User's Feedback



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

Answer / sunayana

Set AutoGenerateColumns Property to false on the datagrid tag

Is This Answer Correct ?    11 Yes 0 No

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

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

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

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

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

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

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

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

Post New Answer

More ASP.NET Interview Questions

Can you explain architecture of your project ?

0 Answers  


How many types cache in asp net?

0 Answers  


To load your generated dataset with data which method do you invoke?

0 Answers   Siebel,


Where does the Web page belong in the .NET Framework class hierarchy?

1 Answers  


How can we identify that the Page is Post Back?

0 Answers  


Explain what is the procedure to create the environment for asp.net? : asp.net mvc

0 Answers  


List the advantages and disadvantages of user control an custom control?

0 Answers  


What is caching? Explain.

0 Answers  


Why is it important to maintain session state?

1 Answers  


What do you mean by authentication?

0 Answers  


Can you explain composite pattern?

0 Answers   QuestPond,


What is special types forms

0 Answers   MCN Solutions,


Categories