Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locaing row in Virtual DataGridView
Message
De
24/03/2008 17:12:44
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Locaing row in Virtual DataGridView
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Divers
Thread ID:
01305129
Message ID:
01305129
Vues:
47
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
Répondre
Fil
Voir

Click here to load this message in the networking platform