When BindingManager position changes, DataRow RowState changes to "Modified"

When BindingManager position changes, DataRow RowState changes to "Modified"

Post by Srikant » Tue, 21 Jun 2005 14:45:04


Hi,
When I scroll through the rows in a dataset using BindingManagerBase
Position property, the DataRow's RowState property is changing to "Modified"
even though there are no changes to the actual data.

Iam using .NET framework 1.1 and C#.

Thanks in advance.
Regards,
Srikanth.
 
 
 

1. Newbie: Positions of BindingManager and its bound data-source: changing current item.

2. Newbie: Positions for BindingManager and its bound data-source: changing current item.

My application has several text-box controls bound to a DataSet.
It's easy to navigate the data incrementing or decrementing the
BindingManager Position (first / previous / next / last --> easy, ok).
What do I want? I want to write on one of those text-box controls instead of
clicking prev/next buttons. I mean, if one of those boxes shows the
auto-numerical key of the current row (let's say it shows "1"), I want to be
able to write "14" and get the whole collection of data-bound-controls
showing the values of the row whose auto-numerical key is 14. Then write "7"
and get the whole collection of data-bound-controls showing the values of
the row whose key is 7. And so on.
To get this I use the "TextChangeEvent".
The code I think I would need for this event is something like this:
1- Find the row whose key is 14 (for the example) [DataTable.Rows.Find(14)]
2- Get its "Position" at the collection (let's say it's the 9th. element)
[a dataset is a collection controlled by BindingManager...]
3- Assign it to the BindingManager Position [BindingManagerBase.Position =
9]

So, my problem is with point 2:
How do I know the "Position" (in order to assign it to the BindingManager)
of the row that I am able to Find within the DataSet?
Or, is there another way to get the current item changed, so that the
CurrencyManager notifies the bound controls? (Because
"DataTable.Rows.Find(14)", wich gives me the DataRow I look for, does not
raise "current item changed").

Thank you!

3. DataRow Change Event - behaves differently on Modify vs. Add

4. Is DataRow[string] uses DataRow[int] and DataRow[int] much efficient than DataRow[string]?

5. DataRow.RowState

6. DataRow.RowState read-only, workaround

7. Problem With DataRow Rowstate

8. DataRow RowState Delete

9. Updating a value in a column in a datarow but not affecting RowState

10. DataRow Rowstate and drag and drop

11. When does setting the Position of a BindingManager not work?

12. Access Form Modified date changes when nothing is changed

13. RowState not changing

14. RowState doesn't change! in DataBind

15. Changing RowState