golocorbin

golocorbin

  • NA
  • 44
  • 101.3k

DataTable.DefaultView.RowFilter dynamicly

Apr 25 2010 12:46 PM

Example: DataGridView with two columns type DataGridViewComboBoxCell where first column wrap one datatable and detrmine second column (cell) with RowFilter. I try with CellBeginEdit event  and all other events and cells property but after first good RowFilter  I have '...value not valid' for the next row and another filter.
Problem is that , after first RowFilter I mast some say  DefaultView.RowFilter=""   to get full datatable to be ready for another filter in next row.So I must have for the evry row diferent  filter for the same cell which determine cell in first column
I have
....dataGridView1_CellBeginEdit....

datatable.DefaultView.RowFilter = "field name=" + dataGridView1.CurrentRow.Cells[n].Value.ToString();
dataGridView1_many Events ...cells property and so on..
DefaultView.RowFilter="";

I can't  find  the best way for that !
 what is the best startup place for RowFilter (CellBeginEdit ?)
what is the best place for DefaultView.RowFilter ="";
regard,          goran

 
 

Answers (1)