We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

when I use columntype combobox ,how can I cancel the select value imediately after I select the value which already appear in other rows?

when I use columntype combobox ,how can I cancel the select value imediately after I select the value which already appear in other rows?


5 Replies

SE Sean November 29, 2007 09:53 AM UTC

Hi,about this question I want to know how can I get the currentcellvalue before gridDataBoundGrid1.CurrentCell.ConfirmChanges() happen and after I select a new value,so I can compare the value I choose with the old data.
thanks.

>when I use columntype combobox ,how can I cancel the select value imediately after I select the value which already appear in other rows?





AD Administrator Syncfusion Team November 29, 2007 10:49 AM UTC

Here is a minimal sample that uses tableControlCurrentCellValidating to make sure your user never chooses a duplicate value in a combobox column.





WindowsApplication4.zip


SE Sean November 29, 2007 10:55 AM UTC

Thanks for your codes.My question is resolved.



AD Administrator Syncfusion Team November 29, 2007 05:04 PM UTC

Just for the record for anyone who might be trying to use this sample, I think the code that Inserts a new value should be changed to:

uniquesList.Insert(-(loc + 1), k);




SE Sean November 30, 2007 02:06 AM UTC

I attach a file that can resolve my problem and also control the rows number for no more than the items count in the dropdownlist.

willing it will help other people.



Test1.zip

Loader.
Live Chat Icon For mobile
Up arrow icon