Edit Mode RadButton ToggleType=Radio not working value display Unchecked

6 posts, 0 answers
  1. Jyosana
    Jyosana avatar
    12 posts
    Member since:
    Aug 2013

    Posted 18 Sep 2013 Link to this post


    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);
               }        
           }

     

     

     

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 23 Sep 2013 Link to this post

    Hello Jyosana,

    It seems that there is an issue with setting the server-side checked property to RadButton (ButtonType="ToggleButton" ToggleType="Radio"). I have logged the unexpected behavior in our feedback portal here, so that you can monitor, comment or raise its priority by voting on it.

    For the time being you can execute JavaScript from the server which sets this property. For example:
    string script = "";
    if (Convert.ToString(dsEmploerList.Tables[0].Rows[0]["Schedule"]) == "1")
        script = "function f(){$find(\"" + rdEmployer1.ClientID + "\").set_checked(true); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
    ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);

    You can find a modified version of your example with the above approach in the attached archive.

    As a small token of gratitude for reporting this issue to us, I have updated your Telerik points.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jyosana
    Jyosana avatar
    12 posts
    Member since:
    Aug 2013

    Posted 23 Sep 2013 Link to this post

    Hello, Danail Vasilev
    Thanks for your replay
    Your Code is Working Fine and my issue is resolved
    Thank you very much

    Thanks
    Jyosana
  5. Steve
    Steve avatar
    84 posts
    Member since:
    Aug 2013

    Posted 02 Dec 2013 Link to this post

    When is this going to be fixed? I have well over 200 of these types of buttons grouped all over my site that are set server-side. This is a critical issue for me! I can't implement your "workaround". I need this fixed ASAP!
  6. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 05 Dec 2013 Link to this post

    Hi Steve,

    I have raised the priority of this item and escalated it to the attention of our developers. If everything is fine the issue will be fixed for Q1 2014.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  7. Steve
    Steve avatar
    84 posts
    Member since:
    Aug 2013

    Posted 05 Dec 2013 Link to this post

    I have another issue I wrote about in this forum that they can look at as well and hopefully resolve.

    Other issue located here:  Checkbox and image button issue
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017