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

change dropdown list content based on current record.

Thread ID:





49109 Sep 11,2006 10:09 PM UTC Sep 12,2006 08:45 AM UTC WinForms 1
Tags: Grouping
Michael Gutkin
Asked On September 11, 2006 10:09 PM UTC

I need to change a content of dropdown list in my grouping control based on the current record.
Here is what I did:
1. I bound dropDown list column for each group level to listSource
grid.Engine.SourceListSet.Add("UserActions", dvActions);
2. Added myControlo_TableControlCurrentCellShowingDropDown event to catch when user clicks the dropdown.
3. use CurrentCell value in the event to identify what control (what column) was clicked.
int ColIndex = ((Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl)(sender)).TableControl.CurrentCell.ColIndex;

5. Use ColIndex to identify column name to decide what function to call for the given control.

string tableName = ((GridTableControlCurrentCellShowingDropDownEventArgs)e).TableControl.Table.CurrentRecord.ParentChildTable.Name;

string colName = ((Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl)(sender)).GetTableDescriptor(tableName).Columns[ColIndex].Name;

6. change Filter value based on the current record and clicked control:
string filerValue ="RuleID = ''" + ((Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl)(sender)).Table.CurrentRecord.GetValue("_ruleID").ToString() + "''";
dvActions.RowFilter = filerValue;

My problem is that ColIndex value not always what I expect it would be. Therefor colIndex translation to column name not always work!!!
Does anybody knows how to convert current cell index to a currect datacolumn index???

Administrator [Syncfusion]
Replied On September 12, 2006 08:45 AM UTC

Hi Michael,

Use this code snippet to get the current column information in TableControlCurrentCellShowingDropDown event.

int index = e.TableControl.TableDescriptor.ColIndexToField(e.TableControl.CurrentCell.ColIndex);

Console.WriteLine("Current Column Name : " + e.TableControl.TableDescriptor.VisibleColumns[index].Name );

Best Regards,


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

This page will automatically be redirected to the 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