filling datagrid's textbox column with dataset values

Posted by Awakale.gajanan under ASP.NET on 1/12/2012 | Points: 10 | Views : 1636 | Status : [Member] | Replies : 2
Hi,
i'm fetching table values from database, i want to fill the textbox column's textboxes present in datagrid with dataset values.,
please help me how to achieve this.

Regards,
Gajanan Awakale
09975635088



Responses

Posted by: Ivlnr on: 1/12/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Please check this.

http://www.velocityreviews.com/forums/t80336-datagrid-textbox.html

thx


Awakale.gajanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ogipansrk on: 1/12/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

Firstly, Bind your DataSet to GridView.
Example: GridView.DataSource=ds; GridView.Databind();

Next, Design you grid using template columns like below.
<Columns>
<asp:TemplateField>
<HeaderTemplate>Name</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="txtName" runat="server" Text='<%#Eval("name") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>Name</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="txtAddress" runat="server" Text='<%#Eval("address") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>

Hope this helps !

Regards,
Ogipansrk




Awakale.gajanan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response