This is a migrated thread and some comments may be shown as answers.

[Solved] Select Radio button in grid

0 Answers 164 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Akash
Top achievements
Rank 1
Akash asked on 31 Aug 2011, 11:20 AM
Hi,

I have shown the radio button as the 2nd column of my Telerik grid which shows list of rooms, now I want to select one of the radio buttons based on some criteria at the time of loding the grid.  I am pasting my ascx code below , where you can see the that for second column I have used the template to create the radio button. Now I want to select first radio button for that I am trying to use the checked property  checked="checked" but it is not working. Can some will please tell me what is the correct way to select the radio button base on certain criteria. Please reply its urgent.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<HotelRoomDetails>" %>
<%@ Import Namespace="Gateway.DynamicPackage.UI.Web.Models.SearchResults" %>
  
  
  
<div class="Room_list" style= "background: grey" >
<%
     Html.Telerik().Grid(Model.GetHotelRoomDetails.OrderBy(p => p.Base.Amount))
        .Name("RoomList")
        .Columns(columns =>
            {
                columns.Bound(p => p.RateDescription.RoomNum).Format("Room").Width(50);
                columns.Template(p =>
                                     {
                                         //Html.RadioButton("aaaa",p.RateDescription.RoomNum);
                    %>
                        <input name="checkedRecords" type="radio" value="<%= p.RateDescription.RoomNum %>" title="checkedRecords"   checked="checked"   />
                    <%
                    }).Width(10);
                columns.Bound(p => p.RateDescription.RoomRateDescription).Title("Room Details").Width(200);
                columns.Bound(p => p.RateDescription.Availability).Template(p =>
                    {
                        if (p.RateDescription.Availability == 'R'.ToString())
                        {
                            %> On Request<%
                        }
                    });
                columns.Bound(p => p.Meals.MealType).Template(p =>
                {
                    if (p.Meals.MealType == "NoBoard".ToString())
                    {
                    %>
                        <img alt="<%=p.Meals.MealType%>" 
                        src="<%=Url.Content("~/Content/Styles/Site/Images/cup_icon.gif")%>" />
                    <%
                    }
                }).Title("Board");
                columns.Bound(p => p.Base.Amount ).Title("Rate for 1 night(s)");
            })
            .Groupable(settings => settings.Groups( groups => groups.Add(p => p.RateDescription.RoomNum)).Visible(false).Enabled( false))
            .Sortable()
            .Render();
    %>
    </div>
Tags
Grid
Asked by
Akash
Top achievements
Rank 1
Share this question
or