views:

34

answers:

2

Hi,

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

A: 

Mehmet,

Try the results here which has several examples.

Mehul
A: 

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?

DevExpress Team
<ClientSideEvents RowDblClick="function(s, e) { grid.GetValuesOnCustomCallback(e.visibleIndex, ShowModalWindow())}" />in here instead of "ShowModalWindow()", i should use "ShowModalWindow". So i fixed the problem, thanks..
mehmetserif