473,385 Members | 1,397 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,385 software developers and data experts.

Filtering problem.... urgent please help

Ubi
hi
i have a problem with System.Data.DataViewRowState.

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 1413
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.RowStateFilter=DataViewRowState.CurrentRo ws

"Ubi" <Ub*@discussions.microsoft.com> schrieb im Newsbeitrag
news:EB**********************************@microsof t.com...
hi
i have a problem with System.Data.DataViewRowState.

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.dataSource = dv;

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

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.RowStateFilter=DataViewRowState.CurrentRo ws

"Ubi" <Ub*@discussions.microsoft.com> schrieb im Newsbeitrag
news:EB**********************************@microsof t.com...
hi
i have a problem with System.Data.DataViewRowState.

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.dataSource = dv;

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

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.RowStateFilter=DataViewRowState.CurrentRo ws

"Ubi" <Ub*@discussions.microsoft.com> schrieb im Newsbeitrag
news:EB**********************************@microsof t.com...
hi
i have a problem with System.Data.DataViewRowState.

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*@discussions.microsoft.com> schrieb im Newsbeitrag
news:BA**********************************@microsof t.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.dataSource = dv;

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

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.RowStateFilter=DataViewRowState.CurrentRo ws

"Ubi" <Ub*@discussions.microsoft.com> schrieb im Newsbeitrag
news:EB**********************************@microsof t.com...
hi
i have a problem with System.Data.DataViewRowState.

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*@discussions.microsoft.com> schrieb im Newsbeitrag
news:C0**********************************@microsof t.com...
Only the changed row disappear...

"Zürcher See" wrote:
Disappears only the changed row or all rows disappear?
"Ubi" <Ub*@discussions.microsoft.com> schrieb im Newsbeitrag
news:BA**********************************@microsof t.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.dataSource = dv;

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

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.RowStateFilter=DataViewRowState.CurrentRo ws
>
> "Ubi" <Ub*@discussions.microsoft.com> schrieb im Newsbeitrag
> news:EB**********************************@microsof t.com...
> > hi
> > i have a problem with System.Data.DataViewRowState.
> >
> > 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*@discussions.microsoft.com> schrieb im Newsbeitrag
news:C0**********************************@microsof t.com...
Only the changed row disappear...

"Zürcher See" wrote:
Disappears only the changed row or all rows disappear?
"Ubi" <Ub*@discussions.microsoft.com> schrieb im Newsbeitrag
news:BA**********************************@microsof t.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.dataSource = dv;
>
> NOW, THIS ROW WILL BE SHOWN, BUT IF I SO SOMETHING LIKE:
> dr = dt.Rows[0];
> dr["lastName"] = "bla bla bla bla";
> dt.AcceptChanges();
>
> 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.RowStateFilter=DataViewRowState.CurrentRo ws
> >
> > "Ubi" <Ub*@discussions.microsoft.com> schrieb im Newsbeitrag
> > news:EB**********************************@microsof t.com...
> > > hi
> > > i have a problem with System.Data.DataViewRowState.
> > >
> > > 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
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...
5
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...
2
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 ...
5
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...
2
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...
7
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...
3
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)...
14
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 ...
4
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. -...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.