Hi Telerik,
I have made a custom checkbox where i can bind the id(DatabaseID) from the database. I'm using this custom checkbox and other labels in a Radgrid where i dynamically bind the data from the database using a Webservice. Then i have a button who saves the values(in that row to the database) where checkbox is checked. The button need to do a server side postback to the database in order to save the values but onCheckedChanged is server side?
The problem is that where in code behind(button) the checked status is always false. But i have tested this in the custom checkbox class that the checked status is changed so there is a loss somewhere..
Help please!
Thanks!
Andreas E
I have made a custom checkbox where i can bind the id(DatabaseID) from the database. I'm using this custom checkbox and other labels in a Radgrid where i dynamically bind the data from the database using a Webservice. Then i have a button who saves the values(in that row to the database) where checkbox is checked. The button need to do a server side postback to the database in order to save the values but onCheckedChanged is server side?
<
telerik:GridTemplateColumn
HeaderText
=
"Godkänn"
ItemStyle-Width
=
"50px"
UniqueName
=
"cChkbox"
>
<
ItemTemplate
>
<
fw:CustomCheckBox
DatabaseID='<%# Eval("ID") %>' runat="server" OnCheckedChanged="onCheckedChanged" />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
protected void btnAcceptHours_Click(object sender, EventArgs e)
{
List<
string
> AcceptHours = new List<
string
>();
foreach (GridDataItem item in rgAvvaktandeTim.Items)
{
foreach (Control c in item.Controls)
{
foreach (Control d in c.Controls)
{
if (d is CustomControls.CustomCheckBox)
{
if ((d as CustomControls.CustomCheckBox).Checked == true)
{
AcceptHours.Add((d as CustomControls.CustomCheckBox).DatabaseID);
goto ContinueOuterIteration;
}
}
}
}
ContinueOuterIteration:
continue;
}
Help please!
Thanks!
Andreas E