Hello,
I'm trying to set up my XamDataGrid to compare 2 sets of data. Check out the sample JPG attached of a the spreadsheet I'm trying to replicate.
I've been trying to figure out a way to get the column span behaviour (Option A, Option B, and Option C in my sample JPG) without having to add a field or unboundfield to the field layout. When I add an UnBoundField (with column span set to 2) to the field layout, it assumes that there will be a corresponding data field in the grid creating a blank space on top of my data. Is there any way to just specify the column span portion as just a label and not a placeholder for data in the grid?
Any input would be greatly appreciated,
Thanks in advance,
Daniel
Hi Sandip,
Your response has pointed me in the right direction! I've managed to get rid of most of the empty white space by setting the field's settings CellMaxHeight property to Zero. Unfortunately there's a little bit of space left. It looks like it's padding between my field row 0 and row 1. Do you have any idea of how to eliminate (or reduce) that padding white space?
Thanks for the tip Sandip I appreciate the response, but I'm still seeing the extra space allocated for my label field. I've attached a screenshot below of what I'm seeing, and what I want to get rid of. For the solution I'm building, I need to construct FieldLayouts programmatically based on the data coming into my grid. Here's some sample code of what I'm trying to do:
Field curField;UnboundField curUnField;DataColumn curCol;FieldLayout fieldLayoutOnDeck = new Fieldlayout();
//Bump the current set of fields up one rowfor (int i = 0; i < viewTable.Columns.Count; i++){ curCol = viewTable.Columns[i]; curField = new Field { Name = curCol.Caption, Row = 1, Column = i }; fieldLayoutOnDeck.Fields.Add(curField);}
//Add the column span headers in the first rowfor (int j = 0; j < (viewTable.Columns.Count - 2)/2; j++){ curUnField = new UnboundField { Name = columnNames[j], Row = 0, Column = j*2, ColumnSpan = 2 }; FieldSettings hideFieldSettings = new FieldSettings(); hideFieldSettings.CellContentAlignment = CellContentAlignment.LabelOnly; curUnField.Settings = hideFieldSettings; fieldLayoutOnDeck.Fields.Add(curUnField);}
Hi Daniel,
If you don't want the cells of a field to display, set the field setting's CellContentAlignment property to LabelOnly.
Hope this helps,
Sandip