Click here to Skip to main content
15,749,184 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
In a gridview, i binded the datum from database in labels...In tat grid, i have to add multiple no.of rows which should contain only textbox , so tat i can enter some values in the grid...

I should not use footer template....So Existing rows should be displayed in labels and i should not get any chances of editing the existing datas in the grid....only thing is i need to insert 'n' number of rows which should contain only textbox not the labels...can anyone suggest me some solution for this????

You can use Labels inside the EditTemplate and ItemTemplate.

This is family easy to do.

<asp:TemplateField HeaderText="Column1">
<asp:Label ID="1" runat="server" Text='<%# Bind("columntext") %>'> </asp:Label>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("columntext") %>'></asp:Label>

The above code sample should help you out.
Share this answer
also u use get the data from db layer through business layer. then bind the datasource to based on below..

below code bizLyer.Select() is used for retrieve the data from db.
then we will bind the data to grid.

gvData.DataSource = bizLayer.Select();
Share this answer
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900