This is a migrated thread and some comments may be shown as answers.

row state won't change after commandcell click

2 Answers 42 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Cathy Shao
Top achievements
Rank 1
Cathy Shao asked on 17 Mar 2011, 10:47 PM
I am using WinForms Q2 2010 SP2 (v2010.2.10.0914)

I have a form with a gridview and a save button outside gridview.  The gridview has a commandcell column with dynamically generated command buttons to open another form.  When the row gets modified, click the save button will save the grid data into database.

If I modified the data and clicked the commandcell button, without leaving the row, then click the save button outside gridview.  It will stop working.  It seems that the dataset bounded to the grid donsn't get the row state changed to modified.

My work around is to force the row change by setting Radgridview1.CurrentRow to first or last row in the save button click event.  Wonder if this is a known issue.  Is there any better solution.  My work around will fail if there is only one row in the grid.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 19 Mar 2011, 10:49 AM
Hello Cathy,

You could try handling the Cell Validating event in order to set the row state to modified (dirty). Or this is not the case, i would kindly ask if you could post a small sample so that we'll be able to find the best solution possible to your case.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga

Telerik WinForms MVP

0
Stefan
Telerik team
answered on 22 Mar 2011, 04:36 PM
Hello Cathy Shao,

Thank you for writing.

You can try to call RadGridView.EndEdit() in the command button click event. This should notify the dataset.

Let me know how this works for you.

Kind regards,
Stefan
the Telerik team
Tags
GridView
Asked by
Cathy Shao
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or