Skip to main content
added 264 characters in body
Source Link
Steve B
  • 7.5k
  • 9
  • 53
  • 110
function ShowLightBox(pageUrl, lightBoxTitle, moreOptions){options ={url: pageUrl,autoSize: true,title: lightBoxTitle}SP.UI.ModalDialog.showModalDialog(options);yPos = $(window.parent.document).scrollTop() + 20;$(".ms-dlgContent", window.parent.document).css({ position: 'fixed', top: yPos});}

<telerik:RadComboBox ID="rcActions" runat="server" DataTextField="Key" DataValueField="Value"> </telerik:RadComboBox> <asp:Button ID="btnGo" runat="server" Text="GO" OnClick="btnGo_OnClick" />

<script language="javascript" type="text/javascript">
function ShowLightBox(pageUrl, lightBoxTitle, moreOptions) {
    options = {
        url: pageUrl,
        autoSize: true,
        title: lightBoxTitle
    }
    SP.UI.ModalDialog.showModalDialog(options);
    yPos = $(window.parent.document).scrollTop() + 20;
    $(".ms-dlgContent", window.parent.document).css({ position: 'fixed', top: yPos });
}
</script>


<telerik:RadComboBox ID="rcActions" runat="server" 
            DataTextField="Key" DataValueField="Value">
        </telerik:RadComboBox>
        <asp:Button ID="btnGo" runat="server" Text="GO" OnClick="btnGo_OnClick" />

    <telerik:RadGrid ID="radGrid1" runat="server" AutoGenerateColumns="false" AllowPaging="true" OnNeedDataSource="radGrid1_OnNeedDataSource"    OnItemCommand="radGrid1_ItemCommand" OnColumnCreated="radGrid1_OnColumnCreated"
        OnItemDataBound="radGrid1_OnItemDataBound">
        <MasterTableView AutoGenerateColumns="false" NoMasterRecordsText="<%$Resources:GlobalResource, noRecords%>">
            <Columns>
                <telerik:GridBoundColumn DataField="Id" UniqueName="Id" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="UnitNumber" UniqueName="UnitNumber" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridClientSelectColumn UniqueName="Selected">
                </telerik:GridClientSelectColumn>
            </Columns>
            <NestedViewSettings>
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="Id" MasterKeyField="Id" />
                </ParentTableRelation>
            </NestedViewSettings>
            <NestedViewTemplate>
                <asp:Panel runat="server" Visible="false" ID="InnerContainer">
                   <!-- Some code -->
                </asp:Panel>
            </NestedViewTemplate>
        </MasterTableView>
    </telerik:RadGrid>

This is the code behind


This is the code behind

    protected void btnGo_OnClick(object sender, EventArgs e)
        {
            try
            {
                var unitNumbers = new List<string>();
                foreach (GridItem unit in radGrid1.SelectedItems)
                {
                     var gridInfo = new GridInfo(unit);
                     unitNumbers.Add(gridInfo.UnitNumberCell.Text);
                }
                if (Session["UnitNumbers"] != null)
                     Session.Add("UnitNumbers", unitNumbers);
                 else
                    Session["UnitNumbers"] = unitNumbers;

                  // Here is where I want to put the code to open the lightbox, instead of       redirecting.
                  Response.Redirect("../Pages/MaintenanceDetails.aspx");
            }
            catch (Exception ex)
            {
                
            }
        }
function ShowLightBox(pageUrl, lightBoxTitle, moreOptions){options ={url: pageUrl,autoSize: true,title: lightBoxTitle}SP.UI.ModalDialog.showModalDialog(options);yPos = $(window.parent.document).scrollTop() + 20;$(".ms-dlgContent", window.parent.document).css({ position: 'fixed', top: yPos});}

<telerik:RadComboBox ID="rcActions" runat="server" DataTextField="Key" DataValueField="Value"> </telerik:RadComboBox> <asp:Button ID="btnGo" runat="server" Text="GO" OnClick="btnGo_OnClick" />

<telerik:RadGrid ID="radGrid1" runat="server" AutoGenerateColumns="false" AllowPaging="true" OnNeedDataSource="radGrid1_OnNeedDataSource"    OnItemCommand="radGrid1_ItemCommand" OnColumnCreated="radGrid1_OnColumnCreated"
    OnItemDataBound="radGrid1_OnItemDataBound">
    <MasterTableView AutoGenerateColumns="false" NoMasterRecordsText="<%$Resources:GlobalResource, noRecords%>">
        <Columns>
            <telerik:GridBoundColumn DataField="Id" UniqueName="Id" Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="UnitNumber" UniqueName="UnitNumber" Visible="false">
            </telerik:GridBoundColumn>
            <telerik:GridClientSelectColumn UniqueName="Selected">
            </telerik:GridClientSelectColumn>
        </Columns>
        <NestedViewSettings>
            <ParentTableRelation>
                <telerik:GridRelationFields DetailKeyField="Id" MasterKeyField="Id" />
            </ParentTableRelation>
        </NestedViewSettings>
        <NestedViewTemplate>
            <asp:Panel runat="server" Visible="false" ID="InnerContainer">
               <!-- Some code -->
            </asp:Panel>
        </NestedViewTemplate>
    </MasterTableView>
</telerik:RadGrid>

This is the code behind

protected void btnGo_OnClick(object sender, EventArgs e)
    {
        try
        {
            var unitNumbers = new List<string>();
            foreach (GridItem unit in radGrid1.SelectedItems)
            {
                 var gridInfo = new GridInfo(unit);
                 unitNumbers.Add(gridInfo.UnitNumberCell.Text);
            }
            if (Session["UnitNumbers"] != null)
                 Session.Add("UnitNumbers", unitNumbers);
             else
                Session["UnitNumbers"] = unitNumbers;

              // Here is where I want to put the code to open the lightbox, instead of       redirecting.
              Response.Redirect("../Pages/MaintenanceDetails.aspx");
        }
        catch (Exception ex)
        {
            
        }
    }
