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

Retrieve selected value from combobox before it is added to datagrid

How do I retrieve selected value from combobox before it is added to GridDataBoundGrid control. My problem is as follows: I''m using combobox for one of the columns in a GridDataBoundGrid control. I have 2 tables in a dataset with tabel relation specified by PryKey1 in Table1 and ForeignKey2 in Table2. The combox is bound to Table1 with its MappingName set to PryKey1 of Table1. The StyleInfo.Dataset is bound to Table2 with its DisplayMember set to TblDescrp and ValueMember set to ForegnKey2. Everything works fine, except when I try to catch whatever is selected from the dropdown box in order to check if it already exist in Table1, I never seem to be able to do this.

3 Replies

KI Kingsley February 15, 2006 09:19 PM UTC

I have found a solution from the forum that allow me to access the selected value from the combobox. My question now is what event can I use to prevent the selected value from updating?


AD Administrator Syncfusion Team February 16, 2006 10:52 AM UTC

Hi Kingsley, You can use the CurrentCellCloseDropDown event, to check for the selected value before updating. In the event, you can use the GridComboxBoxCellRenderer to get the selected value. Also refer to this KB article How can I get the new value and the old value when an item is selected in a combobox cell? for more details. Regards, Madhan.


KI Kingsley February 16, 2006 02:37 PM UTC

Thanks Madhan, that was helpfull

Loader.
Live Chat Icon For mobile
Up arrow icon