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

RadGrid MasterTable CommandItemTemplate is not working

1 Answer 186 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dayanithy
Top achievements
Rank 1
Dayanithy asked on 15 Nov 2011, 08:12 PM
HI,

I have a Radgrid(ASP.NET Ajax) with MasterTable and DetailTables.
I have given CommandItemTemplate in MasterTableView. Below is just the part of my code.

 

<telerik:RadGrid runat="server" ID="rgSurvey" AutoGenerateColumns="false" ShowStatusBar="true"

 

 

AllowAutomaticInserts="false" Skin="Outlook" OnItemCommand="rgSurvey_ItemCommand"

 

 

OnPreRender="rgSurvey_PreRender">

 

 

<MasterTableView DataKeyNames="SurveyID" SkinID="Outlook" Width="100%" CommandItemDisplay="Top"

 

 

Name="Survey">
<DetailTables>

 

 

<telerik:GridRelationFields DetailKeyField="SurveyID" MasterKeyField="SurveyID" />

 

 

</ParentTableRelation>

 

 

<CommandItemTemplate>

 

 

<asp:LinkButton ID="lnkAddstaff" runat="server" Text="Add Staff to Survey" CommandName="Popup"></asp:LinkButton>

 

 

</CommandItemTemplate>

 

</telerik:GridTableView>

 

 

</DetailTables>

 

 

<CommandItemTemplate>

 

 

<asp:LinkButton ID="lnkAdd" runat="server" Text="ADD" CommandName="Insert"></asp:LinkButton>

 

 

</CommandItemTemplate>


The CommandItemTemplate [CommandName="Insert"] inside the MAsterTableView is not working.. But the CommandItemTemplate inside DetailTables is working. Not sure why this is happening.

We have a asp.net Master page and Content page(Default.aspx). When using the RadGrid without a master page its working fine.
Are they any known issues when using RadGrid and MAsterTableView inside an asp.net Content page?

Regards,
Dayanithy

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Nov 2011, 06:12 AM
Hello Dayanithy,

I have tried the same scenario. Here is the sample code that I tried which worked as expected.
aspx:
<telerik:RadGrid runat="server" ID="RadGrid2" AutoGenerateColumns="false">
  <MasterTableView CommandItemDisplay="Top">
     <CommandItemTemplate>
        <asp:LinkButton ID="lnkAddstaff" runat="server" Text="Add Staff to Survey" CommandName="Popup"></asp:LinkButton>
     </CommandItemTemplate>
       <DetailTables>
           <telerik:GridTableView CommandItemDisplay="Top">
            <CommandItemTemplate>
                <asp:LinkButton ID="lnkAdd" runat="server" Text="ADD" CommandName="Insert"></asp:LinkButton>
            </CommandItemTemplate>
           </telerik:GridTableView>
       </DetailTables>
</telerik:RadGrid>

-Shinu.
Tags
Grid
Asked by
Dayanithy
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or