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

Include control before DetailTables

3 Answers 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Billy
Top achievements
Rank 2
Billy asked on 23 Nov 2010, 10:04 PM
Is there a way to include a control (a link) right above the details table when expanding a row? Hopefully the code below explains this a little better:

<telerik:RadGrid ID="RadGrid2" runat="server" ShowStatusBar="true" AutoGenerateColumns="False" AllowSorting="True" skin="Windows7">
        <MasterTableView DataKeyNames="DepartmentID">
 
            <%--I want to put a link here--%>
 
            <DetailTables>
                <telerik:GridTableView Name="DetailsGrid">
                    <Columns>
                        <telerik:GridBoundColumn SortExpression="PersonName" HeaderText="Person Name" DataField="PersonName"></telerik:GridBoundColumn>
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridBoundColumn SortExpression="DepartmentName" HeaderText="Department Name" DataField="DepartmentName"></telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 24 Nov 2010, 12:42 PM
Hello,


If you need the link right above each detail table, then the better option is adding the control in CommandItemTemplate of 'GridTableView'.
aspx:
<DetailTables>
      <telerik:GridTableView HierarchyDefaultExpanded="true"
            DataKeyNames="OrderID" . . .  Width="100%" runat="server">
        <CommandItemTemplate>
               <%--link goes here--%>
        </CommandItemTemplate>




-Shinu.
0
Vasil
Telerik team
answered on 24 Nov 2010, 01:20 PM
Hello Billy,

You can place the link in the CommandItem for your DetailTable. And also set the property CommandItemDisplay to"Top". This way it will be displayed above the records in the DetailTable.

<MasterTableView DataKeyNames="DepartmentID">
   <DetailTables>
      <telerik:GridTableView Name="DetailsGrid" CommandItemDisplay="Top">
         <CommandItemTemplate>
            <asp:LinkButton runat="server" ID="MyLinkButton" Text="This is simple link"></asp:LinkButton>
         </CommandItemTemplate>
         <Columns>
            <telerik:GridBoundColumn SortExpression="PersonName" HeaderText="Person Name" DataField="PersonName"></telerik:GridBoundColumn>
         </Columns>
      </telerik:GridTableView>
   </DetailTables>

Kind regards,
Vasil
the Telerik team
Browse the vast support resources we have to jumpstart 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.
0
Billy
Top achievements
Rank 2
answered on 24 Nov 2010, 02:43 PM
This worked, thank you both!
Tags
Grid
Asked by
Billy
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
Vasil
Telerik team
Billy
Top achievements
Rank 2
Share this question
or