This question is locked. New answers and comments are not allowed.
Hello,
I have a RadGridView which ItemsSource is an object containing other objects containing themselves other objects (I bind my Business Object to the Grid). The "BO" is something like a Customer. The Customer has an address and the address has a type, etc.
So First step, I bind the grid to my BO by setting the ItemsSource = List<Address>
<telerikGrid:RadGridView x:Name="_gridAddress" AutoGenerateColumns="False" ColumnsWidthMode="Fill">
<telerikGrid:RadGridView.Columns>
<telerikGrid:GridViewDataColumn UniqueName="TypeAdresse" DataMemberPath="TypeAdresse.Libelle"></telerikGrid:GridViewDataColumn>
</telerikGrid:RadGridView.Columns>
</telerikGrid:RadGridView>
So the BO hierarchy is :
Address -> TypeAddress -> Libelle
No problem, the "Libelle" is correctly shown in the grid.
Now I would like to be able to edit this value. As these values are part of an enumeration, I would like to use a ComboBoxEditor.
At the initialization time, I do :
ComboBoxEditorSettings sett = new ComboBoxEditorSettings();
sett.ItemsSource = listOfTypeAddress;
sett.DisplayMemberPath = "Libelle";
sett.SelectedValuePath = "id";
(_gridAddress.Columns["TypeAdresse"] as GridViewDataColumn).EditorSettings = sett;
The result is now correct, When I double click or F2 on the cell, the ComboBoxEditor appear and show me the different values.
The problem is that when the value is selected in the ComboBoxEditor and validated, only the "id" (SelectedValuePath) is going to be retreived and be placed in
the BO (Address->TypeAddress->Libelle) as my Grid is bound to it (specified by DataMemberPath)
What I would like is to retreive the selected TypeAddress in the ComboBox and place it as the current TypeAddress in my BO, so the gridview will still display the Libelle.
I tried to implement the CellValidating event, but I cannot figure out how to deal with this problem.
Please Help
Regards
I have a RadGridView which ItemsSource is an object containing other objects containing themselves other objects (I bind my Business Object to the Grid). The "BO" is something like a Customer. The Customer has an address and the address has a type, etc.
So First step, I bind the grid to my BO by setting the ItemsSource = List<Address>
<telerikGrid:RadGridView x:Name="_gridAddress" AutoGenerateColumns="False" ColumnsWidthMode="Fill">
<telerikGrid:RadGridView.Columns>
<telerikGrid:GridViewDataColumn UniqueName="TypeAdresse" DataMemberPath="TypeAdresse.Libelle"></telerikGrid:GridViewDataColumn>
</telerikGrid:RadGridView.Columns>
</telerikGrid:RadGridView>
So the BO hierarchy is :
Address -> TypeAddress -> Libelle
No problem, the "Libelle" is correctly shown in the grid.
Now I would like to be able to edit this value. As these values are part of an enumeration, I would like to use a ComboBoxEditor.
At the initialization time, I do :
ComboBoxEditorSettings sett = new ComboBoxEditorSettings();
sett.ItemsSource = listOfTypeAddress;
sett.DisplayMemberPath = "Libelle";
sett.SelectedValuePath = "id";
(_gridAddress.Columns["TypeAdresse"] as GridViewDataColumn).EditorSettings = sett;
The result is now correct, When I double click or F2 on the cell, the ComboBoxEditor appear and show me the different values.
The problem is that when the value is selected in the ComboBoxEditor and validated, only the "id" (SelectedValuePath) is going to be retreived and be placed in
the BO (Address->TypeAddress->Libelle) as my Grid is bound to it (specified by DataMemberPath)
What I would like is to retreive the selected TypeAddress in the ComboBox and place it as the current TypeAddress in my BO, so the gridview will still display the Libelle.
I tried to implement the CellValidating event, but I cannot figure out how to deal with this problem.
Please Help
Regards