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. Image for the cookie policy date

GridGrouping + GridDataBoundGrid events

Hi, 1. On a GridGroupingControl, I would like to like to display the Row Number vs the total Rows. So if the the 2nd row of 10 is selected or highlited, "2/10" is displayed, and if the the 5th row of 10 is selected or highlited, "5/10" is displayed. With event do I fire. 2. On a GridDataBoundGrid, I would like to like to display the Row Number vs the total Rows. So if the the 2nd row of 10 is selected or highlited, "2/10" is displayed, and if the the 5th row of 10 is selected or highlited, "5/10" is displayed. With event do I fire. Best regards, Jamâl-Dine DISSOU

4 Replies

AD Administrator Syncfusion Team May 19, 2005 07:16 PM

1) You can try using the CurrentRecordContextChange event.
this.gridGroupingControl1.Table.CurrentRecordContextChange += new CurrentRecordContextChangeEventHandler(Table_CurrentRecordContextChange);

private void Table_CurrentRecordContextChange(object sender, CurrentRecordContextChangeEventArgs e)
{
	if(e.Action == CurrentRecordAction.EnterRecordComplete)
	{
		int index = 1 + e.Table.FilteredRecords.IndexOf(e.Record as GridRecord);
		int count = e.Table.FilteredRecords.Count;
		this.label1.Text = string.Format("{0} of {1}", index, count);
	}
}
2) Try RowEnter.
this.gridDataBoundGrid1.RowEnter += new GridRowEventHandler(gridDataBoundGrid1_RowEnter);

private void gridDataBoundGrid1_RowEnter(object sender, GridRowEventArgs e)
{
	int count = this.gridDataBoundGrid1.Model.RowCount - ((this.gridDataBoundGrid1.Binder.AllowAddNew) ? 0 : 1);
	this.label2.Text = string.Format("{0} of {1}", e.RowIndex, count);

}


PD Prof DISSOU Jamâl-Dine May 20, 2005 06:47 AM

Hi Clay, Thanks a lot Jamâl-Dine DISSOU


PD Prof DISSOU Jamâl-Dine May 23, 2005 10:26 AM

Hi Clay, The CurrentRecordContextChange event it is not fired the first time the grid is load. Witch event do I use. Jamâl - Dine DISSOU


AD Administrator Syncfusion Team May 23, 2005 11:12 AM

By default there is no current element when you first display the GridGroupingControl. Try setting this in Form.Load to see if it will make things work for you.
If Me.gridGroupingControl1.Table.FilteredRecords.Count > 0 Then
   Me.gridGroupingControl1.Table.CurrentRecord = Me.gridGroupingControl1.Table.FilteredRecords(0)
End If

Loader.
Live Chat Icon For mobile
Up arrow icon