Hello All
I have a Issue with the RadButton ToggleType="Radio" buttons. In Insert Mode Radio Button Selected Value Save Data is Properly
but When I Edit Mode and I Press My Edit Button Then RadButton Selected Value is Unchecked
<
table
>
<
tr
>
<
td
valign
=
"top"
align
=
"right"
>
<
asp:Label
ID
=
"lblSchedule"
runat
=
"server"
CssClass
=
"labelText"
Text
=
"Schedule: "
></
asp:Label
>
</
td
>
<
td
valign
=
"top"
align
=
"left"
colspan
=
"3"
>
<
telerik:RadButton
ID
=
"rdEmployer1"
runat
=
"server"
ButtonType
=
"ToggleButton"
GroupName
=
"Schedule"
ToggleType
=
"Radio"
AutoPostBack
=
"false"
Text
=
"Mon"
Value
=
"1"
></
telerik:RadButton
>
<
telerik:RadButton
ID
=
"rdEmployer2"
runat
=
"server"
ButtonType
=
"ToggleButton"
GroupName
=
"Schedule"
ToggleType
=
"Radio"
AutoPostBack
=
"false"
Text
=
"Tue"
Value
=
"2"
></
telerik:RadButton
>
<
telerik:RadButton
ID
=
"rdEmployer3"
runat
=
"server"
ButtonType
=
"ToggleButton"
GroupName
=
"Schedule"
ToggleType
=
"Radio"
AutoPostBack
=
"false"
Text
=
"Wed"
Value
=
"3"
></
telerik:RadButton
>
<
telerik:RadButton
ID
=
"rdEmployer4"
runat
=
"server"
ButtonType
=
"ToggleButton"
GroupName
=
"Schedule"
ToggleType
=
"Radio"
AutoPostBack
=
"false"
Text
=
"Thr"
Value
=
"4"
></
telerik:RadButton
>
<
telerik:RadButton
ID
=
"rdEmployer5"
runat
=
"server"
ButtonType
=
"ToggleButton"
GroupName
=
"Schedule"
ToggleType
=
"Radio"
AutoPostBack
=
"false"
Text
=
"Fri"
Value
=
"5"
></
telerik:RadButton
>
<
telerik:RadButton
ID
=
"rdEmployer6"
runat
=
"server"
ButtonType
=
"ToggleButton"
GroupName
=
"Schedule"
ToggleType
=
"Radio"
AutoPostBack
=
"false"
Text
=
"Sat"
Value
=
"6"
></
telerik:RadButton
>
</
td
>
</
tr
>
</
table
>
protected void btnEmployerEdit_Click(object sender, EventArgs e)
{
DataSet dsEmploerList = General.General.objService.GetEmployerBYID(Convert.ToInt32(EmployerPK);
if (dsEmploerList != null && dsEmploerList.Tables.Count > 0 && dsEmploerList.Tables[0].Rows.Count > 0)
{
if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "1")
rdEmployer1.Checked = true;
if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "2")
rdEmployer2.Checked = true;
if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "3")
rdEmployer3.Checked = true;
if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "4")
rdEmployer4.Checked = true;
if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "5")
rdEmployer5.Checked = true;
if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "6")
rdEmployer6.Checked = true;
if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "")
rdEmployer1.Checked = rdEmployer2.Checked = rdEmployer3.Checked = rdEmployer4.Checked = rdEmployer5.Checked = rdEmployer6.Checked = false;
}
}
protected void btnEmployerSave_Click(object sender, EventArgs e)
{
string Scheduler = string.Empty;
if (rdEmployer1.Checked == true)
Scheduler = "1";
if (rdEmployer2.Checked == true)
Scheduler = "2";
if (rdEmployer3.Checked == true)
Scheduler = "3";
if (rdEmployer4.Checked == true)
Scheduler = "4";
if (rdEmployer5.Checked == true)
Scheduler = "5";
if (rdEmployer6.Checked == true)
Scheduler = "6";
if (EmployerPK > 0)
{
EmployerPK = General.General.objService.UpdateEmployer(EmployerPK, Scheduler);
}
else
{
EmployerPK = General.General.objService.InsertEmployer(Scheduler);
}
}