When I ask a grid to use the Cardview style, I do not get the labels showing vertically in a single coliumn on the left hand side but instead they are shown horizontally as is the data. I have attached a image showing the effect.
I have not set any other CardView setting but simply set
TreatmentPlansGrid.DisplayLayout.Bands[0].CardView = true;
What else do I need to do?
THanks
Mike,
I beleive the UseRowLayout is being set to true because in the Column arrangement overview section under the band I have clicked on the Use Row Layout (primarily because I have no idea what Use groups and levels option means). Selecting that option gave me the ahorizontal row as I expected. You only have the choice of the two options. One or othe rhas to be selected.
i also have this option set by the designer in 17 grids in th eapplication and all of them are obeying the VisiblePostion attribute setting.
Looking at the RowColumnInfoLayout I cannot even work out how you control the relative positions.
I'm really not sure why it worked initially. But UseRowLayout is not the default option for the grid. So if this property was being set int he Designer-generated code it's because you set the property at desig-time - perhaps you did this in the grid designer without realizing it.
The UseRowLayout property is set to true by the generated designer code. I was setting it to false when switching to CardView to stop all the labels etc showing as a single horizontal line of fields.
Switching back to no CardView I was restoring the UseRowLayout property to its original value. If I leave it false when switching from CardView then the columns in the non CardView are shown in the same order as in the CardView. What I dont understand now is why the VisiblePosition seems to work iniitally but not after switching back from CardView.
Okay, when you use a RowLayout, then the RowLayoutColumnInfo property on the column take precedence over the VisiblePosition. VisiblePosition can't be used in a RowLayout, because the position of the columns is more complex than a single integer can express. It doesn't seem like you need to be using RowLayouts here, since your columns are just arranged in a horizontal line, anyway - so why are you setting UseRowLayout to true?
Yes To switch back I set band.UseRowLayout=true and band.CardView=false;
There is no code to load a layout or chage the VisiblePositions.
When I look at the band after switch to CardView and just before switching back to UseRowLayouts, the VisiblePosition values are as expected and when the view goes back to non-card the dispalyed order is as expected from the VisiblePositions.