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. Image for the cookie policy date

grid Textbox field client side event


InlineForm - grid 
one -it's possible if i select  product code(str_product_code) in grid client side event (ajax JSON ) bind price automatically 

 <ej:Column Field="str_product_code" HeaderText="Product Name"  ForeignKeyField="str_product_code"
                               ForeignKeyValue="str_product_name" TextAlign="Left" Width="90" IsPrimaryKey="true"/>
 <ej:Column Field="dml_price" HeaderText="Price" TextAlign="Right" Width="80" Format="{0:C}" >
                            <NumericEditOptions DecimalPlaces="2"></NumericEditOptions>


2 Replies

PR Pratheep October 20, 2015 05:12 AM UTC


Sorry , please consider  Inline Editing -Grid ( not inlineForm - grid).



BM Balaji Marimuthu Syncfusion Team October 21, 2015 09:36 AM UTC

Hi Pratheep,

Thanks for contacting Syncfusion support.

Your requirement is achieved using the ActionComplete event in Grid. Refer to the sample and code example as below.
Sample: Sample-Editing

Help Document: http://help.syncfusion.com/js/api/ejgrid#events:actioncomplete

<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" >

           <ClientSideEvents  ActionComplete="actionComplete"  />

            <EditSettings AllowAdding="True" AllowDeleting="True" AllowEditing="True"></EditSettings>

            <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>


                <ej:Column Field="EmployeeID" HeaderText="Employee Name" IsPrimaryKey="True"  ForeignKeyField="EmployeeID"

                    ForeignKeyValue="FirstName" TextAlign="Left" Width="90" />

                <ej:Column Field="Freight" HeaderText="Freight" TextAlign="Right" Width="75" Format="{0:C}" EditType="Numeric">

                     <NumericEditOptions DecimalPlaces="2"></NumericEditOptions>



Using DropDownList select event, we have bind the value to Freight column automatically in Grid while adding the records. Refer to the help document.

<script type="text/javascript">

      function actionComplete(args) {

            if (args.requestType == "add") {

                var proxy = this._id;

                $("#" + this._id + "EmployeeID").ejDropDownList({

                    select: function (args) {  //select event in dropdownlist


                            url: "/Default.aspx/dropdowndata",

                            type: "POST",

                            contentType: "application/json; charset=utf-8",

                            data: JSON.stringify({ id: args.value }),

                            dataType: "json",

                            success: function (data) {

                                //set value to the Freight column

                                if ($('#' + proxy + 'Freight').hasClass("e-numerictextbox")) {

                                    var obj = $('#' + proxy + 'Freight').ejNumericTextbox("instance"); 

                                    obj.option("value", data.d);  //if using numeric text box



                                    $('#' + proxy + 'Freight').val(data.d);  //if using ordinary text box







Balaji Marimuthu

Live Chat Icon For mobile
Up arrow icon