ASP.NET DataGrid and TextBox creation at runtime?

A

Arulraja

Hello,

How do I create the following at runtime? I am able to create a
TextBox Column at runtime using "DataGridColumn" class. But I don't
know how to show the DataSet values on the TextBox(TextBox.Text).

I am using the following methods of the DataGridColumn class, DataGrid
Class.

DataGridColumn class:
---------------------
public override void InitializeCell(TableCell cell, int columnIndex,
ListItemType itemType)

DataGrid Class:
---------------
protected override ArrayList CreateColumnSet(PagedDataSource source,
bool useDataSource)

I think I am missing something? But I couldn't find out that part.
Help will be really appreciated on this.


<asp:TemplateColumn HeaderText="First Name">
<ItemTemplate>
<asp:Label runat="server"
Text='<%# DataBinder.Eval(Container, "DataItem.au_fname") %>'
/>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox runat="server"
Text='<%# DataBinder.Eval(Container, "DataItem.au_fname") %>'
/>
</EditItemTemplate>
</asp:TemplateColumn>

Thanks
Arul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top