Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1210
Filling UltraWinGrid manually, VERY IMPORTENT
posted
Hi Guys, These are my requirements, please let me know if they are possible:I need to fill the UltraGrid manually, get the data from the DB (or DataSource) and add the rows manually in the code.Expansion indicator will be available for each line, but child rows will be added manually only when user clicks the expand indicator.Then (an only then) data will be read from DB and will be added to the table and ONLY for that specific row (that was expanded) - NOT the reset of the rows, this will occur for each expansion event.It is important for me not to load all the rows at once, my application should deal with a lot of data (can reach up to 200.000 rows).This is not my only problem, building the child rows requires code and logic which CANNOT be defined by relations in xsd files due to its recursive nature.This means that every expansion should invoke a method that will build the child row for the expanded parent row and will add it.I have seen that there are two events: AfterRowExpanded and BeforeRow expanded, can this logic be imbedded into this event handlers?Is it possible at all? I have read in another post that this is not possible to manually add child rows, is this true, am i missing something, this seems to be a very basic feature. If this is not available, it there another trick to overcome it?If not, are these features available in the WinTree control?YOUR HELP IS CRUTAIL, Thanx in advance.

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi, 

    These are not easy questions to answer. First, you cannot add data to the grid manually. The grid requires a Data Source of some kind. There are lots of data sources you can use, though. You can bind the grid to any object which implements IList or IBindingList. So you could use a DataSet, a DataTable, an UltraDataSource, a generic List or BindingList, or many many other object. 

    If you want to load data on-demand, then I recommend using the UltraDataSource, There's a sample included with the NetAdvantage SDK called the "Virtual Mode Sample" which demonstrates a grid with 1 million rows that are loaded only as needed.

    The grid cannot be bound to a non-homogenous data source, either, though. So if your data structure is going to change on a row-by-row basis, then you probably can't use the grid. 

    You might want to look into using UltraWinTree. The tree lacks some features of the grid like filtering and summaries, but you would not be able to use those features in the grid anyway without loading all of the data. And the tree supports manually adding nodes and non-homogenous data structures. There's a sample included with the SDK of loading a tree with data on-demand as nodes are expanded. So it sounds like the WinTree will do exactly what you need. 

Children
No Data