The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi, I have a grid with some hidden rows. I need a way to determine the index of a visible row by having the index of the row in the grid. Is there an easy way to do this?
HAhaneefm Syncfusion Team October 29, 2007 10:52 PM UTC
Hi Ivaylo,
You can use the ViewLayout.RowIndexToVisibleClient to get a visible client row index for a given absolute row index. If the row is above the top row, the client row index for the top row index is returned. If the row is below the last visible row, the client row index for the last visible row is returned. Below is the code that shows this task:
Thanks for the reply. Unfortunately this is not what I need Maybe the term "visible" is not the most accurate one :) I need the index of a non-hidden row relative to all non-hidden rows ... (for example if the grid has 10 rows and rows 1,2,3,4 & 5 are hidden, then row 10 would be the 5th non-hidden row) What I am trying to do is to determine whether a non-hidden row's index is an even or odd number.
HAhaneefm Syncfusion Team October 31, 2007 12:03 AM UTC
Hi Ivaylo,
Please try these code to find the non hidden row count in a grid and let me know if this helps.
bool[] b = this.gridControl1.Model.HideRows.GetRange(1,RowIndex); int NonHiddenRowIndex = 0; for(int i = 0;i< b.Length;i++) { if(!b[i] ) NonHiddenRowIndex++; } Console.WriteLine(" The GridRow {0} is the {1}th NonHiddenRow of the Grid", RowIndex, NonHiddenRowIndex);