Click here to Skip to main content
14,549,600 members
   

C#

 
AnswerRe: Is it possible to apply a custom filter (i.e. my own delegate) to a DataTable? Pin
Richard MacCutchan22-May-20 5:32
mveRichard MacCutchan22-May-20 5:32 
GeneralRe: Is it possible to apply a custom filter (i.e. my own delegate) to a DataTable? Pin
arnold_w22-May-20 9:43
Memberarnold_w22-May-20 9:43 
GeneralRe: Is it possible to apply a custom filter (i.e. my own delegate) to a DataTable? Pin
arnold_w24-May-20 21:02
Memberarnold_w24-May-20 21:02 
GeneralRe: Is it possible to apply a custom filter (i.e. my own delegate) to a DataTable? Pin
Richard Deeming27-May-20 0:27
mveRichard Deeming27-May-20 0:27 
GeneralRe: Is it possible to apply a custom filter (i.e. my own delegate) to a DataTable? Pin
arnold_w27-May-20 2:44
Memberarnold_w27-May-20 2:44 
GeneralRe: Is it possible to apply a custom filter (i.e. my own delegate) to a DataTable? Pin
Richard Deeming27-May-20 2:55
mveRichard Deeming27-May-20 2:55 
GeneralRe: Is it possible to apply a custom filter (i.e. my own delegate) to a DataTable? Pin
arnold_w27-May-20 4:05
Memberarnold_w27-May-20 4:05 
AnswerRe: Is it possible to apply a custom filter (i.e. my own delegate) to a DataTable? Pin
Richard Deeming22-May-20 6:09
mveRichard Deeming22-May-20 6:09 
You can pass in a row filter to the DataView constructor, but it has to be a string using the Expression Syntax[^]; you can't pass in a custom delegate.

The BindingSource has a Filter property[^], but again it's a string using the same syntax.

In WPF, you can supply a filter delegate to the ICollectionView. But that's not much help if you're using Windows Forms. Smile | :)

You could obviously select the filtered rows using LINQ, and even use the CopyToDataTable extension method to create a new DataTable from the filtered rows. But then you'd have to change the data source every time the filter changed, and you'd lose the connection to the original rows.

I don't think there's a good answer for this.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

QuestionCan I show my data in a C# table, even though all the data is not in a single List/array? Pin
arnold_w21-May-20 20:06
Memberarnold_w21-May-20 20:06 
AnswerRe: Can I show my data in a C# table, even though all the data is not in a single List/array? Pin
OriginalGriff21-May-20 20:29
mveOriginalGriff21-May-20 20:29 
GeneralRe: Can I show my data in a C# table, even though all the data is not in a single List/array? Pin
arnold_w21-May-20 20:45
Memberarnold_w21-May-20 20:45 
AnswerRe: Can I show my data in a C# table, even though all the data is not in a single List/array? Pin
arnold_w22-May-20 0:17
Memberarnold_w22-May-20 0:17 
GeneralRe: Can I show my data in a C# table, even though all the data is not in a single List/array? Pin
Richard MacCutchan22-May-20 0:40
mveRichard MacCutchan22-May-20 0:40 
GeneralRe: Can I show my data in a C# table, even though all the data is not in a single List/array? Pin
arnold_w22-May-20 1:08
Memberarnold_w22-May-20 1:08 
GeneralRe: Can I show my data in a C# table, even though all the data is not in a single List/array? Pin
Richard Deeming22-May-20 1:12
mveRichard Deeming22-May-20 1:12 
GeneralRe: Can I show my data in a C# table, even though all the data is not in a single List/array? Pin
arnold_w22-May-20 1:16
Memberarnold_w22-May-20 1:16 
GeneralRe: Can I show my data in a C# table, even though all the data is not in a single List/array? Pin
Richard Deeming22-May-20 1:17
mveRichard Deeming22-May-20 1:17 
QuestionHow can I filter what's shown in a DataGridView, without modifying the List that holds the data itself? Pin
arnold_w21-May-20 3:20
Memberarnold_w21-May-20 3:20 
AnswerRe: How can I filter what's shown in a DataGridView, without modifying the List that holds the data itself? Pin
Richard Deeming21-May-20 4:24
mveRichard Deeming21-May-20 4:24 
QuestionAuto reply when we sent request to server Pin
Member 1025852520-May-20 17:43
MemberMember 1025852520-May-20 17:43 
AnswerRe: Auto reply when we sent request to server Pin
Dave Kreskowiak20-May-20 18:19
mveDave Kreskowiak20-May-20 18:19 
Questioncan any one help me with this WS? Pin
Member 1337716619-May-20 19:19
MemberMember 1337716619-May-20 19:19 
AnswerRe: can any one help me with this WS? Pin
Dave Kreskowiak20-May-20 3:28
mveDave Kreskowiak20-May-20 3:28 
AnswerRe: can any one help me with this WS? Pin
DerekT-P24-May-20 3:55
professionalDerekT-P24-May-20 3:55 
GeneralRe: can any one help me with this WS? Pin
Member 1337716626-May-20 19:22
MemberMember 1337716626-May-20 19:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.