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

Grid Navigation Control

Thread ID:





29879 Jun 6,2005 11:16 AM UTC Jun 6,2005 11:44 AM UTC WinForms 1
Tags: GridControl
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;
	//..... continue on with the existing code...

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));


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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