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
close icon

How to find Row index of grid grouping control in asp.net c#

i want to find rowindex of grid grouping control in asp.net c#

7 Replies

ST Shalini Thangavel Syncfusion Team August 27, 2014 07:18 AM UTC

Hi Narry,

Thanks for using Syncfusion products.

 

We have analyzed the query and your requirement could be achieved by two ways either by using a button click or by using the SelectedRecordsChanged event.

 

*Query: I want to find rowindex of the grid grouping control in asp.net c#.

 

[using ButtonClick]

 

We can get the row index of selectedrecord from Grid Table CurrentRecord. Please refer to the following code snippets:

 

protected void Button_Click1(object sender, EventArgs e)

        {

 

         this.GridgroupingControl1.Table.CurrentRecord.GetRowIndex();          

 

        }

 

[using SelectedRecordsChanged]

 

Bind the selected records changed event to grid grouping control, and get the row index of selected record. Please refer to the following code snippets:

 

    void GridgroupingControl1_SelectedRecordsChanged(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)

        {

            if (e.SelectedRecord !=null && e.Action != Syncfusion.Grouping.SelectedRecordsChangedType.Reset)

            {

                int rowindex = e.SelectedRecord.Record.GetRowIndex();               

            }

           

        }        

 

For your convenience  we created a simple sample and same can be  download  from the following link:

Sample: http://www.syncfusion.com/downloads/support/directtrac/123628/WebApplication1-1072232008.zip

 

 

Please let us know if you have any further assistance.

 

Regards,

Shalini AT

 

 

 



MO mohsin August 27, 2014 12:12 PM UTC

void GridgroupingControl1_SelectedRecordsChanged(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)

        {

            if (e.SelectedRecord !=null && e.Action != Syncfusion.Grouping.SelectedRecordsChangedType.Reset)

            {

                int rowindex = e.SelectedRecord.Record.GetRowIndex();               

            }

           

        }       


by using above code i am getting wrong index 



VE venkatesh August 28, 2014 04:53 AM UTC

i using same code but getting wrong index,please check and let me quickly


ST Shalini Thangavel Syncfusion Team August 28, 2014 08:50 AM UTC

Hi mohsin/venkatesh,

 

Thanks for using Syncfusion product.

 

*Query: i using same code but getting wrong index, please check and let me quickly.

 

We are unable to reproduce the issue “Grid Grouping control Row index” .The RowIndex of grid rows are starting from 0,1,2,… so on. We have prepared a video demonstration of a working sample and the same can be downloaded from the following link.

Video: http://www.syncfusion.com/downloads/support/directtrac/128779/Video_(2)1592037951.zip

Could you please replicate your issue in the given sample and send back to us with more information so that we could able to sort out the cause of this issue or If we misunderstood your requirement please get back to us with more information so that we can analyze based on your scenario and provide you a better solution quickly?

The information provided would be of great help in resolving the issue.

Let us know if you need further assistance.

 

Regards,

Shalini AT. 



MO mohsin August 28, 2014 11:59 AM UTC

how to find label in grid grouping  control in item template


MO mohsin August 30, 2014 04:46 AM UTC

void GridgroupingControl1_SelectedRecordsChanged(object sender, Syncfusion.Grouping.SelectedRecordsChangedEventArgs e)

        {

            if (e.SelectedRecord !=null && e.Action != Syncfusion.Grouping.SelectedRecordsChangedType.Reset)

            {

                int rowindex = e.SelectedRecord.Record.GetRowIndex();               

            }

           

        }      


by above code i am getting wrong index because it is couting Header Row as index but i don't want to read header as index to overcome this what can i do



SI Silambarasan I Syncfusion Team September 2, 2014 11:30 AM UTC

Hi Mohsin,

 

Thanks for your update.

 

Query #1 “how to find label in grid grouping control in item template

 

We have already provided the solution for this query in the forum – 117173.  So we would like to suggest you to refer the below link,

 

Link: http://www.syncfusion.com/forums/117173/how-to-find-lable-control-in-grid-grouping-control-of-item-template

 

Query #2: “I am getting wrong index because it is counting Header Row as index but I don't want to read header as index to overcome this what can I do

 

As per our current implementation, Header rows are also included to count the index value and it is not feasible so we need to customize this based on requirements. And we suggest you to get the appropriate index value by decreasing its count as “1” for each enabled properties like ShowGroupDropArea, ShowCaption and ShowColumnHeaders.  Please refer the below sample link.

 

Link: SampleProject.zip

 

By using this customized row index value, we couldn’t able to get the correct records based on this value in server side. So, could you please provide us more information regarding this scenario for getting row index value so that we can analyse based on that and provide you better solution?

 

The information provided would be a great help for us to resolve this issue.

 

Please let us know if you need any further assistance.

 

Regards,

 

Silambarasan I


Loader.
Live Chat Icon For mobile
Up arrow icon