Using DataView with a datagrid

H

Hananiel

Using Dataview as a datasource for datagrid works fine while viewing.
When I make a new row, by calling dataview.AddNew(),
it removes all the rows in the grid. Anyone know whats going on?

In any case how would you bind two different grids to the same table, can we
filter the rows in the grid?
Thanks,
Hananiel
 
N

Nick Harris

Once you call add new rows to the dataview and call addNew you must call
EndEdit after you assign all your values. If you want to assign the same
table to 2 different control, create 2 data views. Assign each control it's
own dataview and make any underlying changes to the table.

Hope this helps,

Nick Harris, MCSD
http://www.VizSoft.net
 
H

Hananiel

I tried assigning values both with and without [BeginEdit / EndEdit] . But
it didnt change behavior.
But I think the problem is that I have two dataviews with Rowfilter property
set to a certain value.
And as soon as it executes, AddNew() it adds it to the dataview whose filter
property satisfies this. (for ex. RowFilter = "NOT (ColumnValue =
'CertainValue')" . And when i change the value, it doesnt update.

What do you mean make underlying changes to the table?
Do you want me to make changes to the dataTable Rows instead of dataview
Rows?

I solved the problem by making copies of the table and later merging the
changes.

-Hananiel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top