Hi
My app has ViewState disabled.
I have a panel bar with multiple items. Depending on some server side logic, I may hide some panel items.
The PanelBar loads fine.
However, on postback the wrong panel item opens.
Let's say I have 5 panel items and the server side logic hides the first one.
If I click Edit on the 4th item, on postback the 3rd item would open.
In the example below, no panel would be open on postback.
How can I fix it?
Thanks
Chen
Code behind:
My app has ViewState disabled.
I have a panel bar with multiple items. Depending on some server side logic, I may hide some panel items.
The PanelBar loads fine.
However, on postback the wrong panel item opens.
Let's say I have 5 panel items and the server side logic hides the first one.
If I click Edit on the 4th item, on postback the 3rd item would open.
In the example below, no panel would be open on postback.
How can I fix it?
Thanks
Chen
<telerik:RadPanelBar ID="RadPanelBar1" Runat="server"> <Items> <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1"> </telerik:RadPanelItem> <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2" Selected="True"> </telerik:RadPanelItem> <telerik:RadPanelItem runat="server" Text="Root RadPanelItem3"> <ContentTemplate> <asp:FormView ID="FormView1" runat="server" DataSourceID="LinqDataSourcePayee" DataKeyNames="id"> <EditItemTemplate> firstName: <asp:TextBox ID="firstNameTextBox" runat="server" Text='<%# Bind("firstName") %>' /> <br /> lastName: <asp:TextBox ID="lastNameTextBox" runat="server" Text='<%# Bind("lastName") %>' /> <br /> <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" /> <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /> </EditItemTemplate> <ItemTemplate> firstName: <asp:Label ID="firstNameLabel" runat="server" Text='<%# Bind("firstName") %>' /> <br /> lastName: <asp:Label ID="lastNameLabel" runat="server" Text='<%# Bind("lastName") %>' /> <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit" /> </ItemTemplate> </asp:FormView> </ContentTemplate> </telerik:RadPanelItem> </Items> </telerik:RadPanelBar>Code behind:
protected void Page_Load(object sender, EventArgs e){ RadPanelBar1.Items[0].Visible = RadPanelBar1.Items[0].Enabled =false;}