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

Newbie - no Add New Record

2 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Elliott
Top achievements
Rank 2
Elliott asked on 24 May 2010, 08:45 PM
Hi, it's my first go at Telerik controls.  Can't seem to get the Add New Record to show anywhere.  I'm working in Visual Studio 2010, .NET 4.0, Windows 7 and am using what is available for download as a trial.

snippets from my aspx file:

    <telerik:RadGrid ID="rgDealerMaintenance" AutoGenerateColumns="False"
        AllowAutomaticInserts="True" GridLines="None" ShowFooter="true" runat="server" >
    <MasterTableView EditMode="InPlace" DataKeyNames="RegistrationID" HeaderStyle-CssClass="body_text_black_BOLD">
    <CommandItemSettings AddNewRecordImageUrl="Images/AddRecord.gif" AddNewRecordText="Add New" />
    <Columns>
        <telerik:GridBoundColumn DataField="RegistrationID" Visible="false" />
        <telerik:GridBoundColumn UniqueName="txtFirstName" DataField="FirstName" HeaderText="First Name">
        </telerik:GridBoundColumn>
...
        <telerik:GridEditCommandColumn EditText="Edit" UniqueName="EditCommandColumn" UpdateText="Update" CancelText="Cancel" HeaderText="Edit">
        </telerik:GridEditCommandColumn>
        <telerik:GridButtonColumn CommandName="Delete" Text="Delete" HeaderText="Delete">
        </telerik:GridButtonColumn>
    </Columns>
    </MasterTableView>
    </telerik:RadGrid>
the ShowFooter shows the footer, but doesn't put anything in it
what am I missing?

I don't want to put the add into the edit button - I am working with an application which contains an already written program which keeps the add and update separate and want to be consistant

Marianne Seggerman


2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 25 May 2010, 05:51 AM
Hello Marianne,

From your code I can see that you missed setting CommandItemDisplay property.

        In order to enable the CommandItem you need to use the CommandItemDisplay property of the MasterTableView of RadGrid. Then the "Add New Record" button will be automatically placed in the CommandItem. And you can choose appropriate position for the CommandItem.

Aspx:
 <MasterTableView EditMode="InPlace" DataKeyNames="EmployeeID" CommandItemDisplay="Top">

Regards,
Shinu.
0
Elliott
Top achievements
Rank 2
answered on 25 May 2010, 01:48 PM
Thanks so much
it did the trick
mark as resolved
Tags
Grid
Asked by
Elliott
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 1
Elliott
Top achievements
Rank 2
Share this question
or