473,545 Members | 2,688 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filtering problem.... urgent please help

Ubi
hi
i have a problem with System.Data.Dat aViewRowState.

i have a ReadOnly datagrid,
a dataView and a dataTable.

i'm using the dataView's filter property to filter the data (firstName =
'Dani').
the problem is that i don't understanh how the ViewRowState works:
i have an external form that changes the value of the dataTable.
when it changes a row (even when the firstName col is not changed). the row
disappears; when a row that wasn't in the view before (because it's name want
Danni) changes to firstName->Danni, it doesn't appear in the view although it
should be...

please please help!

Nov 16 '05 #1
6 1420
Each DataRow has the readonly property RowState.
When you change a value in a row, also the RowState is changed to "Modified"
If you add a row, this row will have a RowState="Added "
If you delete a row, this row will be marked as "Deleted"

If you call the AcceptChages() method of the DataRow/DataTable, all the
chages made to the rows will take place and all the state of the rows are
set to "Unchanged"
If you call the RejectChages() method of the DataRow/DataTable, all the
chages made to the rows will be discarded and all the state of the rows are
set to "Unchanged"

DataView is able to filter also the RowState, if you are not intrested to
filter the rowstate set the
DataView.RowSta teFilter=DataVi ewRowState.Curr entRows

"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:EB******** *************** ***********@mic rosoft.com...
hi
i have a problem with System.Data.Dat aViewRowState.

i have a ReadOnly datagrid,
a dataView and a dataTable.

i'm using the dataView's filter property to filter the data (firstName =
'Dani').
the problem is that i don't understanh how the ViewRowState works:
i have an external form that changes the value of the dataTable.
when it changes a row (even when the firstName col is not changed). the row disappears; when a row that wasn't in the view before (because it's name want Danni) changes to firstName->Danni, it doesn't appear in the view although it should be...

please please help!

Nov 16 '05 #2
Ubi
this is now working...

my code is something like
dataTable dt = new DataTable("tbl" );
dataView dv = new DataView();
dv.Table = dt;

dt.Colums.Add(" firstName");
dt.Colums.Add(" lastName");

dataRow dr = dt.NewRow();

dv.Filter = "firstName = 'A'";

