I have an application that uses a formview within the Grid's NestedViewTemplate to display additional record data:
Inside the UserControl I have a FormView to display all the additional data. All of this works fine.
However, I have a RadComboBox that I use to perform an update of status when the user selects something. This column is found on the main grid so when they make a change I want the main grid to display the new value immediately, I cant get it to work. I thought I could just rebind the main grid like so:
However on that rebind I get the error:
Should I not be able to reference the grid just as I do other controls on the parent and then rebind it?
<telerik:RadGrid ID="grid_applications" runat="server" |
.... |
<NestedViewTemplate> |
<asp:Label ID="GridRec" runat="server" Visible="false" Text='<%# Eval("record") %>' /> |
<uc1:AppViewer ID="AppViewer1" runat="server" /> |
</NestedViewTemplate> |
Inside the UserControl I have a FormView to display all the additional data. All of this works fine.
However, I have a RadComboBox that I use to perform an update of status when the user selects something. This column is found on the main grid so when they make a change I want the main grid to display the new value immediately, I cant get it to work. I thought I could just rebind the main grid like so:
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 = Apps.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 = (TryCast(Parent.FindControl("grid_applications"), RadGrid)) |
grid.Rebind() |
Else |
End If |
End Sub |
However on that rebind I get the error:
Object reference not set to an instance of an object.
Should I not be able to reference the grid just as I do other controls on the parent and then rebind it?