<script language="javascript" type="text/javascript">
function ShowLightBox(pageUrl, lightBoxTitle, moreOptions) {
    options = {
        url: pageUrl,
        autoSize: true,
        title: lightBoxTitle
    }
    SP.UI.ModalDialog.showModalDialog(options);
    yPos = $(window.parent.document).scrollTop() + 20;
    $(".ms-dlgContent", window.parent.document).css({ position: 'fixed', top: yPos });
}
</script>


<telerik:RadComboBox ID="rcActions" runat="server" 
            DataTextField="Key" DataValueField="Value">
        </telerik:RadComboBox>
        <asp:Button ID="btnGo" runat="server" Text="GO" OnClick="btnGo_OnClick" />

    <telerik:RadGrid ID="radGrid1" runat="server" AutoGenerateColumns="false" AllowPaging="true" OnNeedDataSource="radGrid1_OnNeedDataSource"    OnItemCommand="radGrid1_ItemCommand" OnColumnCreated="radGrid1_OnColumnCreated"
        OnItemDataBound="radGrid1_OnItemDataBound">
        <MasterTableView AutoGenerateColumns="false" NoMasterRecordsText="<%$Resources:GlobalResource, noRecords%>">
            <Columns>
                <telerik:GridBoundColumn DataField="Id" UniqueName="Id" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="UnitNumber" UniqueName="UnitNumber" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridClientSelectColumn UniqueName="Selected">
                </telerik:GridClientSelectColumn>
            </Columns>
            <NestedViewSettings>
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="Id" MasterKeyField="Id" />
                </ParentTableRelation>
            </NestedViewSettings>
            <NestedViewTemplate>
                <asp:Panel runat="server" Visible="false" ID="InnerContainer">
                   <!-- Some code -->
                </asp:Panel>
            </NestedViewTemplate>
        </MasterTableView>
    </telerik:RadGrid>

This is the code behind

    protected void btnGo_OnClick(object sender, EventArgs e)
        {
            try
            {
                var unitNumbers = new List<string>();
                foreach (GridItem unit in radGrid1.SelectedItems)
                {
                     var gridInfo = new GridInfo(unit);
                     unitNumbers.Add(gridInfo.UnitNumberCell.Text);
                }
                if (Session["UnitNumbers"] != null)
                     Session.Add("UnitNumbers", unitNumbers);
                 else
                    Session["UnitNumbers"] = unitNumbers;

                  // Here is where I want to put the code to open the lightbox, instead of       redirecting.
                  Response.Redirect("../Pages/MaintenanceDetails.aspx");
            }
            catch (Exception ex)
            {
                
            }
        }
added 1644 characters in body
Source Link
L C
  • 3
  • 1
  • 1
  • 3
added 1644 characters in body
Source Link
L C
  • 3
  • 1
  • 1
  • 3
function ShowLightBox(pageUrl, lightBoxTitle, moreOptions){options ={url: pageUrl,autoSize: true,title: lightBoxTitle}SP.UI.ModalDialog.showModalDialog(options);yPos = $(window.parent.document).scrollTop() + 20;$(".ms-dlgContent", window.parent.document).css({ position: 'fixed', top: yPos});}

This is the code behind

protected void btnGo_OnClick(object sender, EventArgs e)
    {
        try
        {
            var unitNumbers = new List<string>();
            foreach (GridItem unit in radGrid1.SelectedItems)
            {
                 var gridInfo = new GridInfo(unit);
                 unitNumbers.Add(gridInfo.UnitNumberCell.Text);
            }
            if (Session["UnitNumbers"] != null)
                 Session.Add("UnitNumbers", unitNumbers);
             else
                Session["UnitNumbers"] = unitNumbers;

              // Here is where I want to put the code to open the lightbox, instead of       redirecting.
              Response.Redirect("../Pages/MaintenanceDetails.aspx");
        }
        catch (Exception ex)
        {
            
        }
    }

I have tried using ScriptManager.RegisterStartupScript(GetType(),"hwa","ShowLightBox(param);",true); and it does not find the function.

Any other suggestion?

function ShowLightBox(pageUrl, lightBoxTitle, moreOptions){options ={url: pageUrl,autoSize: true,title: lightBoxTitle}SP.UI.ModalDialog.showModalDialog(options);yPos = $(window.parent.document).scrollTop() + 20;$(".ms-dlgContent", window.parent.document).css({ position: 'fixed', top: yPos});}

This is the code behind

protected void btnGo_OnClick(object sender, EventArgs e)
    {
        try
        {
            var unitNumbers = new List<string>();
            foreach (GridItem unit in radGrid1.SelectedItems)
            {
                 var gridInfo = new GridInfo(unit);
                 unitNumbers.Add(gridInfo.UnitNumberCell.Text);
            }
            if (Session["UnitNumbers"] != null)
                 Session.Add("UnitNumbers", unitNumbers);
             else
                Session["UnitNumbers"] = unitNumbers;

              // Here is where I want to put the code to open the lightbox, instead of       redirecting.
              Response.Redirect("../Pages/MaintenanceDetails.aspx");
        }
        catch (Exception ex)
        {
            
        }
    }

I have tried using ScriptManager.RegisterStartupScript(GetType(),"hwa","ShowLightBox(param);",true); and it does not find the function.

Any other suggestion?

added 1644 characters in body
Source Link
L C
  • 3
  • 1
  • 1
  • 3
Loading
Source Link
L C
  • 3
  • 1
  • 1
  • 3
Loading