RadWindow Through RadGrid and RadPanelBar

8 posts, 0 answers
  1. Allan
    Allan avatar
    3 posts
    Member since:
    Jun 2009

    Posted 28 Jul 2009 Link to this post

    Telerik,

    I am trying to access a cell in a radgrid while using that value as querystring parameter to open a radwindow.  The radgrid is contained in a radpanelbar.  Please let me know what I am doing wrong.

    Thanks,

    Al

    <%@ Page Language="C#" MasterPageFile="~/loggedin.master" AutoEventWireup="true"
        CodeFile="AdvancedSearch.aspx.cs" Inherits="AdvancedSearch" %>

    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
        function ViewClick(obj)
        {
            var grid = document.getElementById("<%=rpAdvancedSearch.FindItemByValue("GripsPanelItem").FindControl("pGrips").FindControl("rgGrips").ClientID %>");
            var master = grid.ClientID.get_masterTableView();
            var rowElement = obj.parentElement.parentElement;
            
            var cell = master._getCellByColumnUniqueNameFromTableRowElement(rowElement, "GripId");
            var id = cell.innerHTML;           
            var wnd = window.radopen("RequestiView.aspx?Id=" + id, null);         
        }
        </script>

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgGrips" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="rgGrips">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgGrips" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

        <telerik:RadPanelBar runat="server" ID="rpAdvancedSearch" ExpandMode="MultipleExpandedItems"
            Width="100%">
            <Items>
                <telerik:RadPanelItem Text="Grips" Value="Grips" Expanded="false">
                    <Items>
                        <telerik:RadPanelItem Value="GripsPanelItem">
                            <ItemTemplate>
                                <asp:Panel ID="pGrips" runat="server" Height="300px">
                                    <telerik:RadGrid ID="rgGrips" GridLines="None" runat="server" AutoGenerateColumns="False"
                                        ShowHeader="true" OnInit="rgGrips_Init" >
                                        <MasterTableView>
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="GripId" Visible="False" UniqueName="GripId">
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn UniqueName="gtcView" HeaderText="View">
                                                    <ItemTemplate>
                                                        <asp:LinkButton runat="server" ID="lbView" Text="View" OnClientClick="return ViewClick(this)" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:RadGrid>
                                </asp:Panel>
                            </ItemTemplate>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelBar>
        <telerik:RadWindowManager ID="Singleton" runat="server" Width="1100px" Height="750px"
            VisibleStatusbar="false" Behavior="Close,Move,Resize,Pin,Reload" Modal="true"
            Skin="Telerik" Style="z-index: 7001">
        </telerik:RadWindowManager>
    </asp:Content>
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 29 Jul 2009 Link to this post

    Hello Allan,

    Would you please describe what is teh result you get and the desired one? As far as I can see form your code there should not be problem in opening the RadWindow and it should open fine except in case you get a javascript error before teh radopen method. Would you please examien whetehr you by any chance get an error? If so, please provide its text message along with more detailed explanataions of the result.



    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Allan
    Allan avatar
    3 posts
    Member since:
    Jun 2009

    Posted 29 Jul 2009 Link to this post

    Svetlina,

    Than you for the reply.  I am getting a javascript error before the radopen call in the javascript method.  When I click on the LinkButton shown below, I get "Message: 'ClientID' is null or not an object".  I believe the problem lies in the code that gets a reference to the RadGrid.

    Thanks,

    Al
  4. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 29 Jul 2009 Link to this post

    Hello Allan,

    As far as I understand the scenario you want to achieve is the following one:

    http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

    I belive that the faster way to implement it is to use the provided online demo as a start point and to us ethe same approach if possible. If this apoproach does not work for you, provide more details why and we will think of another reasonable solution for the problem.

    On a side note, when you install RadControls, our online examples projects are automatically installed on your computer and you can not only examine their full source code, but also extend them further in order to meet your requirements.

    You can open the demos from here:

    Start\Programs\Telerik\RadControls for ASPNET AJAX\Open Sample WebSite In VisualStudio

    The actual location on your hard disk is the following one:

    C:\Program Files\Telerik\RadControls for ASPNET AJAX \Live Demos

    I hope that this information is helpful.

    Kind regards,

    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Allan
    Allan avatar
    3 posts
    Member since:
    Jun 2009

    Posted 31 Jul 2009 Link to this post

    Svetlina,

    Thank you.  The example worked for  me.  However, I have another question:

    How would I expand a RadPanelItem using a click event from a button contained in a RadAjaxManager control?

    Thanks,

    Al
  6. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 03 Aug 2009 Link to this post

    Hi Allan,

    I suggest to use the button's OnClientClick event and to expand the item by using its expand() method - all this can be done on teh client without a need of an ajax request to the server. More information about the expand method is available below:

    http://www.telerik.com/help/aspnet-ajax/panel_clientsideradpanelbaritem.html

    If you prefer to expand the item on the server, you can use its Expanded server property as explained below:

    http://www.telerik.com/help/aspnet-ajax/panel_itemsserversidecode.html

    Greetings,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Ram
    Ram avatar
    97 posts
    Member since:
    Jun 2011

    Posted 10 Aug 2011 Link to this post

    HI
    I'm using radcontrols in my asp.net website.
    And these controls visually and functionality wise nice.

    I have one scenario .
    I have radpanelbar with 4 panel items.
    each item contains one radgrid.
    Now I'm binding every grid with theie needdatasource event.
    My problem is suppose user select first item  can go through radgrid paging at pageindex 5 and if he collapse the current panlelitem and expand other and comes expand the previous one still he will see the radgrid with pageindex 5.
    So I want bind the grid while expand the panel item.

    Hope u understand my problem.

    please help me as early as possible.
  8. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4627 posts

    Posted 12 Aug 2011 Link to this post

    Hi Ram,

    This issue is not related to the RadWindow and I suggest that you post your questions in the correct section in the future, as this would help them get to the right people who would be able to better help you.

    As far as I understand your scenario you need to rebind the grid when you expand its panel. This can be done via an AJAX request in the OnClientItemExpand event of the RadPanelBar.


    All the best,
    Marin
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top