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.
Unfortunately, activation email could not send to your email. Please try again.

change or filter a list in the event QueryCellStyleInfo (WinForms)

Thread ID:

Created:

Updated:

Platform:

Replies:

90427 Sep 30,2009 11:39 AM Oct 1,2009 06:24 AM Windows Forms 1
loading
Tags: GridControl
Adrien Falconnet
Asked On September 30, 2009 11:39 AM

I want to change the datasource of a GridListControl (which is in a column of a grouping grid) in the event QueryCellStyleInfo.
This is the code below in the event QueryCellStyleInfo :

e.TableCellIdentity.Table.Engine.SourceListSet[stat.Code].List = selectStatus.ToList();
e.TableCellIdentity.Table.TableDescriptor.Relations[0].Name = "Name";
e.TableCellIdentity.Table.TableDescriptor.Relations[0].MappingName = "Code";
e.TableCellIdentity.Table.TableDescriptor.Relations[0].ChildTableName = stat.Code;

This code doesn't work. I can't update my list in the event QueryCellStyleInfo. There's no items in my list. Why ??

Adrien Falconnet.

Jisha Joy [Syncfusion]
Replied On October 1, 2009 06:24 AM

Hi,

Thank you for posting query to us.

Please see the following code that shows how to set datasource to the gridlist dropdown in GridGroupingControl in QueryCellStyleInfo event.

this.gridGroupingControl1.TableDescriptor.Columns["Col0"].Appearance.AnyRecordFieldCell.CellType = "GridListControl";

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell
|| e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
{
if (e.TableCellIdentity.Column != null && e.TableCellIdentity.Column.MappingName == "Col0")
{

e.Style.DataSource = GetTable1();
e.Style.DisplayMember = "ID";
e.Style.ValueMember = "Description";

}
}
}

Regards,
Jisha

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.

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.

;