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.
Syncfusion Feedback

Required a custom grouping header and row cells (See Snap shot)

Thread ID:

Created:

Updated:

Platform:

Replies:

63365 Jul 3,2007 09:30 AM UTC Jul 6,2007 06:06 AM UTC Windows Forms 4
loading
Tags: GridControl
Nhilesh Baua
Asked On July 3, 2007 09:30 AM UTC

Hi,

I require very special header and row cells which would be generated dynamically from DB and I am not sure if it is good to use GGC 5.4.x.x!

Can you please tell me if I need to use the customengine.cs and How can I amend if needed.

Thanks in advance.

Nhilesh Baua.


screen_shot1.zip

haneefm [Syncfusion]
Replied On July 3, 2007 08:04 PM UTC

Hi Nhilesh,

One way you can do this by hanlding the QueryCoveredRange event and set the covered rage for grouped rowheader cell and it corresponding grouped filed value. Below are the code snippet that show this task.

void TableModel_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e)
{
GridTableModel tableModel = sender as GridTableModel;

Element el = tableModel.GetDisplayElementAt(e.RowIndex);
if (el != null)
{
int count = el.ParentGroup.Records.Count - 1;
if (count > 0)
{
GridTableCellStyleInfo style = tableModel.Table.GetTableCellStyle(e.RowIndex, e.ColIndex);
if (e.ColIndex == 0)
{
e.Range = GridRangeInfo.Cells(e.RowIndex, e.ColIndex, e.RowIndex + count, e.ColIndex);
e.Handled = true;
}
else if (style.TableCellIdentity.Column != null
&& style.TableCellIdentity.Column.Name == "Rank")
{
e.Range = GridRangeInfo.Cells(e.RowIndex, e.ColIndex, e.RowIndex + count, e.ColIndex);
e.Handled = true;
}
}
}
}

Also refer the below sample for implementation and let me know if this helps.
GGC_NestedChilds.zip

Best regards,
Haneef

Nhilesh Baua
Replied On July 4, 2007 07:06 AM UTC

Hi Haneef,

Thanks for the code, that's something very near to the requirement, however 2 things I have noted with the same...

1. There is an extra blank row with header "Group" before all other groups.
2. If I mouse over on any of row headers and if mouse cursor is on the last row region of the group, it overlaps to the next group header.

and I get following error for
GridTableModel tableModel = sender as GridTableModel;

"Object reference not set to an instance of an object"

so couldn't test it further.

anyways thanks for the help so far.
Please let me know on the above things.

Thanks & Regards,
Nhilesh Baua

haneefm [Syncfusion]
Replied On July 4, 2007 05:49 PM UTC

Hi Nhilesh,

1. There is an extra blank row with header "Group" before all other groups.
>>>>>>>>>>>>>
You can hide the AddNewRecord by setting the TopLevelGroupOptions.ShowAddNewRecordBeforeDetails property to false. Below is a code snippet

this.gridGroupingControl1.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails = false;

2)If I mouse over on any of row headers and if mouse cursor is on the last row region of the group, it overlaps to the next group header.
>>>>>>>>

You can call the Refresh method to re-paint the columnheader on mousemove. Below are the code snippet

this.gridGroupingControl1.TableControl.MouseMove += new MouseEventHandler(TableControl_MouseMove);

void TableControl_MouseMove(object sender, MouseEventArgs e)
{
GridTableControl tc = sender as GridTableControl;
tc.Refresh();// Range(GridRangeInfo.Cols(1, 2));
}


Best regards,
Haneef

Nhilesh Baua
Replied On July 6, 2007 06:06 AM UTC

Hi Haneef,

Thanks for your efforts, I tried your way, However it did't got my work done. Anyways I figured out somthing else.

Still you are rocking , cheers :).

Regards,
Nhilesh Baua

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

;