I thought this would be easier than it has become, but I am stuck trying to refresh my grid when a change is make from a FormView (that is in a UserControl) from the forms NestedView. Basically I am doing a simple update, but that data that is getting update is part of the main grids display so I want the grid to rebind or refresh when the change is made.
Here is how my grid is set up:
Then from a <asp:FormView> inside that usercontrol 'AppViewer1' I have:
And finally from the user control code behind:
Any ideas on an easier way to do this? Appreciate it.
Here is how my grid is set up:
<NestedViewTemplate> |
<uc1:AppViewer ID="AppViewer1" runat="server" /> |
</NestedViewTemplate> |
Then from a <asp:FormView> inside that usercontrol 'AppViewer1' I have:
<telerik:RadComboBox ID="list_appState" Runat="server" Skin="Sunset" SelectedValue='<%# Bind("app_state") %>' AutoPostBack="True" OnSelectedIndexChanged="list_appState_SelectedIndexChanged"> |
And finally from the user control code behind:
Protected Sub list_appState_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) |
Dim record As Integer = (TryCast(Parent.FindControl("GridRec"), Label)).Text |
Dim AppState As String = (TryCast(formview_AppInfo.FindControl("list_appState"), RadComboBox)).SelectedValue |
Dim UpdateSuccess As Integer = Applications.UpdateAppState(record, AppState) |
If UpdateSuccess > 0 Then |
lbl_status.Text = String.Format("<br />The Application Status has been updated to '{0}' for record: {1}.<br /><br />", AppState, record) |
'Dim grid As RadGrid = Parent.FindControl("grid_applications") |
'grid.Rebind() |
End If |
End Sub |
Any ideas on an easier way to do this? Appreciate it.