Hi,
I am loading data into an UltraWingrid with data in a datatable. I have all the data to be shown in the grid in my data set
My question is, would my application benifit ( performance, memory consumption) if I set the LoadStyle.LoadOnDemand = LoadOnDemand before assigning a data source ?
What my understanding is that by setting to LoadOn demand, the gird will load and show only those many rows that can be displayed in the UI.and as user scrolls down, it will fetch rows from the datatable
bi_acorbos said:Is there a way to cancel the sorting performed by the grid? I mean to let the indicators in the column headers but tell it to do nothing. I have to do it anyway in the select statement, since I load from a Relational DB.
Yes, you can set the HeaderClickAction to one of the External styles.
bi_acorbos said:Does filtering have the same effect?
No, there's no similar functionality for filtering.
"Some operations, like sorting rows, will cause the all rows to be loaded regardless of the load style"
Is there a way to cancel the sorting performed by the grid? I mean to let the indicators in the column headers but tell it to do nothing. I have to do it anyway in the select statement, since I load from a Relational DB.
Does filtering have the same effect?
Hello Shankarbiyer,
Thank you for submitting your question to the Infragistics UltraWinGrid Forum. Your understanding regarding setting the UltraWinGrid property LoadStyle.LoadOnDemand = LoadOnDemand before assigning a DataSource is correct. There are certain scenarios when setting the LoadStyle.LoadOnDemand = LoadOnDemand that would be ineffective and all rows would be loaded, such as when used with operations like sorting rows or using summaries that sum the values of a column.
The following explanation for this property setting is located at this URL and taken from our NetAdvantage® for .NET Online Help 2008 Vol 2 (CLR 2.0):
<http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v8.2~Infragistics.Win.UltraWinGrid.LoadStyle.html>
LoadOnDemand - Loads rows as they are needed. NOTE: Some operations, like sorting rows, will cause the all rows to be loaded regardless of the load style setting because they require access to all rows. For example if you have a summary that sums the values of a column then when the summary is calculated all the rows will be loaded.
Please let me know if you have any further questions.
Mike D.
The 'LoadOnDemand' setting defers the creation of UltraGridRow objects until they are actually requested; for example, if you were bound to a table with more rows than could be displayed without a scrollbar, as you scrolled down, new UltraGridRow objects would be created since they were now being requested by the control. In the case where the grid is bound to a relatively large table, there would be a performance benefit when the control is initially displayed since it takes some time to create these objects and retrieve their cell values, etc. It also reduces memory consumption since the creation of UltraGridRow objects requires a certain amount of memory for each one, and less of them might be created if the user never scrolls through the entire grid.
The general purpose of LoadOnDemand is not really designed for this use. As is illustrated in the sample that ships with NetAdvantage (I believe it's called something like "Loading 1 Million Rows"), the purpose of this functionality is to prevent you from having to fetch the data from your Database (or other source) all at the start of the application. There might be some benefit to using LoadOnDemand regardless, I'm not really sure. The grid will not create any UIElements, or generally any Cell/Row objects, unless it has displayed those on the screen, so you wouldn't save anything here. Finally, if you need to group, sort, or filter your rows, you will lose any benefit that LoadOnDemand might give you.
-Matt