Forums

ASPXGridview - Popupcontrol didn't show after opening the Detailrow - is it a Bug?

Last post 2/9/2010 5:13 AM by Timo Scholz. 0 replies.
Sort Posts: Previous Next
  • Timo Scholz

    ASPXGridview - Popupcontrol didn't show after opening the Detailrow - is it a Bug?

    2/9/2010 5:13 AM
    • Not Ranked
    • Joined on 9/2/2009
    • Posts 6

    Hello,

    i am using a PopupControl in a Column of a ASPXGridview.

    It is running fine, as long as i didn't expand the Detailrow. After i expand and close the Detailrow, the popup throws a Javascripit-Exception "Element is null" in Line 8 ( this.GetMainElement() is in this Line and returns null ) and the Popup will not show.

     

    DevExpress-Version = 9.3.2

    .Net-Version = 3.5

     

    Thanks for ur Help

     

     

     

     

     

     

    -----------------------------------------

     

     

    It was a Error in my Code.

    The Popup in the Gridview and in the Detailrow had the same ID

     

     

     

     

     

     

     

     Javascript-Code for the Exception:

    ------------------------------------------------------------------------------------

    ASPxClientCallbackPanel = _aspxCreateClass(ASPxClientControl, {
    constructor: function(name) {
    this.constructor.prototype.constructor.call(this, name);
    this.allowMultipleCallbacks = false;
    },
    GetContentElement: function() {
    var element = this.GetMainElement(); <------------------------------------------------------------------------------- This returns Null
    return element.tagName == "TABLE" ? element.rows[0].cells[0] : element; <------------------------------ This throws the Exception, because Element is NULL
    },
    OnCallback: function(result) {
    _aspxSetInnerHtml(this.GetContentElement(), result);
    },
    DoBeginCallback: function(command){
    ASPxClientControl.prototype.DoBeginCallback.call(this, command);
    this.ShowLoadingPanel();
    },
    ShowLoadingPanel: function(){
    var element = this.GetContentElement();
    var mainElement = (element.tagName == "TD") ? this.GetMainElement() : element;
    var elementWidth = mainElement.style.width;
    var elementHeight = mainElement.style.height;
    var div = this.CreateLoadingDiv(element);
    if(div == null)
    element.innerHTML = "";
    if(div != null) {
    this.CreateLoadingPanelWithAbsolutePosition(element, mainElement);
    } else {
    if(elementWidth != "" && elementHeight != "")
    this.CreateLoadingPanelWithAbsolutePosition(element, mainElement);
    else
    this.CreateLoadingPanelInsideContainer(element);
    }
    },
    PerformCallback: function(parameter) {
    this.CreateCallback(parameter);
    }
    });

    --------------------------------


    ASPX-Code

    Popupcontrol:

    ---------
    <dxpc:ASPxPopupControl ID="popup" ClientInstanceName="popup" runat="server"
    AllowDragging="True" PopupHorizontalAlign="OutsideRight" HeaderText="Notiz"
    CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua"
    SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css">
    <ContentStyle VerticalAlign="Top">
    </ContentStyle>
    <ContentCollection><dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
    <dxcp:ASPxCallbackPanel ID="cpPopup" ClientInstanceName="cpPopup" runat="server" Width="320px" OnCallback="cpPopup_Callback">
    <PanelCollection>
    <dxp:PanelContent ID="PanelContent1" runat="server">
    <asp:Label ID="lblComment" runat="server" />
    </dxp:PanelContent>
    </PanelCollection>
    </dxcp:ASPxCallbackPanel>
    </dxpc:PopupControlContentControl></ContentCollection>
    </dxpc:ASPxPopupControl>

    ------

    GridciewColumn:

    <dxwgv:GridViewDataTextColumn FieldName="noteForForwardingCompany" VisibleIndex="17" Caption="Info S">
    <EditFormSettings Visible="True" />
    <DataItemTemplate>
    <%#getCommentPopUpLink("popup", "cpPopup", Container.KeyValue, 2, Eval("noteForForwardingCompany"), "mehr ...")%>
    </DataItemTemplate>
    </dxwgv:GridViewDataTextColumn>

    --------------------------------
    Codebehind:


    Protected Function getCommentPopUpLink(ByVal popupIDName As String, ByVal popupClientName As String, ByVal keyObj As Object, ByVal commentID As Integer, ByVal commentObj As Object, ByVal text As String) As String
    Dim result As String = "&nbsp;"


    If (Not String.IsNullOrEmpty(CStr(commentObj))) Then
    'Der Parameterstring, der im Callbackereigniss ausgewertet wird. Er besteht aus dem PrimaryKey der Zeile und einer ID zur selectierung des richtigen Comments
    Dim parameter As String = CLng(keyObj) & "-" & commentID

    'Der Commentar kann inicht direkt übergeben werden, da die SOnderzeichen im Kommentar ggf. Probleme verursachen
    ''Der Parameterstring, der im Callbackereigniss ausgewertet wird. Er besteht aus dem PrimaryKey der Zeile und dem Kommentar
    'Dim parameter As String = CLng(keyObj) & "-" & commentObj.ToString

    Dim jsFunction As String = popupIDName & ".ShowAtElement(this);" & popupClientName & ".PerformCallback('" & parameter & "');"
    result = "<a href='BLOCKED SCRIPTvoid(0);' onclick=" & jsFunction & ">" & text & "</a>"
    End If

    Return result
    End Function



    Protected Sub cpPopup_Callback(ByVal source As Object, ByVal e As DevExpress.Web.ASPxClasses.CallbackEventArgsBase)
    .....
    End Sub





    .

     

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.