Hello,
I am searching for a function which will return all rows that are visible in UltraGrid without looping through the rows.
My requirement is, on the click of a button 'select All' I want to select all the rows in the grid except for the one which are hidden.
The code that I am using is
Dim rows As UltraWinGrid.UltraGridRow() = Me.ulGridEstimateDetail.Rows.GetAllNonGroupByRows()Me.ulGridEstimateDetail.Selected.Rows.AddRange(rows)
This selects all the records(both visible and hidden).
Is there a function or any work around that will return a collection of all visible rows in ultrawingrid.
I want to avoid loops since I'm working with more than 13000 records.
Thanks,Shambu Sathyan
Hello ,
Thank you for your feedback, I’m glad to hear that I was able to help you.
Thank you for using Infragistics Components.
I found a work around to get this done in my scenario.
I added a column named IsVisible to the dataset used as Datasource. And whenever we are hiding a row, we set value of IsVisble as 0.
Then by using the ColumnFilters property of Ultragrid, I'm filtering all the rows whose IsVisible value is 1
Below is the code
Me.ulGrid.Rows.ColumnFilters("IsVisibe").FilterConditions.Add(Infragistics.Win.UltraWinGrid.FilterComparisionOperator.Match, 1)Dim rows As UltraWinGrid.UltraGridRow() = ulGrid.Rows.GetFilteredInNonGroupByRows()
ulGrid.Rows.ColumnFilters.ClearAllFilters()
Now all the visible row collection is available in the variable 'rows'.
You guessed it right Hristo. We are using .Net 2.0 as of now and we are planning to move it to .Net 4.5 in the near future, so as to use few windows 8 features.
For now we will go ahead implementing the loops and will do the modification to the code once we are into .Net 4.5.
Thanks for the suggestions Boris And Hristo.
It seems that you are using .NET 2.0, so change target version of your project to .NET 4.0. The other option is to iterate through row collection via For loop for example and to check if the row is not hidden.
Please let me know if you have any further questions
Hello Boris,
We are using Infragistics v10.3 and it does not seems to support 'where' in row collection.I am getting the following error on using the code that you provided.
'Where' is not a member of 'Infragistics.Win.UltraWinGrid.RowsCollection'.
I converted the code to vb.net since I'm using vb.net.
Dim rows As UltraWinGrid.UltraGridRow() = Me.ulGridEstimateDetail.Rows.Where(Function(r) Not r.Hidden).ToArray(Of UltraGridRow)()
Do I need to import any thing to work with toolset. And can you provide me some details on toolset.
Please suggest me further changes.