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

Making GridViewComboBoxColumn Cell Show a Value that Does Not Exist In ItemsSourceBinding

2 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 13 Jul 2010, 10:43 PM
Not sure if the title does it justice or not but what I'm trying to do is have the grid display the value of the property the underlying row is bound to even if that value does not exist in the list the combobox items is bound to. So, for example, we have a list of customers that the grid is bound to and it has a Name, membership start date and membership type columns. The membership type column is bound to a list that is filtered based on the membership start date. If the membership start date is past a certain point, only certain membership types can be selected.

Now, if in the list the customer has a membership that that is no longer active, we still want the grid to display the inactive membership type, but when the user goes into the cell to edit it, this inactive membership status should NOT be available in the dropdown. Currently, the RadGridView displays an empty string in the membership type column since the inactive membership is not in the list the ItemsSourceBinding is bound to.

How do you go about achieving this?

Any help is greatly appreciated,

Carlos

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 15 Jul 2010, 03:13 PM
Hello Carlos Santos,

GridViewComboBox does not support scenarios whenre the items source does not contain one of the values.

Therefore a slightly different approach may be used here- use a regular GridViewDataColumn. Palce two combos in the cell - one for edit mode and one for display mode.
Teh first one - with the filtered source, the second one with the whole source.

This is demonstrated in the sample attached. It has a combo column with countries to select.
It displays all the 4 countries, but the editing  combo has 2 of them filtered.

Please use the attached project as a starting point.

Kind 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
Carlos
Top achievements
Rank 1
answered on 15 Jul 2010, 04:11 PM
Sounds good.

Thanks.
Tags
GridView
Asked by
Carlos
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Carlos
Top achievements
Rank 1
Share this question
or