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

do not allow the user to select particular text

3 Answers 72 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 30 Jul 2008, 12:34 AM
I have a couple of comboboxes on my page.
My data model is such that each dropdownlist has an unknown value.

I want to preselect the value unknown on a new record but I do not want to allow the user to select it from the list.

Is that possible?

I can change the value unknown to 'Please Select One' while getting the values from the database.Can i display it like <please select one> with the '<' and '>' .I only want to do it for this particular value so that rather than looking like a value in the list it looks like a prompt. I need to have that value in the list at all times though because I create a new record using those values.

I hope I am making sense.

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 30 Jul 2008, 09:09 AM
Hello newbie,

Have you considered using the EmptyMessage property?

Kind regards,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
newbie
Top achievements
Rank 1
answered on 30 Jul 2008, 06:14 PM
I am sorry if I am creating a confusion.

The value 'Unknown' belongs to the table in the database.
At first I create a record when the user clicks an add new button and assign the value 'Unknown' to the record.

But that is only to create a record.(the value unknown is there to tie up any orphaned records for future)

What I want is either display 'unknown' as <Unknown>(or <Select a Value> as I can change the text while retrieving the record from the database) so that though it's  a value in the database it does not appear as one to the user.
If i change the text in my stored proc to have the '<' and '>' the dropdown list doesn't drop anymore.

Or if that's not possible I am hoping if there's a way so that the user cannot select that value from the list.

0
Veselin Vasilev
Telerik team
answered on 01 Aug 2008, 12:03 PM
Hi newbie,

In this case you can subscribe to the OnClientSelectedIndexChanging client-side event and cancel the event if the user has selected the unknown item.

In any case, you should be able to put the < and > signs as a text of a combo item.

Kind regards,
Veskoni
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
newbie
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
newbie
Top achievements
Rank 1
Share this question
or