| re: Creating Checkbox Dynamically in Data Grid using VB.NET Web Form
I think you may be going about this slightly incorrectly. You've gone through the process of grabbing the database and using it as a data source for your grid, which is standard practice and for usual everyday tasks, this would be correct.
However, in this case, what I think you'll need to do is parse the dataset that you grabbed from the database and iterate through it row by row and build your grid. When the current record holds a new attribute, add a row that contains your checkbox above the one you're currently working on, add a hidden field that contains a list of the keys that will be dynamically built from id's for the current group. As you parse a new record, you check to see if the group is still the same one, if it is, add it to the contents of the hidden field. If it's not the same, create a new row with a new checkbox and a new hidden field to repeat the process over.
There might be a bit more of a slick way to do this, but I think this is the bare bones of the technique that will get you started.
|