Not able to find Radbutton from codebehind using c#

2 posts, 0 answers
  1. PRITESH
    PRITESH avatar
    12 posts
    Member since:
    Mar 2014

    Posted 14 Nov 2014 Link to this post

    Hello, Everyone

    aspx code

      <telerik:RadButton ID="rdlTypeoffilter_1" runat="server" ToggleType="Radio" ButtonType="StandardButton"  Width="340px"
                GroupName="rdlTypeoffilter" AutoPostBack="false" Skin="MetroTouch" Checked="true">
                <ToggleStates>
                    <telerik:RadButtonToggleState Selected="true" Text="All" Value="1" PrimaryIconCssClass="rbToggleRadioChecked">
                    </telerik:RadButtonToggleState>
                    <telerik:RadButtonToggleState Text="All" Value="0" PrimaryIconCssClass="rbToggleRadio">
                    </telerik:RadButtonToggleState>
                </ToggleStates>
            </telerik:RadButton>
            <br />
            <telerik:RadButton ID="rdlTypeoffilter_2" runat="server" ToggleType="Radio" ButtonType="StandardButton"  Width="340px"
                GroupName="rdlTypeoffilter" AutoPostBack="false" Skin="MetroTouch">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Districtwise" Value="2"
                        PrimaryIconCssClass="rbToggleRadioChecked"></telerik:RadButtonToggleState>
                    <telerik:RadButtonToggleState Text="Districtwise" Value="0"
                        PrimaryIconCssClass="rbToggleRadio"></telerik:RadButtonToggleState>
                </ToggleStates>
            </telerik:RadButton>

               <br />
            <telerik:RadButton ID="rdlTypeoffilter_3" runat="server" ToggleType="Radio" ButtonType="StandardButton"  Width="340px"
                GroupName="rdlTypeoffilter" AutoPostBack="false" Skin="MetroTouch">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Zonewise" Value="3"
                        PrimaryIconCssClass="rbToggleRadioChecked"></telerik:RadButtonToggleState>
                    <telerik:RadButtonToggleState Text="Zonewise" Value="0"
                        PrimaryIconCssClass="rbToggleRadio"></telerik:RadButtonToggleState>
                </ToggleStates>
            </telerik:RadButton>



    c# code


     string typeofdashboardval = "";
             
                    for (int i = 0; i <= 3; i++)
                    {               
                        typeofdashboardval = ((RadButton)Page.FindControl("rdltypeofdashboard_" + i.ToString())).SelectedToggleState.Value;
                    }

    Please help

    Thanks and Regards,

    Pritesh
  2. PRITESH
    PRITESH avatar
    12 posts
    Member since:
    Mar 2014

    Posted 15 Nov 2014 Link to this post

    I found the solution.

    everything works fine.

    Thanks

    Pritesh
  3. DevCraft banner
Back to Top