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

Grid Navigation Control

Thread ID:

Created:

Updated:

Platform:

Replies:

29879 Jun 6,2005 11:16 AM UTC Jun 6,2005 11:44 AM UTC Windows Forms 1
loading
Tags: GridControl
Vinay
Asked On June 6, 2005 11:16 AM UTC

Hi Clay, In the grid navigation control i would like to display Row 1 : 400. Currently there is a lot of space between the record number and the total number of rows. Is there any way this space can be implemented. Thanks & Regards Vinay

Administrator [Syncfusion]
Replied On June 6, 2005 11:44 AM UTC

There is no simple event that allows you to control this text. It is being drawn in the GridRecordNavigationControl.NavigationBar.OnPaint method, so it is buried pretty deep to get at through virtual overrides. Probably the simplest way to handle this is to put your own lablel over the display area and just format set it to be what you want. You can keep it is sync using grid.RowEnter.

//set up the label
private Label myLabel;
private void Form1_Load(object sender, System.EventArgs e)
{
	myLabel = new Label();
	Rectangle rect = this.gridRecordNavigationControl1.NavigationBar.ClientRectangle;
	int width = this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Bounds.Width;
	myLabel.Bounds = new Rectangle(rect.Left, rect.Top, width, rect.Height);
	myLabel.TextAlign = ContentAlignment.MiddleCenter;
	this.gridRecordNavigationControl1.NavigationBar.Controls.Add(myLabel);
	//..... continue on with the existing code...
}

//handler
private void gridDataBoundGrid1_RowEnter(object sender, GridRowEventArgs e)
{
	GridDataBoundGrid grid = sender as GridDataBoundGrid;
	if(this.myLabel != null && grid != null)
	{
		this.myLabel.Text = string.Format("{0} of {1}", grid.Binder.RowIndexToPosition(e.RowIndex), 		grid.Binder.RowIndexToPosition(grid.Model.RowCount));
	}
}

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

;