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

I am having four text boxes in my web application. I am setting Required Field validator to each Text box. And I am having two buttons in my application. If i clicked the first button only first two text box validation will get fire. Dont show error message for remaining two text box. If i clicked second button last two text box validation will get fired. It will not consider the first two validation controls. That is how to enable and disable the validation controls.

4 Answers  


What are the various types of cookies in asp.net?

0 Answers  


when using windows API in .net then it is managed code or Unmanaged code?

2 Answers  


What is reflection and disadvantages of reflection?

6 Answers   Microsoft,


1.What are the types of events in asp.net? 2.what is databind? 3.what is COM objects? 4.Difference between gridview and datalist? 5.what is SOAP? 6.what are contents are available in asp.net page? 7.what are types of error?

1 Answers   CompuRx Infotech, Gemini, Gemini Communication,






Compare and contrast between inline and code behind - which one is best?

2 Answers   Siebel,


How do you remove duplicates without using remove duplicate stage?

0 Answers  


Explain asp.net application life cycle?

0 Answers  


Difference between using directive vs using statement?

0 Answers  


Define transparent caching with aop?

0 Answers  


can i use two web.config files of ConnectionString in One Default.aspx page

6 Answers   Satyam, Verinon Technology Solutions, Wipro,


What is server side session management?

0 Answers  


Categories