When selected index changes, I populate several fields out side the grid. The user can then make changes to a couple of the fields. Also outside the grid is a save button, that sends changes to the database. Inside the save button's click event I call the grid's rebind method. This in turn calls the grid's NeedDataSource event handler. I set a break in this method, I can see the updated data in the datatable. I set the grid's datasource property equal to the datatable. I expect the data in the grid to be updated, but nothing happens.
3 Answers, 1 is accepted
0
bill
Top achievements
Rank 1
answered on 10 Sep 2008, 08:05 PM
This looks to be an issue when the panel the button is located in, is specified in the RadAjaxManager's Updated controls. I put together a simple example:
| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <div> |
| <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None"> |
| <MasterTableView> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| </MasterTableView> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </FilterMenu> |
| </telerik:RadGrid> |
| </div> |
| <asp:Panel ID="Panel1" runat="server"> |
| <asp:Button ID="Button1" runat="server" Text="Update" /></asp:Panel> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
| <telerik:AjaxUpdatedControl ControlID="Panel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click |
| RadGrid1.Rebind() |
| End Sub |
| Private Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource |
| Dim myTable As New DataTable |
| myTable.Columns.Add("Time") |
| myTable.Rows.Add(New String() {Date.Now.ToString("hh:mm:ss")}) |
| RadGrid1.DataSource = myTable |
| End Sub |
0
Accepted
Hello bill,
Please change this setting to:
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Panel1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
Best wishes,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Please change this setting to:
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Panel1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
Best wishes,
Vlad
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
bill
Top achievements
Rank 1
answered on 11 Sep 2008, 02:40 PM
I modified the code you posted some what to get the functionality I need. Thanks for your post!
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="Panel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="Panel1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
