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

[Solved] How to force the reload of a grid using object datasource

1 Answer 348 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joao Araujo
Top achievements
Rank 1
Joao Araujo asked on 19 Oct 2009, 01:35 AM
Hello,

    I am using Telerik 2009.2 
    I have a grid that is filled by an object data source. In the itemcommand event I insert a new row in the data table. 
    Unfortunately, Nothing that I do forces the grid to reload the list from the database. It grabs some values from the the new object inserted but not all of them. I tried rebind, force bind, etc, without success. 
 
   What can I do to reload the objects from the database? 



Thanks, 

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 19 Oct 2009, 07:00 AM
Hello Joao,

Calling Rebind of RadGrid will trigger NeedDataSource event if you are using advanced data-binding or will cause DataSourceControl attached to RadGrid to execute its select command.
Thus if you provide in NeedDataSouce event fresh copy of the DataTable in question to <Grid_Instance>.DataSource, RadGrid will bind to it and newly added record will appear in RadGrid items.

Sincerely yours,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Joao Araujo
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or