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.

GridGrouping + GridDataBoundGrid events

Thread ID:

Created:

Updated:

Platform:

Replies:

29228 May 19,2005 11:47 AM May 23,2005 12:12 PM Windows Forms 4
loading
Tags: GridControl
Prof DISSOU Jamâl-Dine
Asked On May 19, 2005 11:47 AM

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

Administrator [Syncfusion]
Replied On May 19, 2005 08: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);

}

Prof DISSOU Jamâl-Dine
Replied On May 20, 2005 07:47 AM

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

Prof DISSOU Jamâl-Dine
Replied On May 23, 2005 11: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

Administrator [Syncfusion]
Replied On May 23, 2005 12:12 PM

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

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.

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.

;