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

Get the Top Row Index of a Grid Grouping Control

Thread ID:

Created:

Updated:

Platform:

Replies:

103109 Mar 30,2012 04:35 PM UTC Apr 5,2012 11:44 AM UTC WinForms 1
loading
Tags: GridControl
Eric Robishaw
Asked On March 30, 2012 04:35 PM UTC

I DO NOT want the TopRowIndex property, I want to know the Row Index where the data starts...
which will be 1 if there are no groups, or captions, but some other number if there are groups, headers, captions, etc...

TopRowIndex only works if the grid is not currently scrolled.

One thing I want to do is SelectAllRows...

The following only works if the grid is not scrolled.
Grid.TableModel.Selections.SelectRange(GridRangeInfo.Rows(Grid.TableControl.TopRowIndex, Grid.TableControl.Model.RowCount), true);


Another thing I need the value for is to Resize the Column Header Row.




Mercy C [Syncfusion]
Replied On April 5, 2012 11:44 AM UTC

Hi Eric,

Thanks for your interest in Syncfusion products.

To get the RowIndex of first record of each group, please make use of the "QueryCellStyleInfo" event.

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.Column != null && e.TableCellIdentity.Column.Name == "parentID")
{
for (int i = 0; i < e.TableCellIdentity.DisplayElement.ParentChildTable.Groups.Count; i++)
{
row[i] = e.TableCellIdentity.DisplayElement.ParentChildTable.Groups[i].Records[0].GetRowIndex();
}
}
}

To select all the records, you can add the records into "SelectedRecords" collection.

for (int i = 0; i

When you resize the columns, "TableControlResizingColumns" event will be triggered from which you can get the colummn width.

void gridGroupingControl1_TableControlResizingColumns(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlResizingColumnsEventArgs e)
{
int width= e.Inner.Columns.Width;
}

Please refer to the sample in the following link

http://www.syncfusion.com/downloads/Support/DirectTrac/92937/WindowsFormsApplication78 (2)-650776031.zip

Please let me know if you have any concerns.

Regards,
Mercy.C



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

;