473,795 Members | 2,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# Deleting Row in DataView filtered with RowFilter

2 New Member
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.Ro wNumber I get a 1, because it is the second visible record.
But then, when I say: Dataview.Table. Rows.RemoveAt(m yposition), 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 10014
shachar8
6 New Member
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=YourDSour ce.getchanges() //get the deleted rows
now use foreach row in dtDel.
on each row you should write:
MyDataRow.rejec tchanges();
get the data from the record (etc - to delete it from the db..)
MyDataRow.delet e();
Oct 26 '06 #2
HansP
2 New Member
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
1137
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 against the original 50. If it filters against the 3 is there a method to tell the rowfilter function to use the original 50 or do i have to rebuild the dataview before refiltering? If it is supposed to filter against the original 50, then its not...
4
522
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 DataView_Filter = new DataView(); DataView_Filter.Table = DS_States.Tables; sFilter = "Emplcode = '123233'"; DataView_Filter.RowFilter = sFilter; MessageBox.Show (DataView_Filter.Count.ToString()); //it displays 6
1
2113
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 there any way to get the Dataview to keep track of the different RowFilter used?
3
11451
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 newly filtered data without having to create a new dataview each time. Is that possible? Also, do I need to attach the dataview to the combo box each time? if (AgencyCounties == null || sPropertyState.Text != prevPropertyState) {...
6
1638
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 dataset. I'm using vb. session(sessionName) = recordID 'from dataset or dataview Thanks, Enrique
3
3875
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 btnClientSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClientSearch.Click s_customerID = txtCustomerID.Text
4
16604
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 filtered? Right now in my rowfilter I have something like this:
1
2712
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 global dataview is created -The user enters new part information into a form. -A function is called to check to see if the part is a new part (so that two identical part numbers are not added to the database. -The check is done by setting the...
5
11843
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 global dataview is created -The user enters new part information into a form. -A function is called to check to see if the part is a new part (so that two identical part numbers are not added to the database. -The check is done by setting the...
0
10214
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9042
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.