473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C# Deleting Row in DataView filtered with RowFilter

2
Hi,
I am really in a deadlock with this problem.

In my VS2005 C# handheld application, I have a grid with Workorders.

Another grid (child) are the ACTIONS, performed for each workorder.

Both grids have Dataviews as DataSource.

The child grid, filtered with RowFilter in the DataView works fine.

But when I try to delete a record in this child grid, I cannot figure out, how to get the absolut rownumber of the DataView.

EXAMPLE:

I try to delete the second row in the grid.
When I say Grid.DataSource.CurrentCell.RowNumber I get a 1, because it is the second visible record.
But then, when I say: Dataview.Table.Rows.RemoveAt(myposition), it deletes the ABSOLUT ROW 1 in the dataview and this could be from a complete different workorder (ParentView).

When I see the filtered records in the child view, how can I RECEIVE the ABSOLUT ROWNUMBER in the dataview and NOT the VISIBLE ROW from the grid.

Again, this is a C#, mobile application, so I might not have all functions available.

I am very greatful for every input to solve this problem. Thanks.

Hans Pietschnig
pietschnig@usa.com
Oct 25 '06 #1
2 9987
if the grid is bounded to a dataview you can delete the datagridview row,
this will change the coresponding record in the dataviw, and will change it's state to deleted.
then you can get a datatable containing all the deleted records:
datatable dtDel=YourDSource.getchanges() //get the deleted rows
now use foreach row in dtDel.
on each row you should write:
MyDataRow.rejectchanges();
get the data from the record (etc - to delete it from the db..)
MyDataRow.delete();
Oct 26 '06 #2
HansP
2
Thank you so much for your input.

But as much as I could see, does the compact .NET framework not offer the DataGridView.

Thank you again

HansP
Oct 26 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: G Hustis | last post by:
If I build a DataView of 50 rows & use the rowfilter function to to return 3 rows does the next rowfilter function filter against the original 50 or the returned set of 3? I thought it filtered...
4
by: Jim Heimer | last post by:
When I use the dataview.rowfilter and I try to display the field value of the first row, the code doesn't seem to show the first row AFTER the rowfilter. This is my code: DataView...
1
by: Webgour | last post by:
I'm tring to filter a dataview with multiple rowfilters. The problem is that each time I use RowFilter on the DataView i'm quering the full dataview as it was loaded, not the filtered version. Is...
3
by: Vern | last post by:
The following code retrieves data into a dataset, and then creates a dataview with a filter. This dataview is then attached to a combobox. When the effective date changes, I would like to see the...
6
by: enrique | last post by:
Hello, I simpy want to place a record ID into a session variable. I know how to create session variables, I'm just can't figure out the syntax for the record item when I'm working with a...
3
by: John Wildes | last post by:
Hello all I am trying to pass a variable to a DataView so that I can filter the rows displayed in my datagrid. Here's the code I am trying to get to work Private Sub...
4
by: Tmuld | last post by:
Hello, I have a complete table within a dataset. I want a dataview to show particular filtered data - works great with the dv.rowfilter. But can I display only certain columns that are...
1
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
5
by: AlexW | last post by:
Hi I am in the process of developing an inventory application in visual basic. I keep coming up against a problem with using the dataview.rowfilter property. Basically what happens is this: -a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.