Hi Staff.
I have a simple DataSet with two tables, and this DataSet is the DataSource of my Grid.
What i obtain is a Hierarchical Grid. It works fine but i always manually define the schema.
I created Bands 0 and his Child, Bands 1.
Columns in Bands 0 works fine (i mean, i can change property correctly), but what i edit in Bands 1 (whatever property, column caption for example), nothing change.
If i try to change this by code behind, it works.
Why?
Is it possible manually define a schema for Hierarchical Grid?
Another and last question: Column 1 on Bands 1 has the same width of Column 1 of Bands 0.
this happens for all the columns.
Is it possible define different widths for Bands 1?
Hello Luciano,
Thank you for contacting Infragistics!
This behavior is likely occurring because the name/key of your Band 1 does not match what is in the data source. The reason Band 0 works as since it is the parent level it doesn’t have the requirement of having to match those. You will want to make sure what you have in the schema matches your data source (not that for the key you may have to use the data relation).
As for setting column width each column has its own width property. After defining the schema under the basic settings in the designer. Expand out the Band and Column Settings. There you will be able to define widths on the columns in Band 1.
Hi Mike!.
Thank you for reply.
I checked: the columns in Band 1 are the same of my DataSource.
I also tried to change the key of Band 1 with the name of the data relation, but nothing change.
Why still not match?
Instead about columns width i solved the issue thanks your advise: i forgot to change the property "AllowColSizing" in "AllowColSizing.Free".
The grid defaults to ExpansionIndicator.CheckOnExpand for performance reasons. Depending on your data source, retrieving the child rows for a parent row can be an expensive operation, so the grid doesn't check until you click on the expansion indicator by default.
Setting it to ExpansionIndicator.CheckOnDisplay will make the grid check for child rows immediately when the row is displayed. This is usually okay on modern, fast machines as long as your data source is efficient in retrieving the child rows.
By default the ExpansionIncidator property is set to CheckOnExpand and you will want to set it to CheckOnDisplay:
this.ultraGrid1.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.CheckOnDisplay;
Thank You Mike, now it works!!
I really have no idea why there was that "Band 1" Column in Band 0.
I did not create it voluntarily, and it was enough to remove that column.
I take advantage of your kindness to ask you last question:
My Grid show the "cross" on all rows, including that have no match. Is possible hide cross in this case?
Hi Luciano,
I spent my morning looking at your sample and I'm pretty sure I see the problem.
The schema of your grid at design-time is missing something. When you create a child band, what happens behind the scenes is that the child band is represented in the grid by a special kind of column in the parent band called a chaptered column. In your sample, there is no chaptered column in the parent band and so when the grid tries to match up the schema you set up at design-time (which does not have the chaptered column) and the schema from the data source at run-time (which DOES have the chaptered column), it doesn't match up and so the child band schema gets lost. I can't be sure, but I suspect that the chaptered column may have gotten removed because you added a column to the root band that had the same key as the child band. When I open up your sample, there's a column in the root band called "Band 1." Of course... that is not the actual name of your child band, but I'm guessing that maybe while you were playing around with this and trying to get it to work, you might have named it "Table2" or "dr1" at some point. That's just a wild guess.
Anyway... however it happened, the design-time schema is now invalid. To fix it, I think you will need to recreate the child band schema at design-time.
1) Open up the form designer and click the Start button on the grid.
2) Select "Data Schema" under "Basic Settings" in the tree on the left.
3) Click "Manually Define a Schema"
4) Select the "dr1" band and click the X to delete it.
4a) Now... right here I ran into a problem because if I try to add a child band, the designer locks up. This is because it tries to create a child band whose key is "Band 1" and there's already a column by that name. So you need to either remove or rename that column from the root band. I suggest removing it completely, since it does not exist in the data source and it's causing problems. If you need unbound columns, you can add them in afterward. This appears to be a bug and I will follow up on this and make sure it gets fixed.
5) Add the dr1 band back in and add in the two columns with the appropriate names "ID" and "NAME_SON"
By re-creating the child band in the schema, it should correctly re-create the chaptered column in the root band and that should fix the problem.
Hi Mike,
attached you can find project you request.
As you can see, i tried to change in design-time to hide column "ID" and change header's caption of the other column of band 1.
It works only if i write code in InitializeLayout Event.
P.S. I'm using Visual Studio Professional 2017 with Infragistics, version 2017.1
P.P.S. I got error when i tried to upload attached, so i give you a link to download it from my server.(this will be delete until 15 days).www.crwk.it/.../CarboniSPA_20180802093516.zip