That's the problem. You need to add the controls during OnInit.
That's not an option. The Checkboxes need to have unique ID's, and the ID names I create for each, encode a RecordID number inside it (ie:chkSelect_25805). Since Checkboxes don't offer a value submit property, this was the only way I could think of getting
what I needed. I parse the name of the Checkbox at the time of PostBack to know which record it's referring to. The issue is, I build the Checkbox name dynamically (by use of a property that defines the PrimaryKey column name of the DataSource being bound
to). At the time of the Init() event, the property I need has no value yet (don't know when it gets populated, all I know is by the time the Load() event execute, the Property I need now has a value), causing the creation method to crash.
BSantiag
Member
8 Points
5 Posts
Re: Dynamically Created Checkboxes in GridView Retain Old Values
Feb 29, 2012 05:00 PM|LINK
That's not an option. The Checkboxes need to have unique ID's, and the ID names I create for each, encode a RecordID number inside it (ie:chkSelect_25805). Since Checkboxes don't offer a value submit property, this was the only way I could think of getting what I needed. I parse the name of the Checkbox at the time of PostBack to know which record it's referring to. The issue is, I build the Checkbox name dynamically (by use of a property that defines the PrimaryKey column name of the DataSource being bound to). At the time of the Init() event, the property I need has no value yet (don't know when it gets populated, all I know is by the time the Load() event execute, the Property I need now has a value), causing the creation method to crash.
Programmer Analyst
(SQL, FoxPro, VB, VB.Net, Java, HTML, ASP, JSP, VBS, Cognos ReportNet)