VBAHole22 Posted June 11, 2007 Posted June 11, 2007 I have a gridview that I fill by binding it to a dataTable. Then I let the user make modifications to check boxes in the grid. When they are done they click a button and I need to run some stored procs for the changes they made. Is there a simple way for the DataTable to tell me which rows have been modified? I know this is what a diffGram is supposed to do. My data is not coming from xml and I don't want ADO.NET taking care of anything more than just telling me what changed. I'm reading alot about how .NET can run and update my data for me and such. I'm not ready to give that control over yet. Any suggestions? Quote Wanna-Be C# Superstar
VBAHole22 Posted June 11, 2007 Author Posted June 11, 2007 A little more information that I gathered from searching. There is a RowState property on all rows in a DataTable that will tell me if the row has been modified and will give me the original and modified values which is exactly what I need. But I can't get at my GridView's data source which I know is a DataTable. gv.DataSource = myDt; //will bind my grid //but after postback DataTable dt = gv.DataSource as DataTable //only returns null //i do have viewstate enabled because I can get at foreach (GridViewRow gvr in gv.Rows) { DataControlRowState drs = gvr.RowState; } But the DataControlRowState is not the same as the RowState on a DataRow and it doesn't have the same capabilities. How can I get my dataTable back from the source of the gridView with the user changes? Quote Wanna-Be C# Superstar
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.