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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Highligting when draging & droping in gcc

Thread ID:

Created:

Updated:

Platform:

Replies:

37882 Dec 1,2005 04:54 PM UTC Dec 1,2005 08:05 PM UTC WinForms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 1, 2005 04:54 PM UTC

Hello in the ggc, When draging and dropping i want to Highlight or change the backcolor of the current row (target) and the backcolor of the source row, i tried the following code but it''s not working private void grid_DragOver(object sender, DragEventArgs e) { GridGroupingControl grid = sender as GridGroupingControl; if(grid!= null) { GridTableControl tableControl = grid.TableControl; Point pt = new Point(e.X, e.Y); int row, col; if(tableControl.PointToRowCol(pt, out row, out col)) { GridTableCellStyleInfo style = tableControl.Model[row, col]; if(style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell // .RecordRowHeaderCell || style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell) { style.BackColor = Color.Yellow; grid.TableDescriptor.Appearance.AnyHeaderCell.BackColor = Color.Yellow; } } the other question taht i have is : How can i reference the RecordFieldCell and the AlternateRecordFieldCell of the nestedTables could you please help me with this. Thanks

Administrator [Syncfusion]
Replied On December 1, 2005 05:32 PM UTC

You cannot set individual cell properties in a GridGroupingControl using an indexer. To set properties on a cell by cell basis, you need to use QueryCellStyleInfo. Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GGC_DnD_5f40c779.zip Where do you want to reference records in a child table? Depending on where you are, there may be simpler ways. In general, you can try using this.gridGroupingControl1.GetTable("ChildTableName").Records to get at all records in a child table. There is also a FilteredRecords collection that gives you the visible records.

Administrator [Syncfusion]
Replied On December 1, 2005 06:05 PM UTC

Thank you very much Clay, it''s works for referencing the Childtable, i mean : in the QueryCellStyleInfo when i want to modify the style of a RecordRowHeaderCell i use the condition : if(e.TableCellIdentity.TableCellType == GridTableCellType.RecordRowHeaderCell but what i want to modify is the RecordRowHeaderCell style of the nestedChilds Thanks >You cannot set individual cell properties in a GridGroupingControl using an indexer. > >To set properties on a cell by cell basis, you need to use QueryCellStyleInfo. Here is a little sample. >http://www.syncfusion.com/Support/user/uploads/GGC_DnD_5f40c779.zip > >Where do you want to reference records in a child table? Depending on where you are, there may be simpler ways. In general, you can try using this.gridGroupingControl1.GetTable("ChildTableName").Records to get at all records in a child table. There is also a FilteredRecords collection that gives you the visible records.

Administrator [Syncfusion]
Replied On December 1, 2005 06:15 PM UTC

Try code like:
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
	if((e.TableCellIdentity.TableCellType == GridTableCellType.RecordRowHeaderCell || 
		e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordRowHeaderCell)
		&& (e.TableCellIdentity.Table.TableDescriptor.Name == "ChildTable"))
	{
		e.Style.BackColor = Color.Red;
	}
}

Administrator [Syncfusion]
Replied On December 1, 2005 07:44 PM UTC

Thank you always in the QueryStyleInfo how can i test someting like " if(e.TableCellIdentity.RowIndex == 5)" but this time for the nested tables >Try code like: >
>private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
>{
>	if((e.TableCellIdentity.TableCellType == GridTableCellType.RecordRowHeaderCell || 
>		e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordRowHeaderCell)
>		&& (e.TableCellIdentity.Table.TableDescriptor.Name == "ChildTable"))
>	{
>		e.Style.BackColor = Color.Red;
>	}
>}
>

Administrator [Syncfusion]
Replied On December 1, 2005 08:05 PM UTC

I am not sure I understand what you want, but did you try adding the criteria to your rowindex condition? e.TableCellIdentity.Table.TableDescriptor.Name == "ChildTable")) Or, do you want to find the 5th row in the child table? If so, try adding a criteria like: e.TableCellIdentity.Table.TableDescriptor.Name == "ChildTable" && e.TableCellIdentity.Table.Records.IndexOf(e.TableCellIdentity.DisplayElement.ParentRecord) == 5

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

;