This is a migrated thread and some comments may be shown as answers.

Datagrid filter bindingsource

2 Answers 84 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rodolpho
Top achievements
Rank 1
Rodolpho asked on 17 May 2014, 10:11 AM
Hi. Sorry my english!!!

I use a report system that uses a BindingSource as source of the repot.

How to filter the bindingsource with the same filtered data in datagrid???

I used the ComponentOne C1TrueDBgrid that does it automatically.

When I filter datagrid (C1) data with the filterbar, the filtered rows show in datagrid are same bindingsource. Understand??? kkk (My english is terrible)

How to do this with Telerik datagrid?

Winform.

2 Answers, 1 is accepted

Sort by
0
Rodolpho
Top achievements
Rank 1
answered on 20 May 2014, 10:47 PM
?????
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 May 2014, 10:49 AM
Hello Rodolpho,

Thank you for writing.

RadGridView filters only the displayed data in the collection view. The actual data source remains unchanged. That is why when you filter the RadGridView, the grid data is displayed filtered, but its data source, which is a BindingSource is not filtered. However, you can synchronize the data, filtering the BindingSource via its Filter property as follows:
private void Form1_Load(object sender, EventArgs e)
{
    this.customersTableAdapter.Fill(this.northwindDataSet.Customers);
    this.radGridView1.DataSource = this.customersBindingSource;
    this.radGridView1.FilterExpressionChanged+=radGridView1_FilterExpressionChanged;
}
 
private void radGridView1_FilterExpressionChanged(object sender, FilterExpressionChangedEventArgs e)
{
    this.customersBindingSource.Filter = e.FilterExpression;
}

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Rodolpho
Top achievements
Rank 1
Answers by
Rodolpho
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or