This is a migrated thread and some comments may be shown as answers.

RadWindow Through RadGrid and RadPanelBar

7 Answers 141 Views
Window
This is a migrated thread and some comments may be shown as answers.
Allan
Top achievements
Rank 1
Allan asked on 28 Jul 2009, 01:29 PM
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>

7 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 29 Jul 2009, 01:34 PM
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.
0
Allan
Top achievements
Rank 1
answered on 29 Jul 2009, 02:19 PM
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
0
Svetlina Anati
Telerik team
answered on 29 Jul 2009, 02:46 PM

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.
0
Allan
Top achievements
Rank 1
answered on 31 Jul 2009, 11:04 AM
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
0
Svetlina Anati
Telerik team
answered on 03 Aug 2009, 02:46 PM
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.
0
Ram
Top achievements
Rank 1
answered on 10 Aug 2011, 04:40 PM
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.
0
Marin Bratanov
Telerik team
answered on 12 Aug 2011, 11:29 AM
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.

Tags
Window
Asked by
Allan
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Allan
Top achievements
Rank 1
Ram
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or