We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Load data on demand by textbox filter

Hello,

I describe a scenary. I need help about this:

So

We have on database more than 80k rows. We want load only the last 5k at the first time. Now at right moment its OK.

The problem it is:

If we want filter on database using the header filters we can´t because the filters only seach on datasource of gridgroupingcontrol.

Exist any event or something that when we type caracteres on textbox-filter can get the text-box filter content and use it to send a query to database and change the datasource of the control???

Thanks

1 Reply

AR Arulpriya Ramalingam Syncfusion Team February 7, 2020 09:31 AM UTC

Hi Mel, 
 
Thank you for your interest in Syncfusion products. 
 
We suspect that you have applied a RowFilter for DataTable of your datasource and bind the resulted table into GridGroupingControl and to filter the records dynamically at run time you have wired the GridDynamicFilter for the grid. If yes, the RecordFilters.Changed event will be invoked when the records are filtered from the grid and the compare value can be retrieved from the FilterConditions collection. Please refer to the below code and sample. 
 
Example code 
 
//Event subscription 
this.gridGroupingControl1.TableDescriptor.RecordFilters.Changed += RecordFilters_Changed; 
 
//Event customization 
private void RecordFilters_Changed(object sender, Syncfusion.Collections.ListPropertyChangedEventArgs e) 
{ 
    RecordFilterDescriptorCollection recordFilters = this.gridGroupingControl1.TableDescriptor.RecordFilters; 
    string compareText = recordFilters[recordFilters.Count - 1].Conditions[0].CompareText; 
} 
 
 
 
Please get back to us, if we misunderstood your scenario. 
 
Regards, 
Arulpriya 


Loader.
Up arrow icon