Normally (and naturally), each entry in a list is presented in a row in the grid control, but there're cases when I need to show each entry in a vertical format, i.e. in a column.
For example, for a simple grid like:
Is it possible to show it in Infragistics wingrid as:
One reason of doing this is because there're too many fields for each entry and the user thinks it would be easier to navigate if they're all in the same column instead of the same row.
I know I can manually transform the original data source and build another business object in the vertical format, but it feels awkward because the new BO doesn't really present the nature of what it really means.
Any help is very much appreciated..Thanks.
Nico is right. CardView
should do what you are looking for here.
Please let me provide you more details about this property:
InitializeLayout
event of your UltraGrid
. In order to achieve the desired look you would probably use the following code:
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
//Setting the desired Band to be in a CardView mode
e.Layout.Bands[0].CardView = true;
//Restrict the maximum card area rows
e.Layout.Bands[0].CardSettings.MaxCardAreaRows = 1;
//Decide if the caption should be shown
e.Layout.Bands[0].CardSettings.ShowCaption = false;
//Remove the CardSpacing so it would like closer to what you are expecting
e.Layout.Bands[0].Override.CardSpacing = 0;
}
For more general information about the CardView style please take a look here.