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.

Navigation Control

Thread ID:

Created:

Updated:

Platform:

Replies:

22686 Dec 20,2004 12:03 AM Dec 20,2004 06:43 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 20, 2004 12:03 AM

Hi, I need to put up a navigation control for the gridcontrol i am using. I want to know which of the two navigation control would be better: 1) GridRecordNavigationControl 2) RecordNavigationControl. In my gridcontrol i am displaying the ro w numbers in reverse order. i.e. Row zero is at the bottom and row 1 at top of row zero. So i need to navigate the records in same order. Can you help?

Administrator [Syncfusion]
Replied On December 20, 2004 02:55 AM

One way you can do this is to use the GridDataBoundGrid in virtual mode, swapping the row indexes in QueryCellInfo to reverse the order. One thing that complicates this (probably triples the code) is if you want to support the dynamic splitting. This mens you have to subscribe and unsubscribe to the events, and do some object management that would not be required if you did not do dynamic splitting. Here is a rough sample showing how you might do this. http://64.78.18.34/Support/Forums/Uploads/GRecNav.zip

Administrator [Syncfusion]
Replied On December 20, 2004 03:44 AM

Hi, My requirement is different from this application. For my application Row zero is at the bottom and row 10 is at the top. So when i am at the bottommost row and i click of next arrow then i should move up one row i.e. to row zero. Moreover my gridcontrol is not databound. I can add or delete rows at run time, So i need to take that into account.

Administrator [Syncfusion]
Replied On December 20, 2004 06:43 AM

You can probably come close to what you need by handling an event on the embedded navbar.
	private void Form1_Load(object sender, System.EventArgs e)
	{
		this.gridRecordNavigationControl1.NavigationBar.ArrowButtonClicked += new Syncfusion.Windows.Forms.ArrowButtonEventHandler(NavigationBar_ArrowButtonClicked);
	}
	private void NavigationBar_ArrowButtonClicked(object sender, Syncfusion.Windows.Forms.ArrowButtonEventArgs e)
	{
		switch(e.Arrow)
		{
			case Syncfusion.Windows.Forms.ArrowType.Next:
				e.Cancel = true;
				this.gridControl1.CurrentCell.MoveUp();
			break;
			case Syncfusion.Windows.Forms.ArrowType.Previous:
				e.Cancel = true;
				this.gridControl1.CurrentCell.MoveDown();
				break;
			case Syncfusion.Windows.Forms.ArrowType.Last:
				e.Cancel = true;
				this.gridControl1.CurrentCell.MoveTo(1, this.gridControl1.CurrentCell.ColIndex);
				break;
			case Syncfusion.Windows.Forms.ArrowType.First:
				e.Cancel = true;
				this.gridControl1.CurrentCell.MoveTo(this.gridControl1.RowCount, this.gridControl1.CurrentCell.ColIndex);
				break;
		}
		foreach(Syncfusion.Windows.Forms.InternalButton but in this.gridRecordNavigationControl1.NavigationBar.ButtonBarChild.Buttons)
		{
			if(but != null && but.ToString() != "AddNew")
			{
				but.Enabled = true;
			}
		}
		this.gridRecordNavigationControl1.NavigationBar.Invalidate();
	}
}

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.

;