E
Eran Dvey-Aharon
Hi Group!
When binding the CheckBoxList control, you can only control the 'text'
and 'value' properties of each CheckBox created.
Suppose I have on the data source some additional information for the
'checked' initial state, and I want to update the 'selected' property
of each checkbox.
If the data source is static, it seems easy - just iterate over the
data source once again after all items are crated (onDataBound for
instance), and update the 'selected' state.
This is the WRONG approach, because it requires itterating over the
data source once again, and assuming that we got the same result at
the same order.
Working in ASP 2.0 with DataSourceID makes it much harder to implement
(I couldn't write working version).
I'd like to override the exact place where each checkbox item is
created, having a single datasource "row" (or enumerated single
object), and use the Eval syntax to set the selected property from the
data "row".
This is similar to understanding what happens in
OnDataBinding(EventArgs e) on that object.
Any ideas?
Eran Dvey-Aharon
When binding the CheckBoxList control, you can only control the 'text'
and 'value' properties of each CheckBox created.
Suppose I have on the data source some additional information for the
'checked' initial state, and I want to update the 'selected' property
of each checkbox.
If the data source is static, it seems easy - just iterate over the
data source once again after all items are crated (onDataBound for
instance), and update the 'selected' state.
This is the WRONG approach, because it requires itterating over the
data source once again, and assuming that we got the same result at
the same order.
Working in ASP 2.0 with DataSourceID makes it much harder to implement
(I couldn't write working version).
I'd like to override the exact place where each checkbox item is
created, having a single datasource "row" (or enumerated single
object), and use the Eval syntax to set the selected property from the
data "row".
This is similar to understanding what happens in
OnDataBinding(EventArgs e) on that object.
Any ideas?
Eran Dvey-Aharon