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

ComboBox selected item appearing null

4 Answers 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Madhu
Top achievements
Rank 1
Madhu asked on 15 Jun 2011, 01:37 PM
Hi,

We are using a RadGridview with few rows and few columns and one of the columns is a Combobox (Through Data Template) This Combobox is bound to a list Groups. User has to select a Group per row. We need to save the selected group to a repository through the ViewModel.

What would be the best way to achieve this? We have tried passing the .selecteditem as well the .text but we are unable to pass the Group selected by the user from the combobox. It always appears null.

Appreciate any inputs.

Regards,
Madhu

4 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 15 Jun 2011, 01:52 PM
Hi Madhu,

Have you seen the the GridViewComboBox column examples ?


Regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Madhu
Top achievements
Rank 1
answered on 15 Jun 2011, 01:57 PM
Thanks for the reply. Yes, I have seen this. We are using MVVM and we need some inputs on passing the selected item from a View to a ViewModel. This example is showing it implemented in code behind.

Regards,
Madhu
0
Vlad
Telerik team
answered on 15 Jun 2011, 01:59 PM
Hi,

Can you clarify what exactly is not MVVM in the example? 

All the best,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Madhu
Top achievements
Rank 1
answered on 15 Jun 2011, 02:10 PM
In our project we are not placing any code in the code-behind. In this example I am seeing the xaml.cs having all the code. We are placing our code in a ViewModel.cs

Can you please provide an example of using this Combo Box Column in such a way?

In the code from the example I can see this

  <Grid>
  <Border telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" />
        <telerik:RadGridView x:Name="RadGridView1" AutoGenerateColumns="False" MinHeight="386" MaxHeight="500" Width="300"
                             CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" ColumnWidth="*"/>
    </Grid>

Can you please explain how to define the column as a combobox type in XAML?

Thanks,
Madhu
Tags
GridView
Asked by
Madhu
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Madhu
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or