RadGrid with RadRadiobuttonlist + bind clientside

2 posts, 0 answers
  1. Prathibarani
    Prathibarani avatar
    55 posts
    Member since:
    Mar 2013

    Posted 13 Jun 2018 Link to this post

    HI,

    We need to bind RadGrid on clientside. I am doing it using RadClientDataSource and Restful Webservice call. This grid has RadRadioButtonlist. I need to bind this button list to the data coming from database.

    Can someone help please how to do bind it on clientside

    Thank You

  2. Vessy
    Admin
    Vessy avatar
    2240 posts

    Posted 18 Jun 2018 Link to this post

    Hi Prathibarani,

    I assume that you are adding RadioButtonList inside a GridTemplateColumn, am I correct? If so, being a server-side control it should be added inside the ItemTemplate of the column and cannot be bound to the ClientDataSource data.

    If you want to access the ClientDataSource data of the current row, you have to use ClientItemTemplate and a standard html radio group. In the example below the Option1/Option2/Option3 columns corresponds to the columns from the client-data source that are holding the Radio button list option per each row:
    <telerik:GridTemplateColumn UniqueName="ClientTemplateColumn" HeaderText="Customer RadioButtonList">
        <ClientItemTemplate>
                <input type="radio" id="contactChoice1" name="radioGroup" value="#=Option1#"">
                <label for="contactChoice1">#=Option1#"</label><br />
                <input type="radio" id="contactChoice2"name="radioGroup" value="#=Option2#">
                <label for="contactChoice2">#=Option2#</label><br />
                <input type="radio" id="contactChoice3" name="radioGroup" value="#=Option3#">
                <label for="contactChoice2">#=Option3#</label>
        </ClientItemTemplate>
    </telerik:GridTemplateColumn>


    You can find useful sample demonstrating such binding here:
    https://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/client-item-template/defaultcs.aspx


    Regards,
    Vessy
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top