Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering DataGridViewRows with unknown columns
Message
De
24/12/2007 05:02:26
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Filtering DataGridViewRows with unknown columns
Versions des environnements
Environment:
C# 2.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01277291
Message ID:
01277291
Vues:
53
Hello all,

I need to filter a DataGridView based on unknown conditions at design time.
The dataGridView has 6 columns and the user could select one or more columns and one or more rows.
Then i need to get the data of that rows and columns and filter the datagrid based on this values.

In VFP i would do something like:

create a string like: FilterString = "set filter to "
loop through the table
at every selected row i would fill the string like this: FilterString = FilterString + "ColumnName = '" + ColumnValue + "' and "
At the end i would have a string like: "set filter to ColumnName = 'value1' and ColumnName2 = 'value2' and ColumnName3 = 'value3'"
then i would execute the inner string command with: &FilterString or (FilterString)

Can i do something like that with C#?

Thank you,
Joaquim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform