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 |
Dataset is the disconnected environment. suppose if you are binding records to gridview (disconnected environment) and you are making changes to the the grid but before updating the database if any other user modify the data, how will you avoid such problem?
What are the advantages of asp.net?
What methods are fired during the page load? Init()
what is use to destroy an object? illustrate.
Explain what a diffgram is and a good use for one?
1 Answers Siebel Systems, Syntax Softtech,
How do you trap errors in ASP and how do you invoke a component in ASP ?
What is the latest version of asp.net?
What is the method used to load generated dataset with data on the DataAdapter control ?
when we write the html code with runat = server it works like a server control than why we use the server control?
Types of values mode can hold session state in Web.Config?
Difference between Response.redirect vs server.transfer?
when u enter the data in one text box once u completed entering the text box data then one page has to be popuped and the text has to be displayed in the parent page
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)