I have a usercontrol with a public property that I'm trying to set using Eval with a databound Radgrid.
I'm trying to set the Acc Property to Eval("Acc"). It just won't stick. By the time the usercontrol is loaded the property has been reset.
In the usercontrol, the property is just defined. It's never set and has no default value. I've tried to set it in the codebehind in the expand event of the nested view, and it still doesn't stick.
I've resorted to set it in the control itself with.
Which I don't want to do because this control won't only be used in the gridview. I'll handle those cases later, for now I just want to get this part working. The markup is pasted below. thanks.
I'm trying to set the Acc Property to Eval("Acc"). It just won't stick. By the time the usercontrol is loaded the property has been reset.
In the usercontrol, the property is just defined. It's never set and has no default value. I've tried to set it in the codebehind in the expand event of the nested view, and it still doesn't stick.
I've resorted to set it in the control itself with.
Acc = DirectCast(DirectCast(Me.Parent.Parent, Telerik.Web.UI.GridTableCell).Parent, Telerik.Web.UI.GridNestedViewItem).ParentItem.GetDataKeyValue("Acc")Which I don't want to do because this control won't only be used in the gridview. I'll handle those cases later, for now I just want to get this part working. The markup is pasted below. thanks.
<telerik:RadGrid ID="rgdQueue" runat="server" CellSpacing="0" DataSourceID="dsQueue" AllowFilteringByColumn="True" GridLines="None" AllowPaging="true" AllowSorting="true"> <MasterTableView AutoGenerateColumns="False" DataSourceID="dsQueue" DataKeyNames="Acc"> <NestedViewTemplate> <table style="width: 100%;"> <tr> <td> <span style="font-size: 18pt; color: #010101; line-height: 30px;">Report</span> </td> </tr> <tr> <td style="width: 100%;"> <div style="border: 1px solid gray; padding-left: 25px; padding-right: 10px; padding-top: 10px; padding-bottom: 10px;"> <%# Eval("OriginalReport") %> </div> </td> </tr> <tr> <td> <%# Eval("Acc") %> <uc4:PeerReview Acc='<%# Eval("Acc") %>' ID="PRNested" runat="server" /> </td> </tr> <tr> <td> <asp:Button ID="btnSave" runat="server" Text="Save" CausesValidation="true" OnClick="btnSave_Click" ValidationGroup='<%# Eval("Acc") %>' /> <asp:Button ID="btnSign" runat="server" Text="Sign" CausesValidation="true" ValidationGroup='<%# Eval("Acc") %>' /> <asp:Button ID="btnNext" runat="server" Text="Next" OnClick="btnNext_Click" CausesValidation="false" /> </td> </tr> </table> </NestedViewTemplate> <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings> <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridTemplateColumn DataField="QueueDate" FilterControlAltText="View Peer Review History" HeaderText="Date Added to Queue" SortExpression="QueueDate" UniqueName="QueueDate"> <ItemTemplate> <asp:Label ID="QueueDateLabel" runat="server" Text='<%# ConvertDateToInternational(Eval("QueueDate")) %>'></asp:Label> </ItemTemplate> <FilterTemplate> <telerik:RadComboBox ID="rcbHistoryFilter" runat="server" OnSelectedIndexChanged="rcbHistoryFilterr_SelectedIndexChanged" OnDataBound="rcbHistoryFilter_DataBound" Width="120" DataSourceID="dsQueueHistory" DataTextField="Text" AutoPostBack="true" DataValueField="Months"> </telerik:RadComboBox> </FilterTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Images" UniqueName="Images"> <ItemTemplate> <asp:Image Style="border-style: none;" ID="imgViewImages" Acc='<%# Eval("Acc") %>' PatID='<%# Eval("PatientID") %>' SiteCode='<%# Eval("SiteCode") %>' Width="20" Height="20" ImageUrl="../images/workstation.jpg" runat="server"></asp:Image> </ItemTemplate> <FilterTemplate> </FilterTemplate> </telerik:GridTemplateColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"> </EditColumn> </EditFormSettings> </MasterTableView> <FilterMenu EnableImageSprites="False"> </FilterMenu> <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"> </HeaderContextMenu></telerik:RadGrid>