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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

get current record when combobox selectedindex changes

Thread ID:

Created:

Updated:

Platform:

Replies:

54854 Jan 18,2007 06:54 PM UTC Jan 30,2007 01:00 PM UTC WinForms 3
loading
Tags: Grouping
James Blibo
Asked On January 18, 2007 06:54 PM UTC

I can I get the current record from the underlying datasource when the selected index of a combo box in the cell of that row chanages.

I am trying to use the TableControlCurrentCellShowingDropDown event, but can't seem to get to the Record.

Administrator [Syncfusion]
Replied On January 19, 2007 08:52 AM UTC

Hi James,

Thanks for being patience.

Please try using e.TableControl.Table.CurrentRecord property in the TableControlCurrentCellShowingDropdown event. The following is the code snippet

>>>>>>>>>>>> Code Snippet <<<<<<<<<<<<<
// TableControlCurrentCellShowingDropdown event
GridComboBoxCellRenderer cr = e.TableControl.CurrentCell.Renderer as GridComboBoxCellRenderer;
if (e.TableControl.Table.CurrentElement.IsRecord)
{
Record currentRecord = e.TableControl.Table.CurrentRecord as Record;
object obj = currentRecord.GetValue("parentID");
===
}
>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<

Have a nice day.

Best regards,
Madhan

James Blibo
Replied On January 29, 2007 06:31 PM UTC

This event is being raised even before the combo box opens or the selected index changes..

I am only interested in the selected index change property, if there is one.

I want to change other parts of the record when the selected index of the cobo box changes. I also want to be able to reset the combo box to its previous value when validate fails.

Administrator [Syncfusion]
Replied On January 30, 2007 01:00 PM UTC

Hi James,

Thank you for being patience.

This can be achieved by handling the TableControlCurrentCellCloseDropDown event. In the event the SelectedValue / SelectedIndex property can be handled to retrieve the selected value from the comboBox.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// TableControlCurrentCellCloseDropDown
GridComboBoxCellRenderer cr = e.TableControl.CurrentCell.Renderer as GridComboBoxCellRenderer;
object value = cr.ListBoxPart.SelectedValue; // SelectedItem;
if (e.TableControl.Table.CurrentElement.IsRecord)
{
Record currentRecord = e.TableControl.Table.CurrentRecord as Record;
switch (value)
{
case "One":
currentRecord.SetValue("Column1", 3);
break;
====
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Please refer to the following KB article for different validation techniques.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=340

Have a nice day.

Best regards,
Madhan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;