I would think that either this is a stupid mistake I'm making, or someone else has at least had this problem, but I couldn't find any specific help in other posts, so here I go...
I have a NestedViewTemplate with a UserControl. I bind a couple of my UserControl properties to the row DataItem values. In my user control, there are a few buttons that change values on the grid (we'll say "Status" changes for this example). In the user control, if I update the "Status" of a row, I have to rebind the grid for the changes to show up. That all works fine, except when I call gridResumes.Rebind(), it shows the changes, but my NestedView is not showing anymore, the row is not expanded.
My solution was to have an event fire when you change a row using the NestedViewTemplate that tells me which row was changed. I then set "gridResumes.Items[updatedItemIndex].Expanded = true;" so that after the postback, the item is still expanded.
My problem is, calling Rebind() reloads the column data, but the NestedTableView is not bound to anything, the values within my user control are null. Why does Rebind() not rebind the NestedTableView? Do I have to call that manually after setting Expanded=true?
I have a NestedViewTemplate with a UserControl. I bind a couple of my UserControl properties to the row DataItem values. In my user control, there are a few buttons that change values on the grid (we'll say "Status" changes for this example). In the user control, if I update the "Status" of a row, I have to rebind the grid for the changes to show up. That all works fine, except when I call gridResumes.Rebind(), it shows the changes, but my NestedView is not showing anymore, the row is not expanded.
My solution was to have an event fire when you change a row using the NestedViewTemplate that tells me which row was changed. I then set "gridResumes.Items[updatedItemIndex].Expanded = true;" so that after the postback, the item is still expanded.
My problem is, calling Rebind() reloads the column data, but the NestedTableView is not bound to anything, the values within my user control are null. Why does Rebind() not rebind the NestedTableView? Do I have to call that manually after setting Expanded=true?
| <telerik:RadGrid ID="gridResumes" runat="server" AllowPaging="true" |
| AllowSorting="true" onneeddatasource="gridResumes_NeedDataSource" |
| AllowFilteringByColumn="true" CssClass="resumeGrid"> |
| <GroupingSettings CaseSensitive="false" /> |
| <ClientSettings EnableRowHoverStyle="true" /> |
| <MasterTableView DataKeyNames="RecruitmentPortalGUID" AutoGenerateColumns="false"> |
| <Columns> |
| <telerik:GridBoundColumn HeaderText="Last Name" UniqueName="LastName" |
| SortExpression="LastName" DataField="LastName"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="First Name" UniqueName="FirstName" |
| SortExpression="FirstName" DataField="FirstName"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Position" UniqueName="AppliedPositionShort" |
| SortExpression="AppliedPositionShort" DataField="AppliedPositionShort"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Quiz" UniqueName="QuizTotal" |
| SortExpression="QuizTotal" DataField="QuizTotal"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn HeaderText="Applied" UniqueName="DateCreated" |
| SortExpression="DateCreated" DataField="DateCreated" DataFormatString="{0:MM/dd/yyyy}"></telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn HeaderText="Status" UniqueName="Status" SortExpression="Status" DataField="Status"> |
| <ItemTemplate> |
| <span class='<%# "resumeGrid_item_status_" + Eval("Status").ToString().ToLower() %>'><%# Eval("Status") %></span> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| <NestedViewTemplate> |
| <asp:HiddenField ID="hiddenRecruitmentPortalGuid" runat="server" Value='<%# Eval("RecruitmentPortalGUID") %>' /> |
| <asp:Panel ID="pnlResumeDetails" runat="server" CssClass="resumeItem_details"> |
| <custom:ResumeDetails ID="resumeDetails" runat="server" |
| RecruitmentPortalGuid='<%# Eval("RecruitmentPortalGUID") %>' ItemIndex='<%# ((Telerik.Web.UI.GridNestedViewItem)Container).ParentItem.ItemIndex %>' |
| OnHide="resumeDetails_Hide" OnShow="resumeDetails_Show" OnInterview="resumeDetails_Interview" |
| OnHire="resumeDetails_Hire" OnRelease="resumeDetails_Release" /> |
| </asp:Panel> |
| </NestedViewTemplate> |
| </MasterTableView> |
| </telerik:RadGrid> |