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

Add New button centered, perform command insert on click

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
LJZIMMERMAN
Top achievements
Rank 1
LJZIMMERMAN asked on 29 Sep 2016, 03:01 PM

I want to customize the add new button, centering it on the grid but also having the same functionality as the normal built in Add New button.

Here is the code I have so far:

<CommandItemSettings ShowAddNewRecordButton="False" />
<CommandItemSettings ShowRefreshButton="false" />
<CommandItemTemplate>
    <div id="divCenter" style="text-align: center">
    <asp:LinkButton ID="btnAddNew" Text="Add New" CommandName="Insert" runat="server"></asp:LinkButton>
</div>
</CommandItemTemplate>

The problem is the Insert command only makes the screen flash and doesn't open the Add New dialog.

Can you help?

1 Answer, 1 is accepted

Sort by
0
LJZIMMERMAN
Top achievements
Rank 1
answered on 29 Sep 2016, 05:39 PM
I figured this one out. Rather than have the CommandName="Insert", it is required to be CommandName="InitInsert"
Tags
Grid
Asked by
LJZIMMERMAN
Top achievements
Rank 1
Answers by
LJZIMMERMAN
Top achievements
Rank 1
Share this question
or