The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I am running the following code to apply a filter to a GDBG grid, but the grid does not update to show the filtered rows. The filter is not applied. Can you tell me what else I have to do?
this.grid.BeginUpdate();
DataView dv = ((DataSet)grid.DataSource).Tables[grid.DataMember].DefaultView;
dv.RowFilter = "[col1] = 20.000";
this.grid.EndUpdate(true);
Also, if a user only highlights a portion of the text in the cell, how do I access the highlighted portion?
Thanks.
ADAdministrator Syncfusion Team August 12, 2005 04:20 PM UTC
You just cannot filter any DataView, you must filter the one being used by the CurrencyManager associated with the grid and the datasource. Additionally, after the grid.EndUpdate call, you may need a grid.refresh call.
To get the dataview, try this code:
CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager;
DataView dv = cm.List as DataView;
To get the selected text in an actively editing textbox cell, you can use code like:
GridTextBoxCellRenderer cr = grid.CurrentCell.Renderer as GridTextBoxCellRenderer;
string s = cr.TextBox.SelectedText;