Chris Redsky

Chris Redsky

  • NA
  • 1
  • 3.5k

tabcontrol - problem:refreshing tabpages controls

Sep 12 2010 8:34 AM
Hi
im using tab control do show two datagridviews, so i have two tabPages , one dgv in each
what im trying to do is filter data.
dgvs are populated by List<Data>
where Data have Label and Description
so in dgv I have two colums Label and Description
my filters work by checking
if list[i].Label == (string)filtertext
filter works on both dgvs because the labels are always the same only description is diffrent.
filter works fine  it highlights proper row
the thing is that tabpages arent refreshing..i think thats the problem
I will describe step by step what I do.
1. form loads - tabpage 1 is active, dgvs are populated by data.
2. I use filter - tabpage 1 is still visibile and I get right response,on dgv 1 propers rows are highlighted.
3. I switch on tabPage 2 and here rows are not highlighted , like nothing happened.
4. I switch back on tabPage1 and change text in filter
5. Again i got proper highlight on tabPage 1
6. I go to tabPage 2 and NOW rows in dgv have proper highlight.

Its wierd, looks like when i visited tabpage2 dgv on that page got some "focus or something" which casued it to work properly and I dont know why.
Maybe someone meet this wierd phenomen before and know the cause.