
12 Answers, 1 is accepted


Regards,
MP
MP, thank you for your reply.
John, the ValueChanged event is fired when an editor changes its value. When handling this event you should check ActiveEditor.Value to get the current value. If you want to track changes of the cell value, you have to handle CellValueChanged event, as MP replied. I hope this helps. If you have further questions, do not hesitate to contact us.
Kind regards,Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

and updated the database in this event "radGridPartsList_CellEndEdit". Now I want to refresh the grid automatically. After updating the record into the database I called BindDataGrid function which called "ResetGridView" and binded data source then instead of refreshing the grid it errors, looks like it enters into the recursion to bind the datagrid and then it errors. Which event I should use to Bind the grid which refreshes the grid after the cell is edited?
When using DataTable, DataSet or a BindingList and your business object implements INotifyPropertyChanged interface it is not necessary to do anything to update RadGridView. It will do this automatically. In all other cases you can call GridElement.Update or MasterGridViewTemplate.Update methods:
this
.radGridView1.GridElement.Update(GridUINotifyAction.DataChanged);
// or (when the code above doesn't help)
this
.radGridView1.MasterGridViewTemplate.Update(GridUINotifyAction.Reset);
Changing the data source in this situation is not recommended. If this does not help to resolve the issue, please send us your application and we will investigate it further.
I am looking forward to your project.
Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Bill

Would you please provide a more detailed description of your scenario? What type of DataSource object do you use? Is it a DataTable, or a custom business object, or other type? Please send us code snippets which illustrate how you are updating your instance.
I am looking forward to your reply.
Julian Benkov
the Telerik team

Code to update the original DataTable with changed row:
arg =
New
PropertyCollection
arg.Add(
"@defseq"
, args(
"@defseq"
))
updateRow = mDefDetail.Read(arg)
updateTable.ImportRow(updateRow)
Form1.dt.Merge(updateTable,
False
)
Form1.dt.AcceptChanges()
The only way I've been able to get this to work is by basically setting the DataTable and DataSource values to Nothing and then rerunning the stored procedure to repopulate the DataTable and reset the DataSource to the very same DataTable again:
Form1.dt =
Nothing
Form1.dt = Form1.myDatalayer.Rows(
""
, Form1.spName, Form1.pArgs)
Form1.NewDoc.RadGridView1.DataSource =
Nothing
Form1.NewDoc.RadGridView1.DataSource = Form1.dt
Form1.NewDoc.RadGridView1.Refresh()
Thank you very much for the detailed information.
As I analyzed your code snippets, I noticed that you set a new instance to Form1.dt (DataTable object):
Form1.dt =
Nothing
Form1.dt = Form1.myDatalayer.Rows(
""
, Form1.spName, Form1.pArgs)
In your scenario the RadGridView DataSource resetting is a required operation. Please use the following line:
Form1.NewDoc.RadGridView1.DataSource = Form1.dt
I hope this helps. Let me know if I can assist you further.
Best wishes,Julian Benkov
the Telerik team

I'm already doing as you suggested (two rows below the snippet you took from my snippet) because it is the only thing I've found that works, but it is far from being an optimal solution. Imagine how long it would take to refill a DataTable that has 1,000,000 rows just to update a grid! An extreme example, to be sure, but it makes the point I'm trying to get across.
What I wish were available in the RadGridView is the ability to directly replace rows in the grid with DataRows, rather than having to cobble together an iterative loop to change the values of cells within the grid. I'm on a project now that will contain grids with child grids and I am really not looking forward to figuring out how to update a row in a child grid to show a change in a single column!
For 1,000,000 records the refill operation of the bound DataTable object and the corresponding RadGridView updates will take time close to the time taken when you reset the DataSource property.
These two operations call Reset updates in grid GridViewTemplate object. In order to have optimal performance you can use VirtualMode in this scenario, but this will stop all data operations (sorting, grouping, filtering) and you must make an external layer for this functionality.
In your case you can iterate over the DataRows and change their values - the changes will automatically be reflected by the RadGridView, but you cannot change the instances of the DataRow objects bound to the grid control
The RadGridView control updates automatically when its bound DataSource object is updated thanks to the IBindingList and INotifyPropertyChanged interfaces - DataTable and DataRow implement these interfaces. For additional information about RadGridView binding, please refer to this article.
Julian Benkov
the Telerik team