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

[Solved] DropDownList in ClientTemplate

6 Answers 355 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.
Rafael
Top achievements
Rank 1
Rafael asked on 28 Sep 2010, 02:46 PM
I use Ajax binding and want to use drop down list in the column in Display mode
From the docs I got that display template doesn't work when Ajax binding.
In below code ViewData["RateMode"] contains pair value/text, but I can't get Text in the grid's column
Who could tell me what I missed???
 .ClientTemplate
                            (
                                "<%#= Html.Telerik().ComboBox().Name(\"RateModeComboBox\").BindTo(ViewData[\"RateMode\"] as SelectList) #> "
                            );
Is there some simple code how to implement drop down list for Ajax binding in display mode?  

In Edit mode I use edit template and it works fine

6 Answers, 1 is accepted

Sort by
0
MGrassman
Top achievements
Rank 2
answered on 30 Sep 2010, 05:09 PM
Have you figured this out or Telerik could you provide an example?
0
Rafael
Top achievements
Rank 1
answered on 01 Oct 2010, 06:35 AM
here is how I resolve the point
columns.Bound(p => p.RateMode).Visible(true).Title("Rate").Width(80)
                            .ClientTemplate
                            (
                                "<select id='RateModeDDL'  class='t-widget ' style='Width: 80px; color: 'black' > " +
                                "<option value = " + "<#=RateMode#>" + ">" + "<#=RateModeName#>" + "</option>" + 
                                "</select>"  
                            );  


0
nachid
Top achievements
Rank 1
answered on 01 Oct 2010, 01:05 PM
I cannot understand why it is working for me !!!

When you use Ajax binding, you have normally to use client templates.

In DisplayMode, I had to use a template and that's normal.
However, I was surprised to have my nice dropdown list displayed when I pass to inline Edit mode !!!

All what I did is having a UIHint that displays an edit template I created for my dropdown  type.

I still did not investigate why it is working.
How the client knows about something that normally exist only on the server

Unless the information is kept in the Edit form at the first download.
0
Rafael
Top achievements
Rank 1
answered on 01 Oct 2010, 04:08 PM
can you show you client template for display mode in Ajax binding?
According to docs there is no way to use template in display mode for ajax binding 
0
nachid
Top achievements
Rank 1
answered on 01 Oct 2010, 04:24 PM
I didn't say it is working for display mode
I said it is working for EDIT mode
0
ronald
Top achievements
Rank 1
answered on 29 Mar 2011, 11:28 PM
been trying to do thsi for edit mode but no luck .. Can you please show me your sample code?
Tags
Grid
Asked by
Rafael
Top achievements
Rank 1
Answers by
MGrassman
Top achievements
Rank 2
Rafael
Top achievements
Rank 1
nachid
Top achievements
Rank 1
ronald
Top achievements
Rank 1
Share this question
or