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

Open RadOpen from RadGrid

2 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RW
Top achievements
Rank 1
RW asked on 30 Jul 2010, 09:02 PM
I should preface this by saying I just inherited a website that uses Telerik and, well, I've never used them before, so please bear with me. Also, this site doesn't use any code behind pages...nothing I can do about that, so it might complicate some of your suggestions.

Anyway, I have a radgrid that is displaying user suggested features, and in the last column there is a GridHyperLinkColumn that links to a new page displaying more details on the feature request. Since any filtering or paging that has taken place gets wiped out upon going to that details page, I'd like to invoke a RadOpen call to display the details in a new window.

But, I can't seem to make that happen. How do you call a function from a RadGrid???

Here is the current RadGrid on the site (for what it's worth):

 

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
        DataSourceID="SqlDataSource1" GridLines=None Skin="WebBlue" PageSize="50" Width=100
        AllowFilteringByColumn=true ShowGroupPanel="True">
        <HeaderContextMenu EnableTheming="True" Skin="WebBlue">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </HeaderContextMenu>
        <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowDragToGroup="True">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <MasterTableView GroupLoadMode=Client AutoGenerateColumns="False" DataKeyNames="pkRequestID" AllowMultiColumnSorting="True" DataSourceID="SqlDataSource1">
            <Columns>
                <telerik:GridBoundColumn  DataField="pkRequestID" HeaderText="ID" SortExpression="pkRequestID"
                    UniqueName="pkRequestID" FilterControlWidth="20px">
                    <HeaderStyle Width="5%" />
                       
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  DataField="strTitle" HeaderText="Title" SortExpression="strTitle"
                    UniqueName="strTitle">
                    <HeaderStyle Width="50%" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="fullName" HeaderText="Submitted By" SortExpression="fullName"
                    UniqueName="fullName">
                    <HeaderStyle Width="15%" />
                </telerik:GridBoundColumn>
                <telerik:GridDateTimeColumn DataField="dteDate" HeaderText="Added" SortExpression="dteDate"
                    UniqueName="dteDate" DataFormatString="{0:MM/d/yy}">
                    <HeaderStyle Width="10%" HorizontalAlign=Center    />
                    <ItemStyle HorizontalAlign=Center />
                </telerik:GridDateTimeColumn>
                  
                <telerik:GridBoundColumn DataField="strStatus" HeaderText="Status" SortExpression="strStatus"
                    UniqueName="strStatus">
                     <HeaderStyle Width="10%" HorizontalAlign=Center  />
                     <ItemStyle HorizontalAlign=Center />
                </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="votes" HeaderText="Votes" SortExpression="votes"
                    UniqueName="votes" FilterControlWidth="20px">
                     <HeaderStyle Width="5%" HorizontalAlign=Center  />
                     <ItemStyle HorizontalAlign=Center />
                </telerik:GridBoundColumn>
                  
                <telerik:GridBoundColumn DataField="comments" HeaderText="Comments" SortExpression="comments"
                    UniqueName="comments" FilterControlWidth="20px">
                     <HeaderStyle Width="5%" HorizontalAlign=Center  />
                     <ItemStyle HorizontalAlign=Center />
                </telerik:GridBoundColumn>
                  
                <telerik:GridHyperLinkColumn AllowFiltering=False   
                DataTextFormatString="{0}"
                        DataNavigateUrlFields="pkRequestID" Text="Details"  
                        UniqueName="pkRequestID" 
                        DataNavigateUrlFormatString="/portal/technical/requests/view.aspx?lpi={0}">
                        <HeaderStyle Width="5%" HorizontalAlign=Center  />
                </telerik:GridHyperLinkColumn>
            </Columns>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
        </MasterTableView>
          
        <PagerStyle Mode=NextPrevNumericAndAdvanced Position="TopAndBottom" />
    </telerik:RadGrid>

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 02 Aug 2010, 01:38 PM
Hello,

One suggestion is using GridTemplateColumn with HyperLink  in ItemTemplate. And atatch the onclick handler to HyperLink from code behind, in ItemDataBound event.

Here is the demo which shows how to implement this : Window Editing


Now in the new window, show the details based on the passed parameter.

Thanks,
Princy.
0
RW
Top achievements
Rank 1
answered on 06 Aug 2010, 07:25 PM
That worked perfectly. Thanks Princy!
Tags
Grid
Asked by
RW
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
RW
Top achievements
Rank 1
Share this question
or