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
It looks like you have UseRowLayout set to true on this band. In this case, CardView really only controls the positon of the cards, it doesn't affect the layout of the card itself. So you probably just want to turn of RowLayout. Otherwise, you will need to change the layout of the row.
Thanks Mike,
Setting UseRowLayout to false fixed that problem. Is there a way to control the order that the fields are shown in the vertical stack?
Well, that's weird. Are you changing back to UseRowLayouts when you switch to the normal (nonCard) view?
Can you examine the VisiblePosition property of the columns to see if it is actually changing when yuo change views? I can't see any reason why that should happen. Are you sure you are not loading a layout or setting the VisiblePositions in code somewhere?
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.
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?
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.
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.
Hi,
Hm, I just tried this out and setting the VisiblePositon on the column header works fine for me both in CardView and regular view. So I'm not sure why it's not working for you.
Maybe you should Submit an incident to Infragistics Developer Support with a sample showing it not working?
You are right about sizing and re-ordering, right on the grid in the form designer.
I now ensure that UseRowLayout is set to false (by the designer) and is never set to true.In the card view however the VisiblePosition is not being used and the columns are out of order while being correct in the row view.
I have also checked with the debugger that the UseRowLayout stays false.
You can still re-order and re-size columns. In fact, I think you can do right on the grid in the form designer - you don't even have to go into the grid designer to do it. You can allow the users to do this, also, by setting the AllowColMoving and AllowColSizing prorpeties.
Mike,
The reason I check the UseRowLayout is that I can then re-size and re-order the columns in the desiner overview. When you select the alternative Use groups and levels, I cannot see hoe to re-order the coulmns or re-size them. Can you point me at some documentation on how you work with the Groups and levels?
pmoran said: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
Yes, that's correct. But it doesn't seem to me that you need to use RowLayouts here. You just want a basic horizontally aligned set of columns, so using RowLayouts here will just overcomplicated matters.