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.

ASP.NET MVC GRID ROWINDEX

Thread ID:

Created:

Updated:

Platform:

Replies:

125526 Aug 23,2016 12:23 AM Aug 24,2016 11:29 PM ASP.NET MVC 1
loading
Tags: Grid
Manoj Sethi
Asked On August 23, 2016 12:23 AM

Hello Syncfusion Team,

How can I get the RowIndex when I add row dynamically or while binding it to DataSource?

I want S.NO to be populated automatically when Add Button is pressed in the toolbar.

Can anybody please suggest?

TIA
Manoj

Karthick Kuppusamy [Syncfusion]
Replied On August 24, 2016 11:29 PM

Hi Manoj,  
  
Query 1: How can I get the RowIndex when I add row dynamically or while binding it to DataSource?  
  
Before proceed with your requirement, we need to know the data source that you have bound to the grid because based on the dataSource the newly added row index value is changed.  
  
Local Data:  
   
                If you bind “local data” as a grid data source then the dynamically added row is always added at the Zeroth index of the grid.   
  
Remote Data:  
   
1.       Set IsIdentity:  
If you bind “remote data” as a grid data source and set “IsIdentity” property of “Columns” as true then the newly added record is added at last row of last page because if IsIdentity is true then the primary key value is auto incremented hence it always added at the last row of the last page.  
2.       Enable Sorting for Primary key column:  
If you bind “remote data” as a grid data source and enable initial sorting for primary key column then the newly added record row index is based on the primary key value. If the newly added record value is within the currentview page then we can find the row index of the newly added record or else we need to find the index of the newly added row from the server. So can you please share the details about the dataSource that you have bound to the grid as of now we can get the rowindex of newly added record by using the following way.  
  
Query 2: I want S.NO to be populated automatically when Add Button is pressed in the toolbar.  
  
Could you please share the following information which will help us to provide the prompt solution:                                                                                  
  1. Datatype of your DataSource (Local or Remote).
2.       Are using any adaptor in Grid? If so, tell me the adaptor type.   
3.       Share your first array object of your DataSource.    
4.       Grid rendering code example.  
  
Regards,  
 K.Karthick.  


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.

;