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

GridViewComboBoxColumn doesn't work properly on edit

1 Answer 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ramsha
Top achievements
Rank 1
Ramsha asked on 16 Feb 2016, 04:34 AM

The ItemsSource of GridView:

ProductID,

Name,

Code,

ProductTypeName(GridViewComboBoxColumn)

The ItemsSource for GridViewComboBoxColumn :
ProductTypeID,

ProductTypeName

The problem is when I select another item from the ComboBox after double clicking the column in the RowEnded event, it doesn't give me the Updated ProductTypeID, instead it always gives me the ProductTypeID which was first bound when I loaded the GridView. I think there is some issue with the Bindings

Here is the Xaml:

<telerik:RadGridView.Columns>
   <telerik:GridViewDataColumn x:Name="ID" 
        DataMemberBinding="{Binding ProductID}" 
Header="ID" 
IsReadOnly="True" 
        IsVisible="False"/>

    <telerik:GridViewDataColumn x:Name="Code" 
        DataMemberBinding="{Binding Code}" 
        Header="Code" 
        IsReadOnly="False" />

    <telerik:GridViewDataColumn x:Name="Name" 
        DataMemberBinding="{Binding Name}" 
        Header="Name" 
        IsReadOnly="False" />
                   
<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding ProductTypeName}"
        UniqueName="ProductType"
        SelectedValueMemberPath="ProductTypeName"
        DisplayMemberPath="ProductTypeName"
        Header="ProductType"/>

    </telerik:RadGridView.Columns>
</telerik:RadGridView>

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 16 Feb 2016, 03:34 PM
Hello Ramsha,

I believe you would find the following article regarding the ComboBox Column helpful. I would also recommend having a look at our developer-focused examples in our SDK Examples Browser and more specifically - the ones regarding the ComboBoxColumn. Please also have a look at the following demo about the RadGridView ComboBoxColumn.

To help you out, I've attached a sample project, resembling the scenario you've described. Please have a look at it and let me know whether it works for you.

Regards,
Dilyan Traykov
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Ramsha
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or