Edit Mode RadButton ToggleType=Radio not working value display Unchecked

7 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
    1502 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. 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
  4. 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!
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1502 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.
  6. 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
  7. Yasha
    Yasha avatar
    1 posts
    Member since:
    Mar 2013

    Posted 22 Mar Link to this post

    Hi I have two sets of Standard button with ToggleType = "Radio" as below

    <telerik:RadButton ID="btnCreSpec" runat="server" RenderMode="Lightweight" ButtonType="StandardButton" ToggleType="Radio" Text="Create Spec" GroupName="SpecItemLink" BorderColor="Gray" AutoPostBack="false"  />
    <telerik:RadButton ID="btnLnkToSpec" runat="server" RenderMode="Lightweight" ButtonType="StandardButton" ToggleType="Radio" Text="Link to Spec" GroupName="SpecItemLink"  BorderColor="Gray" AutoPostBack="false"  />
    <telerik:RadButton ID="btnLnkToItem" runat="server" RenderMode="Lightweight" ButtonType="StandardButton" ToggleType="Radio" Text="Link to Item" GroupName="SpecItemLink"  BorderColor="Gray" AutoPostBack="false" />

    <telerik:RadButton ID="rbInside" runat="server" RenderMode="Lightweight" ButtonType="StandardButton" ToggleType="Radio" Text="Inside" GroupName="JointLoc"  BorderColor="Gray" AutoPostBack="false"  />
    <telerik:RadButton ID="rbOutside" runat="server" RenderMode="Lightweight" ButtonType="StandardButton" ToggleType="Radio" Text="Outside" GroupName="JointLoc"  BorderColor="Gray" AutoPostBack="false" />
    <telerik:RadButton ID="rbNone" runat="server" RenderMode="Lightweight" ButtonType="StandardButton" ToggleType="Radio" Text="None" GroupName="JointLoc"  BorderColor="Gray" AutoPostBack="false" />

    And I implemented Script as a fix which is mentioned in this post as in attached file. But Only second Set gets button selected. For first set nothing is getting selected.  Does anybody have a solution for this?

Back to Top