Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filtering DataGridViewRows with unknown columns
Message
From
24/12/2007 05:02:26
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Filtering DataGridViewRows with unknown columns
Environment versions
Environment:
C# 2.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01277291
Message ID:
01277291
Views:
61
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
Next
Reply
Map
View

Click here to load this message in the networking platform