dr["firstName"]="A";
dr["lastName'']="bla bla";
dt.Rows.Add(dr) ;

dataGrid1.dataS ource = dv;

NOW, THIS ROW WILL BE SHOWN, BUT IF I SO SOMETHING LIKE:
dr = dt.Rows[0];
dr["lastName"] = "bla bla bla bla";
dt.AcceptChange s();

THE ROW WILL DISAPPEAR (even thought i didn't change the first name at all).
I've tried using : dv.RowStateView = Current but it didn't work...

please help
"Zürcher See" wrote:
Each DataRow has the readonly property RowState.
When you change a value in a row, also the RowState is changed to "Modified"
If you add a row, this row will have a RowState="Added "
If you delete a row, this row will be marked as "Deleted"

If you call the AcceptChages() method of the DataRow/DataTable, all the
chages made to the rows will take place and all the state of the rows are
set to "Unchanged"
If you call the RejectChages() method of the DataRow/DataTable, all the
chages made to the rows will be discarded and all the state of the rows are
set to "Unchanged"

DataView is able to filter also the RowState, if you are not intrested to
filter the rowstate set the
DataView.RowSta teFilter=DataVi ewRowState.Curr entRows

"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:EB******** *************** ***********@mic rosoft.com...
hi
i have a problem with System.Data.Dat aViewRowState.

i have a ReadOnly datagrid,
a dataView and a dataTable.

i'm using the dataView's filter property to filter the data (firstName =
'Dani').
the problem is that i don't understanh how the ViewRowState works:
i have an external form that changes the value of the dataTable.
when it changes a row (even when the firstName col is not changed). the

row
disappears; when a row that wasn't in the view before (because it's name

want
Danni) changes to firstName->Danni, it doesn't appear in the view although

it
should be...

please please help!


Nov 16 '05 #3
Ubi
this is now working...

my code is something like
dataTable dt = new DataTable("tbl" );
dataView dv = new DataView();
dv.Table = dt;

dt.Colums.Add(" firstName");
dt.Colums.Add(" lastName");

dataRow dr = dt.NewRow();

dv.Filter = "firstName = 'A'";

dr["firstName"]="A";
dr["lastName'']="bla bla";
dt.Rows.Add(dr) ;

dataGrid1.dataS ource = dv;

NOW, THIS ROW WILL BE SHOWN, BUT IF I SO SOMETHING LIKE:
dr = dt.Rows[0];
dr["lastName"] = "bla bla bla bla";
dt.AcceptChange s();

THE ROW WILL DISAPPEAR (even thought i didn't change the first name at all).
I've tried using : dv.RowStateView = Current but it didn't work...

please help
"Zürcher See" wrote:
Each DataRow has the readonly property RowState.
When you change a value in a row, also the RowState is changed to "Modified"
If you add a row, this row will have a RowState="Added "
If you delete a row, this row will be marked as "Deleted"

If you call the AcceptChages() method of the DataRow/DataTable, all the
chages made to the rows will take place and all the state of the rows are
set to "Unchanged"
If you call the RejectChages() method of the DataRow/DataTable, all the
chages made to the rows will be discarded and all the state of the rows are
set to "Unchanged"

DataView is able to filter also the RowState, if you are not intrested to
filter the rowstate set the
DataView.RowSta teFilter=DataVi ewRowState.Curr entRows

"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:EB******** *************** ***********@mic rosoft.com...
hi
i have a problem with System.Data.Dat aViewRowState.

i have a ReadOnly datagrid,
a dataView and a dataTable.

i'm using the dataView's filter property to filter the data (firstName =
'Dani').
the problem is that i don't understanh how the ViewRowState works:
i have an external form that changes the value of the dataTable.
when it changes a row (even when the firstName col is not changed). the

row
disappears; when a row that wasn't in the view before (because it's name

want
Danni) changes to firstName->Danni, it doesn't appear in the view although

it
should be...

please please help!


Nov 16 '05 #4
Disappears only the changed row or all rows disappear?
"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:BA******** *************** ***********@mic rosoft.com...
this is now working...

my code is something like
dataTable dt = new DataTable("tbl" );
dataView dv = new DataView();
dv.Table = dt;

dt.Colums.Add(" firstName");
dt.Colums.Add(" lastName");

dataRow dr = dt.NewRow();

dv.Filter = "firstName = 'A'";

dr["firstName"]="A";
dr["lastName'']="bla bla";
dt.Rows.Add(dr) ;

dataGrid1.dataS ource = dv;

NOW, THIS ROW WILL BE SHOWN, BUT IF I SO SOMETHING LIKE:
dr = dt.Rows[0];
dr["lastName"] = "bla bla bla bla";
dt.AcceptChange s();

THE ROW WILL DISAPPEAR (even thought i didn't change the first name at all). I've tried using : dv.RowStateView = Current but it didn't work...

please help
"Zürcher See" wrote:
Each DataRow has the readonly property RowState.
When you change a value in a row, also the RowState is changed to "Modified" If you add a row, this row will have a RowState="Added "
If you delete a row, this row will be marked as "Deleted"

If you call the AcceptChages() method of the DataRow/DataTable, all the
chages made to the rows will take place and all the state of the rows are set to "Unchanged"
If you call the RejectChages() method of the DataRow/DataTable, all the
chages made to the rows will be discarded and all the state of the rows are set to "Unchanged"

DataView is able to filter also the RowState, if you are not intrested to filter the rowstate set the
DataView.RowSta teFilter=DataVi ewRowState.Curr entRows

"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:EB******** *************** ***********@mic rosoft.com...
hi
i have a problem with System.Data.Dat aViewRowState.

i have a ReadOnly datagrid,
a dataView and a dataTable.

i'm using the dataView's filter property to filter the data (firstName = 'Dani').
the problem is that i don't understanh how the ViewRowState works:
i have an external form that changes the value of the dataTable.
when it changes a row (even when the firstName col is not changed).
the row
disappears; when a row that wasn't in the view before (because it's
name want
Danni) changes to firstName->Danni, it doesn't appear in the view
although it
should be...

please please help!


Nov 16 '05 #5
No idea, after changing the lastname to 'bla bla bla' control if the the row
firstname is still 'A'

"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:C0******** *************** ***********@mic rosoft.com...
Only the changed row disappear...

"Zürcher See" wrote:
Disappears only the changed row or all rows disappear?
"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:BA******** *************** ***********@mic rosoft.com...
this is now working...

my code is something like
dataTable dt = new DataTable("tbl" );
dataView dv = new DataView();
dv.Table = dt;

dt.Colums.Add(" firstName");
dt.Colums.Add(" lastName");

dataRow dr = dt.NewRow();

dv.Filter = "firstName = 'A'";

dr["firstName"]="A";
dr["lastName'']="bla bla";
dt.Rows.Add(dr) ;

dataGrid1.dataS ource = dv;

NOW, THIS ROW WILL BE SHOWN, BUT IF I SO SOMETHING LIKE:
dr = dt.Rows[0];
dr["lastName"] = "bla bla bla bla";
dt.AcceptChange s();

THE ROW WILL DISAPPEAR (even thought i didn't change the first name at

all).
I've tried using : dv.RowStateView = Current but it didn't work...

please help
"Zürcher See" wrote:

> Each DataRow has the readonly property RowState.
> When you change a value in a row, also the RowState is changed to

"Modified"
> If you add a row, this row will have a RowState="Added "
> If you delete a row, this row will be marked as "Deleted"
>
> If you call the AcceptChages() method of the DataRow/DataTable, all the > chages made to the rows will take place and all the state of the rows
are
> set to "Unchanged"
> If you call the RejectChages() method of the DataRow/DataTable, all
the > chages made to the rows will be discarded and all the state of the

rows are
> set to "Unchanged"
>
> DataView is able to filter also the RowState, if you are not
intrested to
> filter the rowstate set the
> DataView.RowSta teFilter=DataVi ewRowState.Curr entRows
>
> "Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
> news:EB******** *************** ***********@mic rosoft.com...
> > hi
> > i have a problem with System.Data.Dat aViewRowState.
> >
> > i have a ReadOnly datagrid,
> > a dataView and a dataTable.
> >
> > i'm using the dataView's filter property to filter the data
(firstName =
> > 'Dani').
> > the problem is that i don't understanh how the ViewRowState works:
> > i have an external form that changes the value of the dataTable.
> > when it changes a row (even when the firstName col is not
changed). the
> row
> > disappears; when a row that wasn't in the view before (because
it's name
> want
> > Danni) changes to firstName->Danni, it doesn't appear in the view

although
> it
> > should be...
> >
> > please please help!
> >
>
>
>


Nov 16 '05 #6
Ubi
OK, thanks anyway

"Zürcher See" wrote:
No idea, after changing the lastname to 'bla bla bla' control if the the row
firstname is still 'A'

"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:C0******** *************** ***********@mic rosoft.com...
Only the changed row disappear...

"Zürcher See" wrote:
Disappears only the changed row or all rows disappear?
"Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
news:BA******** *************** ***********@mic rosoft.com...
> this is now working...
>
> my code is something like
> dataTable dt = new DataTable("tbl" );
> dataView dv = new DataView();
> dv.Table = dt;
>
> dt.Colums.Add(" firstName");
> dt.Colums.Add(" lastName");
>
> dataRow dr = dt.NewRow();
>
> dv.Filter = "firstName = 'A'";
>
> dr["firstName"]="A";
> dr["lastName'']="bla bla";
> dt.Rows.Add(dr) ;
>
> dataGrid1.dataS ource = dv;
>
> NOW, THIS ROW WILL BE SHOWN, BUT IF I SO SOMETHING LIKE:
> dr = dt.Rows[0];
> dr["lastName"] = "bla bla bla bla";
> dt.AcceptChange s();
>
> THE ROW WILL DISAPPEAR (even thought i didn't change the first name at
all).
> I've tried using : dv.RowStateView = Current but it didn't work...
>
> please help
>
>
> "Zürcher See" wrote:
>
> > Each DataRow has the readonly property RowState.
> > When you change a value in a row, also the RowState is changed to
"Modified"
> > If you add a row, this row will have a RowState="Added "
> > If you delete a row, this row will be marked as "Deleted"
> >
> > If you call the AcceptChages() method of the DataRow/DataTable, all the > > chages made to the rows will take place and all the state of the rows are
> > set to "Unchanged"
> > If you call the RejectChages() method of the DataRow/DataTable, all the > > chages made to the rows will be discarded and all the state of the rows are
> > set to "Unchanged"
> >
> > DataView is able to filter also the RowState, if you are not intrested to
> > filter the rowstate set the
> > DataView.RowSta teFilter=DataVi ewRowState.Curr entRows
> >
> > "Ubi" <Ub*@discussion s.microsoft.com > schrieb im Newsbeitrag
> > news:EB******** *************** ***********@mic rosoft.com...
> > > hi
> > > i have a problem with System.Data.Dat aViewRowState.
> > >
> > > i have a ReadOnly datagrid,
> > > a dataView and a dataTable.
> > >
> > > i'm using the dataView's filter property to filter the data (firstName =
> > > 'Dani').
> > > the problem is that i don't understanh how the ViewRowState works:
> > > i have an external form that changes the value of the dataTable.
> > > when it changes a row (even when the firstName col is not changed). the
> > row
> > > disappears; when a row that wasn't in the view before (because it's name
> > want
> > > Danni) changes to firstName->Danni, it doesn't appear in the view
although
> > it
> > > should be...
> > >
> > > please please help!
> > >
> >
> >
> >


Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3143
by: Alex Ayzin | last post by:
Hi, I have a problem that might be easy to solve(possibly, I've just overlooked an easy solution). Here we go: I have a dataset with 2 datatables in it. Now, I need to do the following: if ds.table(0).rows(0).item("col1") = ds.table(1).rows(0).item("col2") then txtResult.text = ds.table(1).rows(0).item("col3")
5
3069
by: Richard | last post by:
Hi, I have a form that take some time to load due to many comboboxes and at least 8 subforms. When I filter or sort the main form I get an error message and then Access shuts down. They ask if I want to send the error report to Microsoft. Has anybody seen this type of error message and what can I do to prevent it from happening. Am I doing...
2
1589
by: Dimitri | last post by:
PLEASE HELP,I HAVE A DATABSE WITH MULTIPLE RECORDS AS OUTLINED BELOW EMP NO LEVEL NEXTINCREASE WAGETYPE UNIT 1000 1 0 1000 1000 1 0 1002 1 I WANT TO BE TO HAVE THIS IN ONE RECORD IE REPEAT THE COULUMNS WAGETYPE AND UNIT(APPEND THEM TO THE END OF UNIT)
5
3014
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I need to send data from my server via the post method to the payment server. The payment server does not run asp.net. I dont know what they run. The...
2
1190
by: micka | last post by:
hi, i want to filter fields in a table on my form but the problem is that the field (Included/Excluded) in the table is in the format of YES/NO. i dont mind if the filter on my form is in the form of a list box, option button or a check box but i want to be able to search for all records, included or excluded. the way that i have tried to do...
7
16355
by: Ryan | last post by:
I have a DataGridView which displays numeric (Int32) data from an underlying database. I want the numbers to be displayed in numeric format "#,###" (with commas). I want to also limit the user so they can only input numerical values. Is there any way to do this? Currently my formatting works but if the user enters a value manually the...
3
4253
by: =?Utf-8?B?QXJseW5fTA==?= | last post by:
I have a DataTable with four columns of type Float (r1, r2, r3, and r4) connected through a BindingSource to a DataGridView. I need to filter the displayed rows as" ABS(r1-r2)>c1 OR ABS(r3-r4) c1 where ABS is an absolute value. Is there a simple way to accomplish this while retaining the ability to edit the data in the displayed rows?
14
9457
by: Brad | last post by:
I have a .net 2.0 web application project that creates a pdf file, saves the pdf to disk (crystal reports does this part), and then my code reads the pdf file and writes it to the httpresponse The web app works great on win2003 and xp and the end result is a pdf file is displayed in the browser. When I run the same code on Vista, the...
4
2630
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. - Why is this happening? - Can I disable automatic declaration and have everything be declared manually? - Any other options to fix this? Thanks in...
0
7946
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...
1
7457
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...
0
7791
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6026
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...
0
5078
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...
0
3491
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...
0
3470
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1045
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
744
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...

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.