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

[Solved] Grid edit mode combobox not showing selected item

4 Answers 149 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.
Gerard Eikelboom
Top achievements
Rank 1
Gerard Eikelboom asked on 17 Mar 2011, 11:33 AM
Hi,
A column in my Grid is showing the data from my model. When I want to edit this one I want to choose from a combobox.
So when I click on Edit the value wich was first shown is gone.
In the column I have a dropdown (that's ok) with the values from the database. The selected value is in the combobox.
So everything seems to work only the selected item is not shown on Edit.
I have a standard piece of js code for onEdit:
$(e.form).find('#allvaluta').data('tComboBox').select(function (dataItem) 
           {
               return dataItem.Text == e.dataItem['myvaluta']; 
           });
allvaluta = the combobox.ascx
myvaluta = column in my grid.

I bind the combobox in a AJAX client side way:
<%= Html.Telerik().ComboBox()
        .Name("allvaluta")
        .HighlightFirstMatch(true)
        .Filterable(filtering =>
            filtering.FilterMode(AutoCompleteFilterMode.Contains))         
        .DataBinding(binding => binding.Ajax()
        .Select("_SelectedValuta", "Account").Cache(true))
%>

I hope you can help me with ths small issue.

Regards,
Gerard Eikelboom

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 17 Mar 2011, 01:48 PM
Hello Gerard,

 
At first glance, everything looks correct. In order to proceed with our investigation, I will ask you to send us a simple test project. Thus I will be able to observe the issue locally and advice you further.

Regards,
Georgi Krustev
the Telerik team
0
Gerard Eikelboom
Top achievements
Rank 1
answered on 17 Mar 2011, 02:40 PM
Hi Georgi,

I made a test application (used one we used before and added the client edit.
It's a bit crappy( for instance if you startup the application you don't see the arraow in the first column. You can click in the column and the client grid wil open.)
Then on your right you see a crappy button. Click it and you are in edit modus. You see what exactly what we have at the moment in our application.
 I made it for the len column.
Good luck,

Gerard Eikelboom
0
Gerard Eikelboom
Top achievements
Rank 1
answered on 17 Mar 2011, 04:26 PM
Hi Georgi,

I found a solution for the problem.
instead of
$(e.form).find('#allvaluta').data('tComboBox').select(function (dataItem)  
           
               return dataItem.Text == e.dataItem['myvaluta'];  
           });

I use:
var valutacombo = $('#allvaluta').data('tComboBox');
                $(e.form).find(valutacombo);
                valutacombo.fill(function () {
                    valutacombo.select(function (dataItem) {
                        return dataItem.Text == e.dataItem['myvaluta'];
                        })
                });

It shows the valuta as in the grid.
This one is solved for me.
One problem left.
Regards,
Gerard Eikelboom
0
Georgi Krustev
Telerik team
answered on 19 Mar 2011, 11:06 AM
Hello Gerard,

I am glad to hear that you was able to resolve your problem. As to the other question, I have already answered it. 

Regards,
Georgi Krustev
the Telerik team
Tags
Grid
Asked by
Gerard Eikelboom
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Gerard Eikelboom
Top achievements
Rank 1
Share this question
or