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?
I have set the VisiblePositions in the designer. I thought that the VisblePositions would be unchanged and did not expect to have to explicitly set them again on switching to the card view.
So you are saying that at run-time, the column order is changing from design-time? That might happen if you set the DataSource at run-time to a different data source than the one applied at design-time or if you set the DataSource and DataMember properties separately instead of using SetDataBinding.
You might want to look at this KB article: HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?
Here is the second image
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.
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.