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

[Solved] Pass value back from a radgrid on selecting a row

1 Answer 129 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manjula
Top achievements
Rank 1
Manjula asked on 14 Aug 2013, 08:27 PM
I have a page from which a radwindow is opened. From this radwindow(win1), on click of a button another radwindow(win2) is opened which will have a radgrid which is populated from the database. Now, in this grid, I want to click a select link which will pass one of the column values to the radwindow that opened it(win1) and then close the second window(win2).  How do I go about with it?

This is how I open the first window:

 

   <div class="filterDiv">

                <telerik:RadButton ID="uxShowAdvancedSearch" runat="server" Text="Advanced Search" Skin="Sunset">

                   <Icon PrimaryIconCssClass="rbSearch" PrimaryIconLeft="4" PrimaryIconTop="4"></Icon>

                </telerik:RadButton>

                 <telerik:RadWindow runat="server" Animation="Resize" Behaviors="Close,Move" ClientIDMode="Inherit" ID="uxSearchPopup" RestrictionZoneID="ContentTemplateZone"

                    Modal="true" CenterIfModal="true" Title="Advanced Search" Width="600px" Left="100" Top="100">

                    <ContentTemplate>

                        <sc:AdvancedSearch runat="server" id="uxAdvancedSearch" />

                        <div>

                            <telerik:RadButton ID="uxSearch" Text="Search"  Skin="Sunset" runat="server" OnClick="uxSearch_Click"></telerik:RadButton>

                        </div>

                    </ContentTemplate>

                </telerik:RadWindow>

            <%---Javascript related to the RadWindow above---%>

               <div id="ContentTemplateZone">

                     <telerik:RadScriptBlock runat="server" ID="RadScriptBlockAdvancedSearchPopup">

                        <script type="text/javascript">

                            function openWinContentTemplate()

                            {

                                $find("<%=uxSearchPopup.ClientID %>").show();

                            }

                        </script>

                    </telerik:RadScriptBlock>

                </div>

            </div>

 

The user control AdvancedSearch has a panel to which other usercontrols of type SearchCriteria will be added dynamically. One of the SearchCriteria items will open up another radwindow on click of a button with this markup:

 

                        <asp:Panel ID="uxSponsorsPanel" runat="server" Visible="false">

                            <table>

                                <tr>

                                    <td><asp:TextBox ID = "uxSponsor" runat="server" Text="" /></td>

                                    <td>

                                        <telerik:RadButton ID="uxShowSponsorSearch" runat="server" Text="" Skin="Sunset">

                                           <Icon PrimaryIconCssClass="rbSearch"></Icon>

                                        </telerik:RadButton>

                                    </td>

                                </tr>

                            </table>

                        </asp:Panel>

                        <telerik:RadWindow runat="server" Animation="Resize" Behaviors="Close,Move" ClientIDMode="Inherit" ID="uxSponsorSearchPopup" RestrictionZoneID="ContentTemplateZone"

                        Modal="true" CenterIfModal="true" Title="Sponsor Search" Width="600px" Left="100" Top="100">

                            <ContentTemplate>

                                <sc:SponsorSearch runat="server" id="uxSponsorSearch" />

                                <div>

                                    <telerik:RadButton ID="uxSearch" Text="Search"  Skin="Sunset" runat="server"></telerik:RadButton>

                                </div>

                            </ContentTemplate>

                        </telerik:RadWindow>

                        <%---Javascript related to the RadWindow above---%>

                        <div id="ContentTemplateZone">

                                <telerik:RadScriptBlock runat="server" ID="RadScriptBlockAdvancedSearchPopup">

                                <script type="text/javascript">

                                    function openWinContentTemplate() {

                                        $find("<%=uxSponsorSearchPopup.ClientID %>").show();

                                    }

                                </script>

                            </telerik:RadScriptBlock>

                        </div>

The SponsorSearch control has this radgrid:

   <telerik:RadGrid runat="server" ID="uxSponsorList" OnNeedDataSource="uxSponsorList_NeedDataSource" AutoGenerateColumns="false" AllowPaging="true" AllowCustomPaging="true" PageSize="10"

                AllowSorting="true" AllowFilteringByColumn="true" OnItemCommand="uxSponsorList_ItemCommand" Skin="Sunset" >

                <MasterTableView IsFilterItemExpanded="false" EnableHeaderContextMenu="false" EnableHeaderContextAggregatesMenu="false" EnableHeaderContextFilterMenu="false" EnableLinqGrouping="false"

                CommandItemDisplay="Top" CommandItemStyle-BorderWidth="0px" CommandItemStyle-BorderStyle="None" DataKeyNames="ID">

                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>

                     <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />

               

                    <Columns>

                        <telerik:GridBoundColumn DataField="ID" HeaderText="ID" Visible="false" AllowSorting="false"></telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="SponsorName" HeaderText="Name" AllowSorting="true"></telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="SponsorType" Visible="true" HeaderText="Type" AllowSorting="true"></telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="SponsorAgencyClass" HeaderText="Agency Class" AllowSorting="true"></telerik:GridBoundColumn>

                    </Columns>

                </MasterTableView>

                <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>

        

            </telerik:RadGrid>

I want to have a select column in this grid which on clicking will pass the sponsor name of the selected row to the SearchCriteria control that called it and then close the window.

                       



 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 19 Aug 2013, 09:01 AM
Hello Manjula,

You have already got a respond to this query in your support ticket 726999. If new questions arise, I suggest you to continue our discussion on the mentioned ticket.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Manjula
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or