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

OnServerRowSelected - Get field value

Thread ID:

Created:

Updated:

Platform:

Replies:

118965 Apr 28,2015 09:14 PM UTC Apr 30,2015 11:37 AM UTC ASP.NET Web Forms 3
loading
Tags: Grid
Henrique
Asked On April 28, 2015 09:14 PM UTC

Hi,

How can I get the value of a specific field from a selected row?

In asp.net GridView I'm able to do this :
int id = Convert.ToInt32(grvMapaAcao.SelectedRow.Cells[1].Text);

I searched for almost 2 hours in documentation and in the Syncfusion Examples but nothing.

Just this :
protected void DefaultEvents_OnServerRowSelected(object sender, GridEventArgs e)
{
   serverEvent.InnerHtml = serverEvent.InnerHtml + span + "rowSelected</span> event called</span><hr>";
}
Kind Regards

Henrique

Balaji Marimuthu [Syncfusion]
Replied On April 29, 2015 01:25 PM UTC

Hi Marcelo,

Thanks for using Syncfusion Products.

Based on your requirement we have created a sample and the selectedrow index and the selected records values of specific field can be get by using the variable GridEventArgs e in Onserverrowselected event. Please refer the below code snippet.


protected void DefaultEvents_OnServerRowSelected(object sender, GridEventArgs e)

{

int selectedrowindex = Convert.ToInt32(e.Arguments["rowIndex"]);

int id;

Dictionary<string, object> data = e.Arguments["data"] as Dictionary<string, object>;

foreach (KeyValuePair<string, object> keyval in data)

{

if (keyval.Key == "EmployeeID")

{

id = Convert.ToInt32(keyval.Value);

serverEvent.InnerHtml = serverEvent.InnerHtml + span + id;

}

}
}


Please refer the sample for further assistance and the same can be downloaded from the following link.
Sample: http://www.syncfusion.com/downloads/support/forum/118965/Sample-1050810287.zip


We are working on the documentation task for Server side events for ASP.NET and it will be published online in our upcoming Volume release.

Please let us know if you have any queries.

Regards,
Balaji Marimuthu

Henrique
Replied On April 29, 2015 01:47 PM UTC


Hi Balaji,

Sorry but I found the solution a few hours ago, after a several hours of research and is better than this solution.

Three rows of code, and still is too much :
Dictionary<String, object> rowGrid = new Dictionary<String, object>();
rowGrid = (Dictionary<String, object>)e.Arguments["data"];

int id = (int)rowGrid["id"];

Sorry, but we need something to simplify our job, and not to complicate.

The end result of Syncfusion Grid and other controls are fantastic, but the way to build them is difficult and complicated, not to mention that the documentation is incomplete.

Here's an example:
I am completing a 630-hour project, if I were to develop it 100% with Syncfusion controls, I would have to add around 200 hours due to the learning curve but even after knowing well the controls still believe it would have to add at least 80 more hours, that here in Brazil is to ask the customer does not approve the project. (laughs)

Regards

Henrique

Balaji Marimuthu [Syncfusion]
Replied On April 30, 2015 11:37 AM UTC

Hi Marcelo,

Thanks for the update and suggestions.

We can get the selected record values by using the Dictionary key value pair only in the server side. We will consider your suggestions.

Please get back to us if you have any concerns.

Regards,
Balaji Marimuthu

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.

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

;