Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locaing row in Virtual DataGridView
Message
From
24/03/2008 17:12:44
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Locaing row in Virtual DataGridView
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01305129
Message ID:
01305129
Views:
48
I use WinForms DataGridView in Virtual mode based on MSDN samples.
Grid data is cached in paged List
Data is retrieved in OnCellValueNeeded() event
using DLinq Skip()/Take() methods from server database.

I have implemented column search feature which allows to locate row whose
column contain sertain value.

I use DataGridView method for it:
void LocateInColumn() {

SearchFor = Microsoft.VisualBasic.Interaction.InputBox(
          Columns[CurrentCell.ColumnIndex].HeaderText,
          "Locate value",
              "", -1, -1);

int col = CurrentCell.ColumnIndex;
for (int i = CurrentRow.Index + 1; i < RowCount - 1; i++) {
   object val = this[col, i].Value;
   if (val == null) continue;
   if (val.ToString().ToUpper().
                        Contains(SearchFor.ToUpper())) {
      CurrentCell = this[col, i];
      return;
   }
 }
MessageBox.Show("Not found");
}
This code causes all data to be readed over internet connection and is very slow.
I cannot use Where clause directly since I need to show also rows before and next located row.
How to locate row without reading whole database ?
I can use where clause to find row id. However I have no idea how to position virutal grid to this row
so that rows before and after are also visible.

Is it possible to implement in easily in some other GUI: GTK#, Silverlight, WPF ?
Are there any grid control available which implements this ?
Andrus
Reply
Map
View

Click here to load this message in the networking platform