Hello.
I'm using NetAdvantage WebClient Trial 2009.2 to evaluation.
I want to implement "Ctrl-A" like function.
So I need to select all rows in xamWebGrid.
I try this code first:
foreach (var x in webgrid.Rows){ webgrid.SelectionSettings.SelectedRows.Add(x);}
but this is too slow.
So I tryed an other code:
webgrid.SelectionSettings.SelectedRows.AddRange(webgrid.Rows);
but it does'nt match Type of Arg.
Rows is RowCollection, not match SelectedCollectionBase<Row>.
Please tell me good performance way to do it.
Thanks, that's it.
The only problem is that I need to select all rows in all groups but this bit I can easily program myself.
Hi lemuriannn,
SelectAll functionality has been introduced in volume 11.2.
Here is a link to the sample demonstrating how it is use. And if you need any further details you could check this help page.
Don't hesitate to ask if you need any further assistance.
Regards,
Were there any changes in recent versions of xamGrid addressing this issue? It would be great if Ctrl + A or at least .SelectAll() would be supported out-of-the-box.
I understood.
I think I wrote a code that throws away lazy evaluation.
Thanks your detailed explanation.
IList is better than IEnumerable?
Thank you for your advice!
Hi,
So, when the xamWebGrid loads, it only accesses the data necessary for what it can currently display. As your scroll, it accesses more data and creates more Rows.
What you're doing here, is accessing all of your data and creating all of the Row objects associated with the Data at once.
So depending on the type of ItemsSource you're using, it could take some time to create the rows. Although once they're created, you won't have that problem, thus the performance improvement the second time around.
Note: i would recommend that you're at least using an IList for your ItemsSource, as that would give much better performance than just an IEnumerable.
-SteveZ