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

Control Gird

Thread ID:





129760 Apr 2,2017 05:11 PM UTC Apr 5,2017 12:34 PM UTC ASP.NET Web Forms 5
Tags: Grid
Asked On April 2, 2017 05:11 PM UTC


I have two points:

1. I want to get a row values by row index in Grid. 
2. In toolBox in grid I want  connect add and edit button with my custom function in server side. can I do that?


Alan Sangeeth S [Syncfusion]
Replied On April 3, 2017 07:06 AM UTC

Hi Emanuele, 

Thanks for using Syncfusion products. 

Query 1: “get a row values by row index in Grid 
You can get the row element using getRowbyIndex method of Grid. Please refer the following API documentation link. 
If you need to get the JSON data, you get it by using “getDataByIndex” method of Grid. Please refer the following link. 

Query 2: “ connect add and edit button with my custom function in server side 
We suspect that you need to connect CRUD operation in Grid with server-side and you can achieve it using OnServerAddRow, OnServerEditRow, OnServerDeleteRow Grid events. Please refer to the following documentation for details regarding server-side interaction during CRUD operations. 

Suppose if you need to add customized buttons in grid toolbar, please refer the following documentations. 

Alan Sangeeth S 

Replied On April 3, 2017 07:29 AM UTC

Sorry, I didn't explain very well, for the first problem: I want get select row data in ServerToolBarClick events, and don't from JS.

For the second point, ok I understand that there isn't event before add.


Alan Sangeeth S [Syncfusion]
Replied On April 4, 2017 10:14 AM UTC

Hi Emanuele, 
Using the SelectedRowIndex and PageSettings property of Grid, we can get the selected row data from Grid DataSource property in server side. Please refer the following code example. 
protected void Toolbar_Click(object sender, Syncfusion.JavaScript.Web.ButtonEventArgs e) 
            var selectedRowIndex = this.Grid1.Model.SelectedRowIndex; // here you will get SelectedRow index 
            int dataIndex; 
            if (this.Grid1.PageSettings.CurrentPage > 1) 
                dataIndex = (this.Grid1.Model.PageSettings.PageSize * (this.Grid1.Model.PageSettings.CurrentPage - 1)) + (selectedRowIndex); 
                dataIndex = selectedRowIndex; 
            var DataSource = this.Grid1.Model.DataSource; 
            JavaScriptSerializer mySerialiser = new JavaScriptSerializer(); 
            string sJSONOutput = mySerialiser.Serialize(DataSource); 
            var data = mySerialiser.Deserialize<IEnumerable<Orders>>(sJSONOutput); // here you will get all the records 
            var SelectedRow = data.ElementAt(dataIndex); // here you will get SelectedRow 
            var keyValue = SelectedRow.OrderID;  // here you will get selected RowKey value 

Alan Sangeeth S 

Replied On April 4, 2017 09:12 PM UTC

Hi, But how you see in screenshot the datasource  is null in grid. I don't understand why?I use datasourceobject and maybe it is the problemAttachment: ScreenShot_20170404230745_47055fb2.zip

Venkatesh Ayothi Raman [Syncfusion]
Replied On April 5, 2017 12:34 PM UTC

Hi Emanuele, 
Thanks for the update. 
We have reproduced this issue while using object data source and using Essential Studio older version. In our latest version, the reported issue is not reproduced at our end. So, could you please ensure whether you are using older Essential Studio version? If so, we suggest you to upgrade the latest Essential Studio version. 
We have also prepared a sample for your convenience which can be download from following link, 
Note: in this sample, we have used the latest Essential Studio CDN links. 
Venkatesh Ayothiraman. 


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

or the page will be automatically redirected to 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