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.
Unfortunately, activation email could not send to your email. Please try again.

Webforms Grid -Server Side Events

Thread ID:

Created:

Updated:

Platform:

Replies:

129727 Mar 30,2017 09:43 AM Apr 3,2017 07:46 AM ASP.NET Web Forms 6
loading
Tags: Grid
Danie van Eeden
Asked On March 30, 2017 09:43 AM

Hi

it seems the ServerDeleteRow, ServerEditRow and ServerAdd row events aren't firing?
Am I missing something obvious?

If so, could you direct me to a tutorial.
Thx
Danie

Mani Sankar Durai [Syncfusion]
Replied On March 31, 2017 07:20 AM

Hi Danie, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we are not able to reproduce the reported issue. We have also prepared a sample based on your requirement that can be downloaded from the below link. 
In this sample we have used server side event for Add, Edit and delete and when performing CRUD operations it trigger. 
Refer the code example. 
<ej:Grid ID="Grid" runat="server" AllowPaging="True" OnServerAddRow="Grid_ServerAddRow" OnServerDeleteRow="Grid_ServerDeleteRow" OnServerEditRow="Grid_ServerEditRow"> 
        <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True"></EditSettings> 
            <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings> 
        <Columns> 
... 
           </Columns> 
        </ej:Grid>   
 
 
 
 protected void Grid_ServerAddRow(object sender, Syncfusion.JavaScript.Web.GridEventArgs e) 
       { 
           EditAction(e.EventType, e.Arguments["data"]); 
       } 
 
       protected void Grid_ServerDeleteRow(object sender, Syncfusion.JavaScript.Web.GridEventArgs e) 
       { 
           EditAction(e.EventType, e.Arguments["data"]); 
       }  
 
       protected void Grid_ServerEditRow(object sender, Syncfusion.JavaScript.Web.GridEventArgs e) 
       { 
            EditAction(e.EventType, e.Arguments["data"]); 
       } 


When performing server side event we have refer the ej.webform.min.js script file below the ej.web.all.min.js in your script section.(Master page) 
<head runat="server"> 
    <meta charset="utf-8" /> 
    <title><%: Page.Title %> - Home page</title> 
    
     
   ... 
    
    <script src="Scripts/ej/ej.webform.min.js"></script> 
    <asp:ContentPlaceHolder runat="server" ID="HeadContent" /> 
    
 

You can get the ej.webform.min.js script file from your build location. 
Location: C:\installed location (x86)\Syncfusion\EssentialStudio\**.*.*.**\JavaScript\assets\scripts\common 

Refer the documentation link. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


Danie van Eeden
Replied On March 31, 2017 09:29 AM

Hi thanks for the reply.

I will take a look at your example and revert back with results.

(I have included the javascript as per your example.)

Kind Regards
Danie

Danie van Eeden
Replied On April 1, 2017 06:11 AM

Hello,

You examples works perfectly, however my own project does not..
The events simply don't kick.
I have tried using your sample version of jquery - no difference.

I have the following in my own project. You help greatly appreciated.

categories.aspx:
<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="categories.aspx.cs" Inherits="itbiqvalue_web_admin.categories" %>
<%@ Register assembly="Syncfusion.EJ.Web, Version=14.4460.0.15, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" namespace="Syncfusion.JavaScript.Web" tagprefix="ej" %>
<%@ Register assembly="Syncfusion.EJ, Version=14.4460.0.15, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" namespace="Syncfusion.JavaScript.Models" tagprefix="ej" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="text-align:right">
                            <ej:Grid ID="Grid1" runat="server" AllowPaging="True" DataSourceID="dsCategories" OnServerDeleteRow="Grid1_ServerDeleteRow" OnServerEditRow="Grid1_ServerEditRow" OnServerRowSelected="Grid1_ServerRowSelected1">
                                <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>
                                <Columns>
                                    <ej:Column AllowEditing="False" DataType="number" Field="category_id" IsIdentity="True" IsPrimaryKey="True">
                                    </ej:Column>
                                    <ej:Column DataType="string" Field="category_description">
                                    </ej:Column>
                                </Columns>                                
                                <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True"></EditSettings>
                            </ej:Grid>
                    <br />                   
                    </div>
    <asp:SqlDataSource ID="dsCategories" runat="server" ConnectionString="<%$ ConnectionStrings:itbiqvalueConnectionString %>" SelectCommand="SELECT * FROM [itb_categories]">
</asp:SqlDataSource>
</asp:Content>

In my Page master I have:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Master.master.cs" Inherits="itbiqvalue_web_admin.Master" %>

<%@ Register assembly="Syncfusion.EJ.Web, Version=14.4460.0.15, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" namespace="Syncfusion.JavaScript.Web" tagprefix="ej" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>  
    <style type="text/css">
      .no-fouc {display: none;}
    </style>
    <link rel='nofollow' href="Content/ej/ej.widgets.core.min.css" rel="stylesheet" />
    <link rel='nofollow' href="Content/ej/default-theme/ej.theme.min.css" rel="stylesheet" />  
       
    <script type="text/javascript" src="Scripts/jquery-1.10.2.min.js"></script>
    <script src="Scripts/jsviews.min.js"></script>    
    <script src="Scripts/jquery.easing-1.3.min.js"></script>
    <script src="Scripts/jquery.globalize.min.js"></script>    
    <script type="text/javascript" src="Scripts/jsrender.min.js"></script>
    <script src="Scripts/ej.web.all.min.js"></script>        
    <script src="Scripts/ej.webform.min.js"></script> 
.................


Danie van Eeden
Replied On April 1, 2017 06:20 AM

Hi some more info from my side.

I have deleted the grid and dropped it on the page again.
I have reset all the settings and relinked the server side event.
Still it does not respond to the delete command (ie. ServerDelete event does not fire).

I am guessing the problem lies in scripting. 
Hoping you can assist.

Danie

Danie van Eeden
Replied On April 1, 2017 06:45 AM

Hi,

my sincerest apologies..
Problem solved - it seems the script manager component got lost and was no longer on the page.
My mistake, the events are no firing as expected.

Thx for your time

Mani Sankar Durai [Syncfusion]
Replied On April 3, 2017 07:46 AM

Hi Danie, 

We are happy to hear that your problem has been solved. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Duria. 


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.

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.

;