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.

Navigate with Cursor

Thread ID:

Created:

Updated:

Platform:

Replies:

46676 Jul 18,2006 09:58 AM Jul 24,2006 05:05 AM Windows Forms 4
loading
Tags: Grouping
Helmut Basler
Asked On July 18, 2006 09:58 AM

Hello, I''m using your example EmployeeView. While Pressing Cursor left from FirstName I expect to get the fields Adress, next Region, next Title. But I got the order FirstName, LastName, Adress, City, PostalCode, Region and so on. How to get the expected order? Regards Helmut

Administrator [Syncfusion]
Replied On July 21, 2006 03:23 AM

Hi Helmut,

The simplest way to handle this is to subscribe to the TableControlCurrentCellKeyDown event and set the currentcell using the Record.SetCurrent method. Please refer the sample for more details.

private Hashtable traverseOrder = new Hashtable();

//form load.
traverseOrder.Add( "EmployeeID","Photo");
traverseOrder.Add( "Photo", "FirstName" );

private void gridGroupingControl1_TableControlCurrentCellKeyDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlKeyEventArgs e)
{
if(e.Inner.KeyCode == Keys.Right)
{
GridTableCellStyleInfo info = e.TableControl.CurrentCell.Renderer.CurrentStyle as GridTableCellStyleInfo;
if( info.TableCellIdentity.Column != null )
{
// traverseOrder having the column name and next column traverse name.
object column = traverseOrder[info.TableCellIdentity.Column.MappingName ] ;
if( column != null)
{
e.TableControl.Table.CurrentRecord.SetCurrent(column.ToString() );
}
}
e.Inner.Handled = true;
}
}
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/EmployeeView_bad96d7b.zip

Let me know if this helps.
Best Regards,
Haneef

Note : You need to change the connection string before run the sample.

Helmut Basler
Replied On July 21, 2006 04:28 AM

Hi Haneef,

this help .

Thanks
Helmut

Helmut Basler
Replied On July 24, 2006 02:15 AM

Hallo Haneef,

an additional Question for Cursor Up/down. To Process cursor up or down i''m searching for functions like "e.TableControl.Table.PreviewRecord.SetCurrent(column.ToString() );" and "e.TableControl.Table.NextRecord.SetCurrent(column.ToString() );" but i''m not able to find something.

Thanks again
Helmut



Administrator [Syncfusion]
Replied On July 24, 2006 05:05 AM

Hi Helmut,

Could you try this code snippet to navigate the current record in a grid. Please find the code snippet below.

//for previous records.
int previndex = this.gridGroupingControl1.TableControl.CurrentCell.RowIndex - 1;
this.gridGroupingControl1.Table.DisplayElements[previndex].ParentRecord.SetCurrent();

//For next record.
int nextindex = this.gridGroupingControl1.TableControl.CurrentCell.RowIndex + 1;
this.gridGroupingControl1.Table.DisplayElements[nextindex].ParentRecord.SetCurrent();

Let me know if this helps.
Regards,
Haneef

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.

;