我可以将 RadGrid 添加到 NestedViewTemplate 吗

发布于 2024-10-03 03:24:37 字数 1229 浏览 0 评论 0原文

我目前正在使用 Visual Studio 2008 开发一个显示记录的分层网格,它有 3 个级别。代码大致如下所示。

<telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" RenderSelectedPageOnly="false">
<telerik:RadPageView ID="RadPageView1" runat="server">
    <telerik:RadGrid ID="radGrd1">
        <MasterTableView>
            <DetailTables>
                <telerik:GridTableView>
                    <NestedViewTemplate>
                        <telerik:RadMultiPage>
                            <telerik:RadPageView>
                                <%--add Radgrid Here--%>
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                    </NestedViewTemplate>
                </telerik:GridTableView>
            </DetailTables>
        </MasterTableView>
    </telerik:RadGrid>
</telerik:RadPageView>

我省略了所有代码,只提供了框架。

我遇到的问题是,当我添加 Radgrid 时,智能感知似乎没有拾取它,并且 Visual Studio 也没有将其添加到设计器类中。

我尝试在设计视图中查看它并强制它同步,甚至自己手动将其添加到设计器类中。这些解决方案并没有解决我的问题,因为尽管智能感知在手动添加后确实拾取了控件,但控件本身在运行时被设置为空。

所以基本上是否可以首先添加一个拉德网格,如果可以的话我做错了什么。

提前致谢

I am currently using Visual Studio 2008 to develop a hierarchical grid that displays records, its got 3 levels. The code looks roughly like this.

<telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" RenderSelectedPageOnly="false">
<telerik:RadPageView ID="RadPageView1" runat="server">
    <telerik:RadGrid ID="radGrd1">
        <MasterTableView>
            <DetailTables>
                <telerik:GridTableView>
                    <NestedViewTemplate>
                        <telerik:RadMultiPage>
                            <telerik:RadPageView>
                                <%--add Radgrid Here--%>
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                    </NestedViewTemplate>
                </telerik:GridTableView>
            </DetailTables>
        </MasterTableView>
    </telerik:RadGrid>
</telerik:RadPageView>

I have ommited all the code and just provided the skeleton.

The problem i am having is that when i add the Radgrid, the intellisense does not seem to pick it up and visual studio does not add it to the designer class either.

I have tried viewing it in design view and forcing it to sync and even manually added it to the designer class myself. These solutions have not solved my problem as although the intellisense does pick up the control after adding it manually, the control itself is set to null during run time.

So basically is it possible to add a rad grid in the first place and if so what am i doing wrong.

Thanks in Advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千仐 2024-10-10 03:24:37

事实证明,虽然该控件没有被添加到设计器类中并且没有显示在智能感知上,但它仍在创建中。

设法通过强制转换其事件之一抛出的对象来获取控件的句柄

RadGrid temp = (RadGrid)sender;

一点更新...在 telerik 中将控件添加到嵌套视图模板时,不可能以传统方式从后面的代码获取引用。这是因为嵌套视图模板中的所有内容都驻留在命名容器中。
单击此处了解更多信息。

Turns out that although the control is not being added to the designer class and is not showing up on intellisense, it is still being created.

Managed to get a handle on the control by casting the object thrown by one of its events

RadGrid temp = (RadGrid)sender;

A little update...When adding controls to a nested view template in telerik, it is impossible to obtain a reference in a traditional way from the code behind. this is because everything in a nested view template resides in a naming container.
click here for more information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文