We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add new row above selected row in batch mode.

Thread ID:

Created:

Updated:

Platform:

Replies:

141497 Dec 14,2018 09:19 AM UTC Dec 17,2018 03:11 PM UTC ASP.NET Web Forms 1
loading
Tags: Grid
Athiwat
Asked On December 14, 2018 09:19 AM UTC

<ej:Grid ID="grdLines"
                                    runat='server'
                                    MinWidth="600"
                                    EnableTheming="true"
                                    IsResponsive="true"
                                    AllowScrolling="true"
                                    AllowSorting="false"
                                    AllowResizing="true"
                                    AllowPaging="false"
                                    EnableTouch="true"
                                    GridLines="None"
                                    AllowSelection="true"
                                    Selectiontype="Multiple"
                                    OnServerAddRow="grdLines_ServerAddRow"
                                    OnServerEditRow="grdLines_ServerEditRow"
                                    OnServerDeleteRow="grdLines_ServerDeleteRow">
                                    <Columns>
                                        <%--<ej:Column Type="checkbox" Width="10"></ej:Column>--%>
                                        <ej:Column HeaderText="ลำดับ" Field="LineNo" TextAlign="Left" DataType="Integer" Width="30" AllowEditing="false" IsPrimaryKey="true"></ej:Column>
                                        <ej:Column HeaderText="รหัสบัญชี" Field="AccountCode" TextAlign="Left" Width="100" AllowEditing="true" Visible="false"></ej:Column>
                                        <ej:Column HeaderText="บัญชี" Field="AccountNameTH" TextAlign="Left" Width="100" AllowEditing="true">
                                            <EditTemplate Create="create" Read="readAccount" Write="writeAccount" />
                                        </ej:Column>
                                        <ej:Column HeaderText="รายละเอียด" Field="Description" TextAlign="Left" Width="100" AllowEditing="true"></ej:Column>
                                        <ej:Column HeaderText="จำนวนเงินเดบิต" Field="DebitAmount" DataType="Decimal" TextAlign="Right" Width="50" AllowEditing="true" Format="{0:n2}">
                                            <EditTemplate Create="create" Read="readDebit" Write="writeDebit" />
                                        </ej:Column>
                                        <ej:Column HeaderText="จำนวนเงินเครดิต" Field="CreditAmount" DataType="Decimal" TextAlign="Right" Width="50" AllowEditing="true" Format="{0:n2}">
                                            <EditTemplate Create="create" Read="readCredit" Write="writeCredit" />
                                        </ej:Column>
                                        <ej:Column HeaderText="แผนก" Field="DivisionCode" TextAlign="Left" Width="50" AllowEditing="true" Visible="false"></ej:Column>
                                        <ej:Column HeaderText="แผนก" Field="DivisionNameTH" TextAlign="Left" Width="50" AllowEditing="true">
                                            <EditTemplate Create="create" Read="readDivision" Write="writeDivision" />
                                        </ej:Column>
                                        <ej:Column HeaderText="ฝ่าย" Field="DepartmentCode" TextAlign="Left" Width="50" AllowEditing="true" Visible="false"></ej:Column>
                                        <ej:Column HeaderText="ฝ่าย" Field="DepartmentNameTH" TextAlign="Left" Width="50" AllowEditing="true">
                                            <EditTemplate Create="create" Read="readDepartment" Write="writeDepartment" />
                                        </ej:Column>
                                        <ej:Column HeaderText="โครงการ" Field="ProjectCode" TextAlign="Left" Width="50" AllowEditing="true" Visible="false"></ej:Column>
                                        <ej:Column HeaderText="โครงการ" Field="ProjectNameTH" TextAlign="Left" Width="50" AllowEditing="true">
                                            <EditTemplate Create="create" Read="readProject" Write="writeProject" />
                                        </ej:Column>
                                        <ej:Column Field="VendorCustomerCode" Visible="false"></ej:Column>
                                    </Columns>
                                    <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True" EditMode="Batch"></EditSettings>
                                    <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>
                                    <KeySettings InsertRecord="118" EditRecord="119" SaveRequest="120" />
                                    <ScrollSettings
                                        Height="300"
                                        AutoHide="false"
                                        EnableTouchScroll="true" />
                                    <ClientSideEvents ActionComplete="Complete" RowSelected="RowSelect" DataBound="scrollGridToBottomWithCondition"></ClientSideEvents>
                                </ej:Grid>

Vignesh Natarajan [Syncfusion]
Replied On December 17, 2018 03:11 PM UTC

Hi Athiwat, 

Thanks for using Syncfusion support.  

Before proceeding with your query, we need some clarification regarding your requirement. So kindly share the following details 

  1. Do you want add the new record at specific index(above the selected index) while using batch edit mode? Because you have used Normal server events (AddRow, EditRow and DeleteRow instead of OnServerBatchEditRow).
  2.  Do you want to insert the record with default value in specific position or empty row?
  3. On saving the record do you want to save the record at same position? Because by default while saving, record will be added to index mentioned at server side.
  4. Kindly share more details regarding your requirement  and also why you want to add record at position before selected records.  

Regards, 
Vignesh Natarajan  



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;