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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Applying filter on GridDataBoundGrid

Thread ID:





33105 Aug 12,2005 02:41 PM UTC Aug 12,2005 05:08 PM UTC WinForms 2
Tags: GridControl
Keyur Patel
Asked On August 12, 2005 02:41 PM UTC

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.

Administrator [Syncfusion]
Replied On 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;

Keyur Patel
Replied On August 12, 2005 05:08 PM UTC

It worked. Thank you very much.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon