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

How to go recursively through all the detail tables and change appearances of them

Thread ID:

Created:

Updated:

Platform:

Replies:

96261 Sep 1,2010 01:08 PM UTC Sep 2,2010 09:11 AM UTC WinForms 1
loading
Tags: GridControl
David Mecteaux
Asked On September 1, 2010 01:08 PM UTC

Hi,

Perhaps I just didn't find it in the projects and in this forum....

I need to go through all the child tables and change their appearances. For instance I may need to toggle off their insertion row, or change their background color or make them editable or not editable. But I am having a hard time finding some example code that shows me how to do this. Could someone help?




Christopher Issac Sunder K [Syncfusion]
Replied On September 2, 2010 09:11 AM UTC

Hi David,

Thank you for your interest in Syncfusion products.

#1. To toggle of the insertion behavior in the child grid, you can make use of the following code which has been exposed through check box.


private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
this.gridGroupingControl1.GetTableDescriptor("MyChildTable").AllowNew = this.ChkToggle.Checked;
}


#2. To change the background color, use the below code.


this.gridGroupingControl1.GetTableDescriptor("MyChildTable").Appearance.AnyRecordFieldCell.BackColor = Color.Crimson;


#3. Toggle the editing of a child table can be achieved through the “QueryCellStyleInfo” event with the following code.


this.gridGroupingControl1.GetTable("MyChildTable").QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(Form1_QueryCellStyleInfo);

void Form1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record) // check if it is record.
{
e.Style.ReadOnly = !this.ChkEdit.Checked; // toggle the edit beahviour through check box.
}
}


Please refer the following sample which illustrates the above.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGC_ChildFormatting1502264451.zip

Please let me know if you have any other concerns.

Regards,
Christo.



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.

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

;