I have several checkboxes in a RadGrid and checkBoxe 4 does an AutoPostback to DoSomething(object obj, EventArgs e).
This works great and I don't want change anything and I use datakeys to get my values from the row. I also don't want to loop through GridDataItems to find out if checkbox 1-3 are checked.
II would like to see of the checkboxes for 1-3 are checked, since checkbox 4 is firing the postback "DoSomething".
Thank you in advance!
This works great and I don't want change anything and I use datakeys to get my values from the row. I also don't want to loop through GridDataItems to find out if checkbox 1-3 are checked.
<
telerik:GridTemplateColumn
HeaderText
=
"Comments"
ItemStyle-HorizontalAlign
=
"Left"
HeaderStyle-Width
=
"250px"
Groupable
=
"false"
ItemStyle-VerticalAlign
=
"Top"
UniqueName
=
"CheckBoxes"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"CheckBox1"
Text
=
"CheckBox 1"
runat
=
"server"
/><
br
/>
<
asp:CheckBox
ID
=
"CheckBox2"
Text
=
"CheckBox 2"
runat
=
"server"
/><
br
/>
<
asp:CheckBox
ID
=
"CheckBox3"
Text
=
"ChcekBox 3"
runat
=
"server"
/><
br
/>
<
asp:CheckBox
ID
=
"CheckBox4"
Text
=
"CheckBox 4"
OnCheckedChanged
=
"DoSomething"
AutoPostBack
=
"True"
runat
=
"server"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
II would like to see of the checkboxes for 1-3 are checked, since checkbox 4 is firing the postback "DoSomething".
protected void DoSomething(object obj, EventArgs e)
{
CheckBox checkBox1 = (CheckBox)obj;
GridDataItem checkedOffer = (obj as CheckBox).NamingContainer as GridDataItem;
if ((obj as CheckBox).Checked)
{
// I need to find the other checkboxes in here when someone clicks on CheckBox 4
}
}
Thank you in advance!