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.

Locate a row

Thread ID:

Created:

Updated:

Platform:

Replies:

29561 May 27,2005 01:29 PM May 30,2005 02:25 PM Windows Forms 6
loading
Tags: GridControl
Lan Mo
Asked On May 27, 2005 01:29 PM

I have GridGroupingcontrol form. I want to set cursor to a specific row. I used following code, it works, but very slow. Any idea or sample? regards, lan //locate the line by sect_no try { //mFormParam.RowLocate="sect_no LIKE ''100001''" gdBase.TableDescriptor.RecordFilters.Add(mFormParam.RowLocate); GridRecord rec = gdBase.Table.FilteredRecords[0] as GridRecord; gdBase.TableDescriptor.RecordFilters.Clear(); int row = gdBase.Table.DisplayElements.IndexOf(rec); int col = gdBase.TableDescriptor.VisibleColumns.IndexOf(mFormParam.ColName)+1+mFormParam.ColOffset; gdBase.TableControl.CurrentCell.MoveTo(row, col); gdBase.TableControl.SetTopRow(row); // highlighte the row gdBase.Table.CurrentRecord = rec; } catch { gdBase.TableDescriptor.RecordFilters.Clear(); gdBase.TableControl.CurrentCell.MoveTo(1, 1); }

Administrator [Syncfusion]
Replied On May 27, 2005 01:55 PM

Just setting: this.gridGroupingControl1.Table.CurrentRecord = rec; should scroll it into view without doing anything else.

Lan Mo
Replied On May 30, 2005 09:11 AM

I tried this code: //mFormParam.RowLocate="[field_name]LIKE ''sect_no''" gdBase.TableDescriptor.RecordFilters.Add(mFormParam.RowLocate); GridRecord rec = gdBase.Table.reFilteredRecords[0] as GridRecord; // highlighte the row gdBase.Table.CurrentRecord = rec; Could you give me a sample? Thanks, Lan >Just setting: > >this.gridGroupingControl1.Table.CurrentRecord = rec; > >should scroll it into view without doing anything else.

Administrator [Syncfusion]
Replied On May 30, 2005 10:39 AM

http://www.syncfusion.com/Support/user/uploads/GGC_SelectARecord_f51387ea.zip

Lan Mo
Replied On May 30, 2005 11:47 AM

I tried your sample. It is different from what I want to do. I want find a row by primary key''s id, such as "col1=2014", not by record sequence number. Thanks, >I tried this code: >//mFormParam.RowLocate="[field_name]LIKE ''sect_no''" >gdBase.TableDescriptor.RecordFilters.Add(mFormParam.RowLocate); >GridRecord rec = gdBase.Table.reFilteredRecords[0] as GridRecord; >// highlighte the row >gdBase.Table.CurrentRecord = rec; > >Could you give me a sample? > >Thanks, > >Lan > > >>Just setting: >> >>this.gridGroupingControl1.Table.CurrentRecord = rec; >> >>should scroll it into view without doing anything else.

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

You can use the this.gridGroupingControl1.Table.PrimaryKeySortedRecords.FindRecord method to find a record index using a primary key value. http://www.syncfusion.com/Support/user/uploads/GGC_SelectARecord_8399d16a.zip

Lan Mo
Replied On May 30, 2005 02:25 PM

Clay, Thanks for you sample. Now my code works Lan >You can use the this.gridGroupingControl1.Table.PrimaryKeySortedRecords.FindRecord method to find a record index using a primary key value. > >http://www.syncfusion.com/Support/user/uploads/GGC_SelectARecord_8399d16a.zip >

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.

;