Windows Develop Bookmark and Share   
 index > Windows Forms Designer > datagridview pause filter while editing
 

datagridview pause filter while editing

need to pause filtering the datagridview on editing. i have done filter datagridview using dataview. while onediting it removes from row from list . i need to pause it until the row validating event

Binil MB  Monday, May 18, 2009 5:03 AM

Hi Binil MB,

In order to understanding your question clearly, here is the sample I have made.
DataTable dt = new DataTable();
dt.Columns.Add("Column1", typeof(int));
dt.Columns.Add("Column2", typeof(string));
dt.Rows.Add(1, "Item1");
dt.Rows.Add(1, "Item2");
dt.Rows.Add(2, "Item3");
dt.Rows.Add(3, "Item4");
dt.DefaultView.RowFilter = "Column1=1";
dataGridView1.DataSource = dt.DefaultView;

In this example, the filter expression is Column1=1, so the dataGridView1 will show only two rows. If I change one of the row's Column1 value from 1 to other number, That row will disappear from DataGridView since that row no longer meet the filter condition. Am I right?

I don't see the row disappear immediately after I change column1's value. Instead, it disappear end edit. So what's the problem with you?

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Wednesday, May 20, 2009 2:56 AM

Hi Binil MB,

In order to understanding your question clearly, here is the sample I have made.
DataTable dt = new DataTable();
dt.Columns.Add("Column1", typeof(int));
dt.Columns.Add("Column2", typeof(string));
dt.Rows.Add(1, "Item1");
dt.Rows.Add(1, "Item2");
dt.Rows.Add(2, "Item3");
dt.Rows.Add(3, "Item4");
dt.DefaultView.RowFilter = "Column1=1";
dataGridView1.DataSource = dt.DefaultView;

In this example, the filter expression is Column1=1, so the dataGridView1 will show only two rows. If I change one of the row's Column1 value from 1 to other number, That row will disappear from DataGridView since that row no longer meet the filter condition. Am I right?

I don't see the row disappear immediately after I change column1's value. Instead, it disappear end edit. So what's the problem with you?

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Wednesday, May 20, 2009 2:56 AM

You can use google to search for other answers

Custom Search

More Threads

• EventsTab and PropertyGrid
• Imports Data from XLS file to DataGridView VB 2005
• Conditionally adding a button to a form
• "Could not load type from assembly" error
• How to open a website from windows application in VB.Net 2005?
• Sharing Components among Forms in DesignTime mode
• how to set the custom scrollbars appearance like Autosroll .
• How to detect which Row/cell in TableLayoutPanel is clicked/selected
• New Button Design VB Express
• Datagrid and Arrow keys, how to make the arrow move around?