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

[Solved] EditorTemplate combobox

3 Answers 102 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.
cp
Top achievements
Rank 1
cp asked on 14 Feb 2012, 01:28 AM
Hello,
Is it possible to bind a combobox inside an editortemplate when the grid is not in Edit mode? When I'm not in Edit mode, I cannot quite figure out how to get a reference to the combobox control.

Thanks,

3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 14 Feb 2012, 12:47 PM
Hi Claudio,

The ComboBox is not part of the DOM tree until the Grid does not enter edit mode and you cannot get the client object since the input element does not exist. Why you want to bind the ComboBox before the Grid enters Edit mode? Why don't you populate the ComboBox on the server side? 

Regards,
Petur Subev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
cp
Top achievements
Rank 1
answered on 14 Feb 2012, 04:05 PM
My grid is loaded via ajax, and the filtering applies not only to the grid but also to the editor template so I'm trying to find the most efficient way to rebind the combobox. I suppose I could store the data on the client side and rebind it when the grid enters the edit mode, unless you can think of a better way to do it?

Thanks,
0
Petur Subev
Telerik team
answered on 17 Feb 2012, 10:56 AM
Hi Claudiu,

 Basically you can configure your ComboBox to use Ajax binding combined with the OnDataBinding to send additional values to the server (using the data field exposed by the event argument object). This way you can populate your ComboBox with the most appropriate values coming from the server according to the value sent with the request.
Or yes you can rebind the ComboBox once you entered edit mode with a collection already stored on the client.

Regards,
Petur Subev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Grid
Asked by
cp
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
cp
Top achievements
Rank 1
Share this question
or