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

GridViewComboBoxColumn no values

5 Answers 155 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tanner
Top achievements
Rank 1
Tanner asked on 11 Jan 2012, 11:44 PM
Hello,

Haven't found a specific case like mine on the forums, but I've tried several variances of code I've seen with no avail.

My problem is simple in nature, I have a data-bound GridViewComboBoxColumn that, when I load the program, doesn't display values synonymous with the data its bound to, or at all.  Data its bound to is correct on our other application using the same datasource, and the List<T> its bound to shows up when the combo box is clicked on, there are just no values initially in the grid.

XAML
<telerik:GridViewComboBoxColumn Header="Type" Width="160" UniqueName="Type" DataMemberBinding="{Binding Path=Type}" DisplayMemberPath="Name" /> 

C# on constructor call for the new view being created.
((GridViewComboBoxColumn)(Tasks.Columns[1])).ItemsSource = AdminHandler.GetQuestTaskTypes();

This is the ONLY instance of this in our tool, while every other GridViewComboBoxColumn is formatted the same way and working perfectly.  The only difference with this, is the C# is getting called inside the constructor of a new view, while the rest of the ItemsSource assignments are inside the LayoutRoot_Loaded event.

Thank you.

5 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 12 Jan 2012, 09:44 AM
Hi Tanner,

The first thing I can notice is that the declaration of GridViewComboBoxColumn misses SelectedValueMemberPath property. Could you try to set it and check whether you still get the same behavior ? 
Nevertheless, RadComboBox (which is the editing element of that column) searches for the selected value in its source only once and in case it is not found, it does not search again and no item is displayed. Could you verify whether all items in the source of the column are available in the initialization of the column ?  

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tanner
Top achievements
Rank 1
answered on 12 Jan 2012, 05:00 PM
I'd previously had SelectedValueMemberPath in there with no difference in output, tried again, and same outcome.

And yes I can verify that the data collection is present.  The values are there when I dropdown the combobox, I'm just not getting an initial value.  The correct values are also present in our application that shares the datasource edited by the tool that's having issues, and if i edit the values, they are correctly reflected.

There are also other fields of the same tool that are using the exact same custom objects, with this same code and are working perfectly, again, the only difference being that this view's datasources are being set inside the view's constructor instead of the LayoutRoot_Loaded Event.

Sorry if I'm sounding redundant or condescending I just want to make sure I'm conveying clear information.

Thank you again for your help in this matter.
0
Maya
Telerik team
answered on 13 Jan 2012, 07:31 AM
Hello,

Based on the information provided, my guess would be that initially when RadComboBox is searching in the source to find its SelectedValue, this particular value is not yet available. Will it be possible to fill the source for the column at once earlier - as you mentioned in the constructor for example ?

 
Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Tanner
Top achievements
Rank 1
answered on 13 Jan 2012, 07:37 PM
It is currently already setting the itemssource in the constructor for the view.
0
Maya
Telerik team
answered on 16 Jan 2012, 07:50 AM
Hi,

Unfortunately, I cannot suggest any further considering only the information provided. It would be great if you could send me a sample project reproducing the issue. Thus I will be able to debug it on my side and provide a solution for the case.

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Tanner
Top achievements
Rank 1
Answers by
Maya
Telerik team
Tanner
Top achievements
Rank 1
Share this question
or