Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Gordon #1
Create ItemTemplates at runtime
Hi,
Fairly new to ASP.net. I want to create a Datagrid that will bind to a
DataSet created a runtime and which will hence have a variable number of
columns. I want to show the data in binded textboxes.
I can't create template columns in the designer because I don't know the
number and column name but I can see how to do it at runtime ie in Page_Init
for (int counter=0;counter<dataSet1.Columns.count; counter++) {
TemplateColumn dc = new TemplateColumn()
dc.HeadText = dataset1.Columns[counter].ColumnName
DataGrid1.Columns.Add(dc)
}
but I'm a bit lost on how to add an ItemTemplate which has a bound textbox
to each TemplateColumn as I create them
--
Regards
Gordon
Gordon Guest
-
Create display object at runtime
Hi, I have a requirement to create an instance of a DisplayObject whose type will not be know until runtime. So, instead of: var public... -
Create Columns Automatically at Runtime
We have been having some unexplainable datagrid issues and questions on this subject and our messages have largely been ignored when posting to this... -
Create DataGrid at runtime
Hello, I need to create a DataGrid at runtime with a EditCommandColumn. Everything works fine only the events of the EditCommandColumn, which are... -
Create DataGrid at runtime!
Hello, I need to create a DataGrid at runtime with a EditCommandColumn. Everything works fine only the events of the EditCommandColumn, which are... -
Why does a web service create a copy at runtime ?
I have a windows application which uses 2 web services , stored under inetpub. When the user builds this application in VS.NET, the system... -
msnews.microsoft.com #2
Re: Create ItemTemplates at runtime
"Gordon" <Gordon@discussions.microsoft.com> wrote in message
news:D30A534A-5544-4703-9220-900567B849A1@microsoft.com...Hi Gordon,> Hi,
>
> Fairly new to ASP.net. I want to create a Datagrid that will bind to a
> DataSet created a runtime and which will hence have a variable number of
> columns. I want to show the data in binded textboxes.
> I can't create template columns in the designer because I don't know the
> number and column name but I can see how to do it at runtime ie in
> Page_Init
> for (int counter=0;counter<dataSet1.Columns.count; counter++) {
> TemplateColumn dc = new TemplateColumn()
> dc.HeadText = dataset1.Columns[counter].ColumnName
> DataGrid1.Columns.Add(dc)
> }
>
> but I'm a bit lost on how to add an ItemTemplate which has a bound textbox
> to each TemplateColumn as I create them
>
>
>
> --
> Regards
>
> Gordon
I have a sample that adds checkboxes and dropdownlists to a customized
template at runtime.
[url]http://www.societopia.net/Samples/DataGridEventDelegates.aspx[/url]
The process of adding a textbox is not different.
HTH,
Phillip Williams
[url]http://www.webswapp.com[/url]
[url]http://www.societopia.net[/url]
msnews.microsoft.com Guest



Reply With Quote

