This is a migrated thread and some comments may be shown as answers.
RadGrid with RadRadiobuttonlist + bind clientside
1 Answer 7 Views
This is a migrated thread and some comments may be shown as answers.
Prathibarani
Top achievements
Rank 1
Prathibarani asked on 13 Jun 2018, 04:59 PM

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

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 18 Jun 2018, 01:05 PM
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.
Tags
Grid
Asked by
Prathibarani
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or