Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 C#3.0 C# C#4.0
Hi my dear friends.
when i clear the radcombobox text property the selected value is still valued. i want to set the selected value to null when i clear the text property. How can i do that?
thanks.
Posted 1-Jul-12 5:57am
Edited 1-Jul-12 6:00am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You better ask this question from telerik forum. here is a thread from there disusing similar problem
 
http://www.telerik.com/community/forums/aspnet/combobox/how-do-i-clear-a-radcombobox-including-selecteditem.aspx[^]
  Permalink  
Comments
Pooyan Behroozfar at 4-Aug-12 4:00am
   
i want to do it automaticaly when i clear it runtime with backspace.
what can i do?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

set
combo.selectedIndex = -1
 
Happy Coding!
Smile | :)
  Permalink  
Comments
Pooyan Behroozfar at 6-Aug-12 2:20am
   
i know that. but when i clear it with backspace the selected index still remains.
aarti meswania at 6-Aug-12 3:02am
   
yes if you are removing string the 'selected index' will be same, because there is not any index available for empty string
you add an empty string element in your combobox
Pooyan Behroozfar at 7-Aug-12 1:49am
   
OK. Thank you.
aarti meswania at 7-Aug-12 1:55am
   
welcome! :)
Volynsky Alex at 9-Aug-12 6:53am
   
Good!
aarti meswania at 9-Aug-12 6:54am
   
Thank you! :)
Volynsky Alex at 9-Aug-12 6:56am
   
You are welcome aarti :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

You can add one key value pair to data source of comboBox. Set its value to null or int.MinValue when display member is string.Empty.
  Permalink  
Comments
Pooyan Behroozfar at 9-Aug-12 3:34am
   
How can i add one key value pair to data source?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 519
2 Maciej Los 305
3 BillWoodruff 250
4 Mathew Soji 195
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,777
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 9 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100