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

Prevent user from selecting discontinued value

5 Answers 77 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
alastairw
Top achievements
Rank 1
alastairw asked on 19 Feb 2010, 03:09 AM

If you look at the example http://www.telerik.com/help/winforms/combo_databindingcustom.html  I dont want to see the discontinued items in the list when i open the combobox, but i need to see the text if i bring up an old record that has since had the item discontinued.

Can this be done?


5 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 22 Feb 2010, 10:03 AM
Hi alastairw,

Can you please explain your scenario in more details as I am having a little trouble understanding the last part of your last sentence, namely, "an old record that has since had the item discontinued"?

You can hide the items by setting their Visibility property to Collapsed.

I am looking forward to your reply.

Kind regards,

Victor
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
alastairw
Top achievements
Rank 1
answered on 25 Feb 2010, 11:24 PM
i will try to explain bettter.

Say i have customers that have a status. The statuses could "Gold" , "Silver", "Bronze".
eg
Customer A - Gold
Customer B - Silver
Customer C - Bronze

On my UI I have the customer details and have a combo box for the statuses with the 3 items in it.

The boss decides that we no longer want to be able to set a status to bronze, but if we view an old customer whos status was bronze then i need to see it. 

So my status table has ID, Description, IsActive. I can use the ItemDataBound method to inspect the dataitem and if it is not set to active then I can set the "Visibility property to Collapse" but that leaves a blank line at the botton on the combo box.

Hope this explains better.

A



 
0
Victor
Telerik team
answered on 02 Mar 2010, 09:21 AM
Hi alastairw,

Thank you for the clarification. Still I cannot track down the issue. In the first post you asked how to hide the status for new customers but still show it for the old ones, in the second post you indicated that you can do it but you have a blank line at the bottom of the combo box. Please indicate which one is the real issue.

Normally setting Visibility to Collapsed causes the item to disappear, its size becomes 0 and it does not take any screen space. The fact that RadComboBox still measures the item in order to calculate its size is an issue on our side and will be fixed in a future release.

I am looking forward to your reply.

Regards,

Victor
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
Lee
Top achievements
Rank 1
answered on 09 Apr 2010, 01:20 PM
Hi Victor,

I have same issue like Alastairw.  The scenario is quite common,  What happens is we may have some Products categories and over a period of time, some categories are marked as deleted.  which means that new Products cannot be a part of deleted category.

So assume we are having a Grid which allows to list and add new products. also assume Cateogry is a lookup column within Grid.
1. While listing products it should display category even irrespective of marked as deleted.
2. but user should not be allowed to select deleted category. somehow the dropdown should be able to skip the deleted Row.

So we don;t want to hide deleted cateogry, but at the same time we don;t want to allow user to select deleted ones.

If this is really not possible then i would be happy if I can mark the Row in dropdown list as "red" background and "While" forground.
Atleast that will indicate user that he should not choose this row..

Regards
Lee..

0
Victor
Telerik team
answered on 14 Apr 2010, 02:47 PM
Hi Lee,

Thank you very much for the clarification, now I understood the issue.

You can always set the items corresponding to the deleted categories to Enabled = false. This will stop the mouse events and you will not be able to select these items. These items can still be selected via code but not through the GUI.

Regards,
Victor
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.
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
alastairw
Top achievements
Rank 1
Answers by
Victor
Telerik team
alastairw
Top achievements
Rank 1
Lee
Top achievements
Rank 1
Share this question
or