带有模态窗口的 AspxGridView,

发布于 2024-09-07 21:18:32 字数 1440 浏览 2 评论 0原文

我有一个 AspxGridView,当我双击一行时,它会显示一个模式窗口。我想要做的是将一列的值发送到位于 ModalWindow 的 AspxLabel。但我无法做到这一点,在 gridview 中我使用 ClientSideEvents RowDblClick 来获取行值。这是代码:

GridView:

<dxwgv:ASPxGridView ID="gw_Parameters" runat="server" 

        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 

        AutoGenerateColumns="False" ClientInstanceName="grid" 

        OnCustomDataCallback="gw_Parameters_CustomDataCallback">

        <ClientSideEvents RowDblClick="function(s, e) {

    grid.GetValuesOnCustomCallback(e.visibleIndex, ShowModalWindow())

}" />

脚本:

function ShowModalWindow(val)

    {

        pcc_Question.Show();

        lblCQuestionText.SetText(val);

    }

和 c#:

protected void gw_Parameters_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)

        {

            int visibleIndex = Convert.ToInt32(e.Parameters);

            string fieldName = string.Empty;



            if (gw_Parameters.VisibleColumns[0] is GridViewCommandColumn)

                fieldName = ((GridViewDataColumn)gw_Parameters.VisibleColumns[3]).FieldName;

            else

                fieldName = ((GridViewDataColumn)gw_Parameters.VisibleColumns[2]).FieldName;



            e.Result = gw_Parameters.GetRowValues(visibleIndex, fieldName);



        }

感谢您的帮助,

Mehmet Şerif Tozlu

I have a AspxGridView and when i double click to a row, it shows a modal window. What i want to do is, send one columns' value to a AspxLabel which is at ModalWindow. But i couldn't manage to do it, in gridview i use ClientSideEvents RowDblClick to get row value. Here is the code:

GridView:

<dxwgv:ASPxGridView ID="gw_Parameters" runat="server" 

        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 

        AutoGenerateColumns="False" ClientInstanceName="grid" 

        OnCustomDataCallback="gw_Parameters_CustomDataCallback">

        <ClientSideEvents RowDblClick="function(s, e) {

    grid.GetValuesOnCustomCallback(e.visibleIndex, ShowModalWindow())

}" />

Script:

function ShowModalWindow(val)

    {

        pcc_Question.Show();

        lblCQuestionText.SetText(val);

    }

And c#:

protected void gw_Parameters_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)

        {

            int visibleIndex = Convert.ToInt32(e.Parameters);

            string fieldName = string.Empty;



            if (gw_Parameters.VisibleColumns[0] is GridViewCommandColumn)

                fieldName = ((GridViewDataColumn)gw_Parameters.VisibleColumns[3]).FieldName;

            else

                fieldName = ((GridViewDataColumn)gw_Parameters.VisibleColumns[2]).FieldName;



            e.Result = gw_Parameters.GetRowValues(visibleIndex, fieldName);



        }

Thanks for the help,

Mehmet Şerif Tozlu

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

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

发布评论

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

评论(2

冰之心 2024-09-14 21:18:32

您的代码看起来正确并且应该可以工作。我建议您在 gw_Parameters_CustomDataCallback 方法中设置断点并检查 e.Result 值。另外,根据您的代码,lblCQuestionText 是位于 PopupControl 中的标签的 ClientInstanceName 属性。这是真的吗?

Your code looks correct and should work. I suggest that you set the breakpoint in the gw_Parameters_CustomDataCallback method and check the e.Result value. Also, according to your code, the lblCQuestionText is the ClientInstanceName property of the label residing in the PopupControl. Is it true?

缪败 2024-09-14 21:18:32

Mehmet,

请尝试此处的结果有几个例子。

Mehmet,

Try the results here which has several examples.

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