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

Explain how can we access static variable?

0 Answers  


Explain the different types of assemblies?

0 Answers  


wt is repeater control and wt is datalist control and wt defferences these two? i want some code in datalist?

1 Answers  


What is custom control. What is the difference between custom control and user control?

2 Answers   Microsoft,


Explain Areas in MVC?

0 Answers   B-Ways TecnoSoft,






what is the purpose of update panel control in ajax?

2 Answers   CSC,


What is an imagemap in asp.net?

0 Answers  


How can we make sure that Web API returns JSON data only?

0 Answers  


How to authenticate users using Web.Config ?

1 Answers   Accenture,


What are validator? Name the validation controls in asp.net? How do you disable them? Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?

0 Answers  


What is parse in asp.net?

0 Answers  


Describe the difference between inline and code behind - which is best in a loosely coupled solution Tightly coupled - INLINE

2 Answers  


Categories