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

Grid doesn't display last inserted item

2 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wolfgang Sigel
Top achievements
Rank 1
Wolfgang Sigel asked on 14 Feb 2011, 11:15 AM
Hi everybody,
I'm having trouble with the RadGrid displaying the items from its associated data source. My scenario is as follows:
a user clicks a save-button outside the RadGrid (which itself is in a user control). A modal RadWindow pops up and asks the user for a name to save and then certain database insert-operations take place. After that is successfully done the DataSource of the grid is set to null and the Rebind() is called on the grid. There is a NeedDataSource handler which populates a DataTable and binds it to the DataSource of the RadGrid.
When I check the number of items in the itemcollection I can see that the number has correctly been increased by 1, however that added item
does not display in the grid: I have to click on some button and only then it shows up.

On the other hand if a delete is being done (using a delete button inside the RadGrid) everything works fine, the particular item is immediately removed from the grid. The RadGrid is added to the RadAjaxManager and I'm using Q3 2010. So is there some way to update that view on the itemcollection after an insert ? Any suggestions are highly appreciated.

Thanks, Wolfgang

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 14 Feb 2011, 11:25 AM
Hello Wolfgang,


I suppose, the AjaxManager - AjaxSettings you set is not in proper way. You need to set AjaxSetting in a way that it mentions which controls updates the grid, then only the modification shows on page.
AJAX Manager
RadAjax and WebUserControls


Thanks,
Princy.
0
Wolfgang Sigel
Top achievements
Rank 1
answered on 14 Feb 2011, 12:15 PM
Hi Princy,

I've just found the following snippet in another post:

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 

This setting did it for me: I wasn't aware that I had to include the AjaxManager itself when doing an AjaxRequest.
So you were right with the settings in the AjaxManager.

Thanks, Wolfgang
Tags
Grid
Asked by
Wolfgang Sigel
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Wolfgang Sigel
Top achievements
Rank 1
Share this question
or