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

Grid Batch Update combobox returns the Id when selected instead of the name

2 Answers 43 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.
Gurpreet
Top achievements
Rank 1
Gurpreet asked on 11 Jul 2011, 04:05 PM

Requirements

RadControls version

 

.NET version

 

Visual Studio version

 

programming language

 

browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
I'm using the Batch Update feature of the Grid.

In the Grid, I have added a combobox with certain values. The value of the combobox can be null.

When I select a value from the combo box, the value displayed in the grid after selection is the id and not the name.

How can I get the name displayed after combobox value selection instead of its id.

Here is the code of the grid which I created

@(Html.Telerik().Grid<

 

CleaningEntitySearchResults>()

 

.Name(

 

"Grid")

 

.DataKeys(keys =>

{

keys.Add(s => s.SRNo);

})

.Columns(columns =>

{

columns.Bound(x => x.SRNo).Title(

 

"SR#").HeaderHtmlAttributes(new { style = "width:5px" }).ReadOnly();

 

columns.Bound(x => x.BldgNo).Title(

 

"BLDG#").Width(5).ReadOnly();

 

columns.Bound(x => x.StreetNo).Title(

 

"Street").Width(50).ReadOnly();

 

columns.Bound(x => x.Boro).Title(

 

"Boro").Width(0).ReadOnly();

 

columns.Bound(x => x.Zip).Title(

 

"Zip").Width(0).ReadOnly();

 

columns.Bound(x => x.CmmunityBoard).Title(

 

"CB").Width(0).ReadOnly();

 

columns.Bound(x => x.SanDistrict).Width(0).Title(

 

"SD").ReadOnly();

 

columns.Bound(x => x.GS).Width(50).Title(

 

"GS").ReadOnly();

 

columns.Bound(x => x.CleaningEntityName).Width(10).Title(

 

"Cleaning Entity").ReadOnly();

 

columns.Bound(x => x.CO).Width(50).Title(

 

"CO").ReadOnly();

 

columns.Bound(x => x.CleaningMethod).Width(0).Title(

 

"FGF Cleaning Method").ReadOnly();

 

columns.Bound(x => x.OnGroundFloor).Title(

 

"On Ground Floor").ReadOnly()

 

.HeaderHtmlAttributes(

 

new { style = "height:100px;width:5px;align:center" });

 

columns.Bound(x => x.OnRollDownGate).Width(40).Title(

 

"On Roll-Down Gate").ReadOnly();

 

columns.Bound(x => x.Resolution).Width(200).Title(

 

"Resolution Action");

 

columns.Bound(x => x.AffectedDate).Width(130).Title(

 

"Affected Date").Format("{0:d}");

 

columns.Bound(x => x.Paint).Width(5).Title(

 

"Paint")

 

.ClientTemplate(

 

"<input type='checkbox' disabled='disabled' name='Paint' <#= Paint? checked='checked' : '' #> />")

 

.HtmlAttributes(

 

new { style = "text-align:center" });

 

columns.Bound(x => x.Powerwash).Width(5).Title(

 

"Powerwash")

 

.ClientTemplate(

 

"<input type='checkbox' disabled='disabled' name='Powerwash' <#= Powerwash? checked='checked' : '' #> />")

 

.HtmlAttributes(

 

new { style = "text-align:center" });

 

})

.DataBinding(dataBinding => dataBinding.Ajax()

.Update(

 

"UpdateRecords", "UpdateCompletedSites"))

 

.Editable(editing => editing.Mode(

 

GridEditMode.InCell))

 

.ToolBar(commands =>

{

commands.SubmitChanges();

})

.Sortable()

.EnableCustomBinding(

 

true)

 

.Pageable(o => o.PageSize(20))

.ClientEvents(events => events.OnDataBinding(

 

"onGridBinding")))

-------------------------------------------------------
And this is the combobox which I created

 

@(Html.Telerik().ComboBox()

.Name(

 

"Resolution")

 

.DataBinding(binding => binding.Ajax().Select(

 

"_SelectRA", "UpdateCompletedSites")))

-------------------------------------------------------

 

 

 

Please suggest what thing am I missing?

Thanks a lot

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 11 Jul 2011, 04:13 PM
Hi Gurpreet,

 You can check this code library project.

Regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Gurpreet
Top achievements
Rank 1
answered on 11 Jul 2011, 09:29 PM
Thanks for the solution. Its giving the correct results.
Tags
Grid
Asked by
Gurpreet
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Gurpreet
Top achievements
Rank 1
Share this question
or