Does anybody know of a reason why a data grid would not generate unique Ids for the inputs in a template column?
I have a bound datagrid in a web page, each of the columns is a template column, with either a drop down list or a text box in it. I add ten lines to my underlying datasource and bind. The resulting table displays but each of the columns has the same ID for the control contained in it, the grid should be generating unique Ids based on its container. Flumoxed I am.
Loading
Suthish NairPosted Mar 31, 2011, 12:45 PM
Nick HarrisonPosted Mar 30, 2011, 3:10 AM
The C# that fills the grid is very straight forward.
insertBlanks(10);
dgInvoices.DataSource=dsData.Tables["dsInvoiceEntry"];
dgInvoices.DataBind();
insertBlanks is just a routine that adds new blank records to the data source.
The definition of the template columns in the data grid is all similar to the following.
Width="100%">
This is defined in a standard DataGrid
In any other table in my system, coded in a similar fashion, the input would be resolved something along these lines.
This particular column being from another form in my system. As you can see, this has been resolved correctly with the name and ID fields being assigned unique values for identification. What I need to understand is why my first DataGrid is not resolving the HTML input names in a similar fashion.
Suthish NairPosted Mar 29, 2011, 4:28 PM