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

get selected row

how to get selected row from ej grid
i want it in my cs code as an object ??

1 Reply

JK Jayaprakash Kamaraj Syncfusion Team April 25, 2016 08:49 AM UTC

Hi Aladdin, 
Thank you for contacting Syncfusion support. 
We were able to get selected row in server using OnServerRowSelected server event. This event triggers when any of rows are selected in Grid. Please refer to the below code example, screenshot, Help document and sample. 
<ej:Grid ID="Grid1" runat="server"   AllowPaging="True" OnServerRowSelected="DefaultEvents_OnServerRowSelected"  
                <ej:Column Field="OrderID" HeaderText="Order ID"    TextAlign="Right" Width="90" /> 
                <ej:Column Field="CustomerID" HeaderText="Customer ID"   Width="100"  /> 
                <ej:Column Field="EmployeeID" HeaderText="Employee ID"  TextAlign="Right" Width="110"  /> 
                <ej:Column Field="Freight" HeaderText="Freight"  TextAlign="Right" Width="90" Format="{0:C}" /> 
                <ej:Column Field="ShipCity" HeaderText="Ship City" Width="100" /> 
        protected void DefaultEvents_OnServerRowSelected(object sender, GridEventArgs e) 
            for (int index = 0; index < e.Arguments.Count; index++) 
                var item = e.Arguments.ElementAt(index); 
                var itemKey = item.Key; 
                var itemValue = item.Value; 
            // do your operatios here 



Jayaprakash K. 

Live Chat Icon For mobile
Up arrow icon