动态发生回发时如何设置选项卡索引radmultipage?
代码
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" OnTabClick="RadTabScript1_TabClick" OnClientTabSelecting="onTabSelecting" > <%-- OnClientTabSelecting="onTabSelecting"> --%>
<Tabs>
<telerik:RadTab Text="Resources" runat="server" TabIndex="0" Selected="true" PageViewID="radPageResources"></telerik:RadTab>
<telerik:RadTab Text="Tasks" runat="server" TabIndex="1" PageViewID="radPageTasks"></telerik:RadTab>
<telerik:RadTab Text="Messages" runat="server" TabIndex="2" PageViewID="radPageMessages"></telerik:RadTab>
<telerik:RadTab Text="Files" runat="server" TabIndex="3" PageViewID="radPageFiles"></telerik:RadTab>
<telerik:RadTab Text="Feedback" runat="server" TabIndex="4" PageViewID="radPageFeedback"></telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" OnPageViewCreated="RadMultiPage1_PageViewCreated" SelectedIndex="0" > <%-- RenderSelectedPageOnly="true" > --%>
<telerik:RadPageView ID="radPageResources" runat="server" TabIndex="0">
<telerik:RadGrid runat="server" ID="grdResource" PageSize="5" Skin="Default" AllowPaging="True"
AllowSorting="true" ShowFooter="true" AutoGenerateColumns="False" Width="97%"
OnItemCreated="grdResource_ItemCreated" OnNeedDataSource="grdResource_NeedDataSource"
OnDeleteCommand="grdResource_DeleteCommand" ShowStatusBar="True" GridLines="None"
OnItemDataBound="grdResource_ItemDataBound">
</telerik:RadGrid>
像这样,我有 4 个带有索引的综合浏览选项卡,每个综合浏览选项卡都包含一个网格。如果假设我在某些 x 网格中进行了更改并导致回发,那么我需要在之后显示 x 网格回发。但我正在显示资源网格。
代码隐藏,
protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
{
RadMultiPage1.SelectedIndex = e.PageView.TabIndex;
}
但该事件在任何情况下都不会触发。
那么即使发生回发,我怎样才能回到之前的网格呢?
Code
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" OnTabClick="RadTabScript1_TabClick" OnClientTabSelecting="onTabSelecting" > <%-- OnClientTabSelecting="onTabSelecting"> --%>
<Tabs>
<telerik:RadTab Text="Resources" runat="server" TabIndex="0" Selected="true" PageViewID="radPageResources"></telerik:RadTab>
<telerik:RadTab Text="Tasks" runat="server" TabIndex="1" PageViewID="radPageTasks"></telerik:RadTab>
<telerik:RadTab Text="Messages" runat="server" TabIndex="2" PageViewID="radPageMessages"></telerik:RadTab>
<telerik:RadTab Text="Files" runat="server" TabIndex="3" PageViewID="radPageFiles"></telerik:RadTab>
<telerik:RadTab Text="Feedback" runat="server" TabIndex="4" PageViewID="radPageFeedback"></telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" OnPageViewCreated="RadMultiPage1_PageViewCreated" SelectedIndex="0" > <%-- RenderSelectedPageOnly="true" > --%>
<telerik:RadPageView ID="radPageResources" runat="server" TabIndex="0">
<telerik:RadGrid runat="server" ID="grdResource" PageSize="5" Skin="Default" AllowPaging="True"
AllowSorting="true" ShowFooter="true" AutoGenerateColumns="False" Width="97%"
OnItemCreated="grdResource_ItemCreated" OnNeedDataSource="grdResource_NeedDataSource"
OnDeleteCommand="grdResource_DeleteCommand" ShowStatusBar="True" GridLines="None"
OnItemDataBound="grdResource_ItemDataBound">
</telerik:RadGrid>
Like this i have 4 pageview tabs with indexes and every pageview tab contains a grid.If suppose i did changes in some x-grid and causes postback,then i need the x-grid should be shown after the postback. But i was showing the Resourcegrid.
codebehind
protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
{
RadMultiPage1.SelectedIndex = e.PageView.TabIndex;
}
but this event not firing in any case.
so how can i come back to the previous grid even when postback occurs?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试在 page_prerender 中设置选定的索引。
try set selected index in page_prerender.
我不知道我的解决方案对这个主题是否有帮助
我尝试了所有方法,终于找到了自己的方法,
我建议如果您的问题没有解决,请制作java脚本函数,然后从代码后面调用它
我的示例:
然后在您的代码上创建函数来调用
我希望有用的功能
i don't know my solution can be helpful for this subject or not
I tried all methods and finally find myself method,
i suggest if your problem not solved make java script function and then call it from code behind
My Sample :
and then make function on your code to call that
I hope be useful