Grid Grouping problem

I have a gridgroupingcontrol that allows user to drag a column header to group by those columns.

1.
How do I change the backcolor of this group drop area, i.e the row with the label "Drag a column here to group by that column"

2.
Right before the label with the text "Drag a column here to group by that column" there is the text "Table1". I'd like to get rid of this text also.

5 Replies

HA haneefm Syncfusion Team June 28, 2007 07:24 PM UTC

Hi Nedu,

1)How do I change the backcolor of this group drop area, i.e the row with the label "Drag a column here to group by that column"
>>>>>>>>>>>>>
Below is a forum thread that discuss with the similar issue.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=18850

2)Right before the label with the text "Drag a column here to group by that column" there is the text "Table1". I'd like to get rid of this text also.
>>>>>>>>>>>>>
Use the DragColumnHeaderText property of the GridGroupDropArea to change the group drop area text in a grouping grid. Here is a code snippet.

this.grid.GridGroupDropArea.DragColumnHeaderText = String.Empty;//For Hide the text.

Best regards,
Haneef


CH Chinedu June 28, 2007 08:20 PM UTC

thanks a million for the prompt reply and help...as usual Haneef, you always come thru.

Thanks a million


CH Chinedu June 28, 2007 08:28 PM UTC

A little problem Haneef,

The "Table1" part of the text shows up when data is loaded into the grid.

So on Startup, the grid shows the text I want by use of the code snippet.
GridGroupDropArea.DragColumnHeaderText =
"My new string here";

But once data is loaded into the Grid, it puts the text "Table1" before my preferred text in the dragdrop area


HA haneefm Syncfusion Team June 28, 2007 09:03 PM UTC

Hi Nedu,

The GroupDropArea of the GridGroupingControl, is a collection of GridControls internally with columns in a panel named GroupDropPanel. These columns can be formatted using the PrepareViewStyleInfo event for each of the grids in the GroupDropArea. Below is a code snippet to show this task.

private void ParentTable_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
if (e.ColIndex == 2 && e.RowIndex == 2)
{
e.Style.Text = "New TableDescriptor Name";
e.Style.Font.Bold = true;
e.Style.BackColor = Color.YellowGreen;
e.Style.TextColor = Color.Blue;
e.Style.CellType = "Static";
e.Style.HorizontalAlignment = GridHorizontalAlignment.Left;
e.Style.Enabled = false;
}
}

Sample : GroupDropFormatting.zip

Best regards,
Haneef


CH Chinedu June 29, 2007 09:30 PM UTC

Thanks a million Haneef.

Loader.
Up arrow icon