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

No 'Add new record' button

2 Answers 352 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rhesa-Moile
Top achievements
Rank 1
Rhesa-Moile asked on 23 Feb 2009, 11:10 AM
Hello,

For some reason the 'add new record' button does not allways apears in my radgrid. I did not have one in the maingrid before untill I copied some old grid and hooked it up with the new data. But now I still can get the button to apear in the subgrid. I really dont have clue what im doing wrong, anyone has the awnser for me?

THANX

----

        <telerik:RadGrid    ID="grdCategories"
                            runat="server"
                            AllowAutomaticInserts="True"
                            AllowAutomaticDeletes="True"
                            AllowAutomaticUpdates="True"
                            DataKeyNames="id"
                            EnableAJAX="false"
                            ShowStatusBar="True"
                            AutoGenerateDeleteColumn="True"
                            AutoGenerateEditColumn="True"
                            MasterTableView-EditMode="EditForms"
                            DataSourceID="dataCategories"
                            GridLines="None"
                            Skin="WebBlue"
                            AllowPaging="True"
                            AllowSorting="True" PageSize="5">

    <HeaderContextMenu Skin="WebBlue" EnableTheming="True">
    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
    </HeaderContextMenu>

            <PagerStyle Mode="NextPrevAndNumeric" />

            <MasterTableView    autogeneratecolumns="False"
                                InsertItemDisplay="Bottom"
                                CommandItemDisplay="Bottom"
                                datasourceid="dataCategories"
                                DataKeyNames="id" ShowFooter="True">
                <DetailTables>
                    <telerik:GridTableView  runat="server"
                                            DataKeyNames="id"
                                            DataSourceID="dataSubcategories"
                                            AllowAutomaticDeletes="true"
                                            AllowAutomaticInserts="true"
                                            AllowAutomaticUpdates="true"
                                            AllowFilteringByColumn="True"
                                            MasterTableView-EditMode="EditForms"
                                            AllowSorting="False"
                                            AutoGenerateColumns="False"
                                            InsertItemPageIndexAction="ShowItemOnFirstPage">
                        <DetailTables>
                            <telerik:GridTableView  runat="server"
                                                    DataSourceID="dataFeatures"
                                                    DataKeyNames="id"
                                                    AllowFilteringByColumn="True"
                                                    InsertItemDisplay="Bottom"
                                                    AllowSorting="False" >
                                <parenttablerelation>
                                    <telerik:GridRelationFields DetailKeyField="subcatid" MasterKeyField="id" />
                                </parenttablerelation>
                                <rowindicatorcolumn>
                                    <HeaderStyle Width="20px" />
                                </rowindicatorcolumn>
                                <expandcollapsecolumn>
                                    <HeaderStyle Width="20px" />
                                </expandcollapsecolumn>
                            </telerik:GridTableView>
                        </DetailTables>
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="catid" MasterKeyField="id" />
                        </ParentTableRelation>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn Visible="True">
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridBoundColumn DataField="subcategory" UniqueName="column">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn Visible="True">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn    DataField="name"
                                                HeaderText="name"
                                                SortExpression="name"
                                                UniqueName="name" />
                </Columns>
            </MasterTableView>

<FilterMenu Skin="WebBlue" EnableTheming="True">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
</FilterMenu>
        </telerik:RadGrid>

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Feb 2009, 11:40 AM
Hello,

Try setting the CommandItemDisplay property of the DetailTable as shown below:
aspx:
<DetailTables>  
  <telerik:GridTableView  runat="server"  
    DataKeyNames="id"  
    DataSourceID="dataSubcategories"  
    CommandItemDisplay="Bottom"  
    AllowAutomaticDeletes="true"  
    AllowAutomaticInserts="true"  
    AllowAutomaticUpdates="true"  
    AllowFilteringByColumn="True"  
    MasterTableView-EditMode="EditForms"  
    AllowSorting="False"  
    AutoGenerateColumns="False"  
      
    InsertItemPageIndexAction="ShowItemOnFirstPage">  

Thanks
Princy
0
Daniel
Telerik team
answered on 23 Feb 2009, 12:13 PM
Rhesa-Moile Giebels,

There are detailed articles about CommandItem in our documentation:
CommandItem Overview
Command item template

Regards,
Daniel
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.
Tags
Grid
Asked by
Rhesa-Moile
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Daniel
Telerik team
Share this question
or