I have an ultradatasource. I load it with data from the database. I attach it to a datasource for the grid, but if I have no records, the initializelayout does not fire (which means my add new line does not appear). What should I be doing?
Roger
udsPatientProblemList.Rows.SetCount(intCount)
grdPatientProblemList.DataSource = .udsPatientProblemList
-- InitialLayout is not fired with 0 records. If I have records it fires. I can force it with a databind, but ....
Hi,
InitializeLayout should fire when you set the DataSource on the grid, regardless of the number of records in the data source.
But I am a little confused by your post. What do you mean by this?
rogerbundy said:I have an ultradatasource. I load it with data from the database.
Are you saying that you are copying your data into the UltraDataSource? If so, then you should not be calling SetCount on the Rows collection. That method is only supposed to be used when you are loading the data on-demand.
If you are loading the data on-demand and the intCount in your example here is 0, then I think InitializeLayout should still fire, as long as the UltraDataSource has bands and columns in it and the grid did not already have a data source with the exact same data structure.
BTW, what version of the controls are you using?
I am having an issue building up an UltraDataSource and getting it to populate a datagrid also. I can get columns to show in the base band, but the child bands do not show. My initialize does fire for finishing some things I want to do. I have not yet got to populating data. I am trying to make sure I get the structure right first. I have this in a recreatable project which is attached. BTW, v10.3
I'm afraid I still don't understand. Your sample shows a grid with two columns in the root band. You cannot see the child bands, because you don't have any rows in the parent band. There are not parent rows to expand, so there is no child data to see and therefore you cannot see the child columns.
In order to be able to see a child band, you have to have a row in the parent band.
I need to be able to display multiple bands in a grid. They may or may not be related to a "root band". They may be segments of a report that are being displayed in a grid for the user to sort and mix. Eventually, to send to an Excel spreadsheet. Not all data will be hierarchical. A lot will be. How do you recommend to go knowing that the end result is proabably Excel. Ideally, I would like to be able to add root bands, but the tool is too limited to accomplish that.
<soapbox> BTW, your "email me replies" has not worked since I joined this list almost two years ago. The problem I find out is that your email server sends url links that are not properly qualified and look like they have .com executables in them and they get rejected by our mail server. </soapbox>
btesch said:I need to be able to display multiple bands in a grid. They may or may not be related to a "root band". They may be segments of a report that are being displayed in a grid for the user to sort and mix. Eventually, to send to an Excel spreadsheet. Not all data will be hierarchical. A lot will be. How do you recommend to go knowing that the end result is proabably Excel. Ideally, I would like to be able to add root bands, but the tool is too limited to accomplish that.
I don't understand what you are asking. What do you mean that you may or may not have a root band?
If you want to display hierarchical data in the grid, then you must have a single root band with child bands. You cannot display multiple root bands as siblings in the WinGrid.
If your data is coming from multiple tables and you want to display it in a single list with no hierarchy, then you have to build a data structure with a single table. You could do this with UltraDataSource or by using a DataTable. But the data would have to be combined in the DataSource, it cannot be done in the grid.
btesch said:<soapbox> BTW, your "email me replies" has not worked since I joined this list almost two years ago. The problem I find out is that your email server sends url links that are not properly qualified and look like they have .com executables in them and they get rejected by our mail server. </soapbox>
I will pass your comments along to the folks who maintain the forums. :)
Mike,
Mike Saltzman"]If you want to display hierarchical data in the grid, then you must have a single root band with child bands. You cannot display multiple root bands as siblings in the WinGrid.
I know you are only the messenger, but I don't understand why the tool was build in such a way that this is not possible? Why does it have to be limited to one main band and only childbands from there?
btesch said:Not all data will be hierarchical.
What is your recommendation for dealing with this kind of data and have it appear as if there are multiple main bands that can be exported to Excel with the exporter?
Mike.
I was already thinking about option 3, but wanted some validation for that option. Options 1 & 2 look like they could turn out looking very confusing to a user that may just be getting started with our system.
Thanks,
Bob
btesch said:I know you are only the messenger, but I don't understand why the tool was build in such a way that this is not possible? Why does it have to be limited to one main band and only childbands from there?
I'm not sure why it was implemented this way. It's probably just because most applications do not display multiple tables in the same control.
btesch said:What is your recommendation for dealing with this kind of data and have it appear as if there are multiple main bands that can be exported to Excel with the exporter?
As I see it, you have a few options.
By the way, in cases 1 and 2, I mentioned that the data structure of the child bands has to be the same. That's not entirely true. You could create a data structure where the root level has multiple child bands (as siblings to each other) with different data structures. Each parent row would only contain data for one child band and simply have no child rows for any other band. This would work, but it might be a bit confusing and inefficient, depending on the number of child bands you have.