PC Review


Reply
Thread Tools Rate Thread

DataGrid not updating when removing Row with RowFilter

 
 
PeterB
Guest
Posts: n/a
 
      9th Sep 2004
Hello!

I have a DataGrid with a DataTable as DataSource. If I change the data of a
row in a datagrid so that this row is affected by a rowfilter (and thus
should be filtered away), the row isn't removed instantly. But if you change
cell the row is removed from the grid...

So...

I have a grid with several rows.
I apply a RowFilter. This removes some of the rows... ok so far.
I have a ContextMenu on the DataGrid with which I can change the value of a
cell (which the RowFilter triggers on) to make it disappear.
This means I click the row to be deleted, the ContextMeny pops up and I
select remove.
The value in the cell is changed but the Filtering is never fired.
If I move to another cell the row is finally removed from the grid.

1. Is this a known bug/feature?
2. Is there any way I can force the DataGrid to Update (without changing
cell)? None of Refresh(), Update(), Invalidate() works...

thanks,

Peter



 
Reply With Quote
 
 
 
 
PeterB
Guest
Posts: n/a
 
      9th Sep 2004
I found the solution myself by using DataTable.AcceptChanges right after I
change the value of the cell.



The DataView only shows a cache of the datatable, when changing a row in the
datagrid the changes isn't reflected on the actual table immediately (until
you move away from the current cell). Using DataTable.AcceptChanges() solves
this.



/ Peter





"PeterB" <(E-Mail Removed)> skrev i meddelandet
news:O9%(E-Mail Removed)...
> Hello!
>
> I have a DataGrid with a DataTable as DataSource. If I change the data of

a
> row in a datagrid so that this row is affected by a rowfilter (and thus
> should be filtered away), the row isn't removed instantly. But if you

change
> cell the row is removed from the grid...
>
> So...
>
> I have a grid with several rows.
> I apply a RowFilter. This removes some of the rows... ok so far.
> I have a ContextMenu on the DataGrid with which I can change the value of

a
> cell (which the RowFilter triggers on) to make it disappear.
> This means I click the row to be deleted, the ContextMeny pops up and I
> select remove.
> The value in the cell is changed but the Filtering is never fired.
> If I move to another cell the row is finally removed from the grid.
>
> 1. Is this a known bug/feature?
> 2. Is there any way I can force the DataGrid to Update (without changing
> cell)? None of Refresh(), Update(), Invalidate() works...
>
> thanks,
>
> Peter
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid, binding and rowfilter sawpit Microsoft C# .NET 0 28th Sep 2006 04:15 PM
Deleting rows in datagrid with rowfilter PeterB Microsoft Dot NET Compact Framework 2 10th Sep 2004 11:16 AM
DataGrid RowFilter Syntax Marty McFly Microsoft ADO .NET 2 21st Jun 2004 09:12 PM
DataGrid RowFilter Syntax Marty McFly Microsoft VB .NET 2 21st Jun 2004 09:12 PM
RowFilter datagrid =?Utf-8?B?S3VtYXI=?= Microsoft ASP .NET 0 20th Feb 2004 04:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:04 AM.