Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
Adding Controls dynamically
posted

I'm trying to add one test control on the server side to my WebDialogWindow and am having no luck.  I'm handling the "showing" of the modal on a Row Command event from a grid view.  Here are the relavent bits:

 

{BUTTON on Grid}

    <asp:ImageButton ID="GridBtn"
    runat="server"
    CommandArgument='<%#Eval("MajorBrainstormID") %>'
    CommandName="display"
    ImageUrl="~/img/blankgrid.png" />

 {CODE}

    Public Sub BrainstormGrid_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles PriorityGrid.RowCommand
        If (e.CommandName = "display") Then
            Dim btn As New Label
            btn.Text = "test"

            Dim dialog As WebDialogWindow = TryCast(PriorityGridModal, WebDialogWindow)

            With dialog
                .ContentPane.Controls.Add(btn)
                .WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal
            End With

            gridUpdatePanel.Update()

        End If
    End Sub

 

 

{CONTROL on .aspx page}

        <asp:UpdatePanel runat="server" ID="gridUpdatePanel" UpdateMode="Conditional">
            <ContentTemplate>
                <ig:WebDialogWindow
                    ID="PriorityGridModal"
                    runat="server"
                    Height="300px"
                    Width="400px" Modal="True"
                    Moveable="true"
                    Top="0px"
                    Left="0px"
                    WindowState="Hidden"
                    CssClass="modalContainer"
                    >
                    <ContentPane>
                        <Template>
                                                                           
                        </Template>
                    </ContentPane>
                </ig:WebDialogWindow> 
            </ContentTemplate>
        </asp:UpdatePanel>

 

 

The DialogWindow displays just fine, but it is empty.  Can't seem to work out why.  I'm not getting any errors, and I've stepped through the execution and everything is firing as expected.  What am I missing?

Parents
  • 28464
    posted

    Hello,

    Thanks for the detailed description of the problem. I believe the solution here is to add controls to the TemplateControl object of the ContentPane, as opposed to the ContentPane directly. I have just tried this and it works great: 

            Label l = new Label();
            l.Text = "GGGGGG";
            WebDialogWindow1.ContentPane.TemplateControl.Controls.Add(l);

    Please, let me know if this helps. 

Reply Children
No Data