Questions tagged [rowstate]
26 questions
9
votes
3 answers
How to check for combined RowState 'Altering | Edit' in RowDataBound?
On my page, I set up a GridView with a few columns. I coded an update, delete and insert method. While my GridView binds its data, the following method is called:
protected void GridViewAutomat_RowDataBound(object sender, GridViewRowEventArgs e)
{
…

Alessandro Minneci
- 281
- 5
- 24
6
votes
2 answers
What is the difference between RowState.Added and DataRowVersion.Original
I have a function with 3 conditions:
If DataRow rowstate == Added
If !DataRow HasVersion(DataRowVersion.Original)
If DataRow rowstate == modified
My problem is with the second one, can anyone shine some light on it?
How is it different than the…

Amit Toren
- 353
- 5
- 13
4
votes
3 answers
C# - Using DataAdapter to Update SQL table from a DataTable - SQL table not updating
I select * from an Excel spreadsheet into DataTable dt. I want to take those values and update the SQL table. The SQL table exists because of a manual import to SQL from the original Excel spreadsheet, has a primary key set. The user updates the…

cjjeeper
- 93
- 3
- 4
- 13
4
votes
2 answers
DataAdapter.Fill() behavior for row deleted at the data source
I'm using the DataSet/DataTable/DataAdapter architecture to mediate between the database and my model objects, which have their own backing (they aren't backed by a DataRow). I've got a DataAdapter with AcceptChangesDuringFill = False,…

John Calsbeek
- 35,947
- 7
- 94
- 101
3
votes
8 answers
How to delete all rows from datatable
I want to delete all rows from datatable with rowstate property value Deleted.
DataTable dt;
dt.Clear(); // this will not set rowstate property to delete.
Currently I am iterating through all rows and deleting each row.
Is there any efficient…

meetjaydeep
- 1,752
- 4
- 25
- 39
2
votes
2 answers
Preserving DataRowState when serializing DataSet using DataContractSerializer
For various reasons I am having to send a typed dataset to a WCF service endpoint. This works fine except that upon Deserializing, the RowState of each row in each DataTable is set to 'Added', regardless of what they were on the client. If I write…

Chruzi
- 23
- 3
2
votes
4 answers
Serializing a DataSet/DataTable with properties in json.net
I'm looking a solution to serialize dataset to json, but I need to get the rowstate in json.
Does json.net serialize / deserialize properties of the dataset / datatable, like rowstate? I can only find examples with row value.
Thanks.

jsaraiva
- 33
- 7
1
vote
1 answer
Gridview adding row dynamically on RowDataBound with the same RowState (Alternate or Normal)
I am adding rows dynamically on code behind depending on the Row currently bounded on RowDataBound event. I want that added row to be the same state (Alternate or Normal) of the currently bounded row is this possible?
I'm doing something like this…

rob waminal
- 18,117
- 17
- 50
- 64
1
vote
0 answers
Output Parameters used with update CASCADE issue, when using data adapters
I've manually created some data adapters – using the auto-generated ones is not viable due to version incompatibilities, for a dataset made of a number of tables with the usual mixture of PK, FK constraints. Most of its working pretty smoothly so…

Simon B
- 119
- 1
- 13
1
vote
1 answer
How to use DataRowState.Deleted?
I have a delete button which removes items from the DataGridVeiw and sets the main DataTable.Row.RowState to Deleted. Problem arises when I want to save all changes but can no longer access the a value (ID) from the row which state has changed. Ill…

ravenx30
- 406
- 1
- 6
- 11
1
vote
2 answers
Maintain DataRowState in ADO.NET Dataset - RejectChanges() method does not work?
The problem simplified:
I have a DataSet with some datatables...
I have a Winforms DataGrid bound to one of the datatables.
User sticks some rows into said datatable, via the DataGrid, let's say 3 rows;
All three rows now have their RowState =…

joedotnot
- 4,810
- 8
- 59
- 91
0
votes
1 answer
dynamics ax 2012: Change RowState from Edit to Selected
In AXGridView, I want to change the row state of selected row, which is in edit mode to selected mode.
This needs to happen on clicking an external button.
I tried the following ways:
Updated the RowState of the selected Row to…

user1109691
- 1
- 3
0
votes
1 answer
Issue with DataRow state in DataTable
I have a very strange requirement using DataTable. I have a datatable with some columns. Nwo whenever there is any change in any of the DataRow in the datatable; then the state of DataRow is set to modified. That is OK. But for one exceptional…

Ramesh Soni
- 15,867
- 28
- 93
- 113
0
votes
3 answers
Check if row is new in CollectionViewSource
I have a CollectionViewSource (cvs) which has strongly typed DataTable as it's source. Cvs.View is set as DataGrid's ItemsSource. I want to update, insert and delete data from a database based on changes in DataGrid. I have successfully done update,…

Vale
- 3,258
- 2
- 27
- 43
0
votes
2 answers
If GridViewRow is Selected Then ... Else
Ok, this seems like it should be very easy to do, however I can't seem to work without erroring out. I have an IfThen Statement that states if a row is selected, then execute, else, display message. The code runs fine if I select a row, however…

Kevin
- 111
- 1
- 3
- 10