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.

Showing RecordPlusMinus button for specific row

Thread ID:

Created:

Updated:

Platform:

Replies:

72246 Mar 10,2008 04:55 PM Mar 15,2008 12:18 AM Windows Forms 1
loading
Tags: GridControl
Derrick
Asked On March 10, 2008 04:55 PM

I want to "simulate" nested tables without actually having table relations. What I need to be able to do is to activate the RecordPlusMinus button for a specific row and then I'll hook onto the RecordExpanding event to perform my "simulated" nested table handling. The following code is where I'm at but it is obviously not working. Any ideas?

private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
GridVisibleColumnDescriptor firstColumn = gridGroupingControl1.TableDescriptor.VisibleColumns[0];
GridColumnDescriptor column = e.TableCellIdentity.Column;
if (column != null && firstColumn != null && column.Name == firstColumn.Name)
{
Record record = e.TableCellIdentity.DisplayElement.ParentRecord;
if (record != null &&
record.ParentTable.TableDescriptor.Name == _myDataTable.TableName)
{
e.TableCellIdentity.TableCellType = GridTableCellType.RecordPlusMinusCell;
e.Style.CellType = "NestedTable Row Header";
}
}
}


Administrator [Syncfusion]
Replied On March 15, 2008 12:18 AM

Hi Derrick,

Sorry for the delay in responding.

If your intention is to prevent the Plus/Minus symbol of the Parent table when there is no record in the Child table, it can be achieved by the following code:


[C#]
protected void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordPlusMinusCell)
{
Record r = e.TableCellIdentity.DisplayElement.ParentRecord as Record;
if (r != null && r.NestedTables.Count > 0 && r.NestedTables[0].ChildTable.FilteredChildNodeCount == 0)
{
e.Style.CellType = "Static";
}
}
}


Please refer the below KB link to get more details and sample which illustrates the above:

http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=311

If I have misunderstood your requirement, could you please explain me in detail, so that I can work in
depth and try to send a better solution?

Regards,
G.Yavana


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.

;