开发者

AspxGridView with a modal window,

开发者 https://www.devze.com 2023-01-05 22:58 出处:网络
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,

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);



 开发者_JAVA百科       }

Thanks for the help,

Mehmet Şerif Tozlu


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?


Mehmet,

Try the results here which has several examples.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号