Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
display a List<string> property in a cell
posted

[EDIT]

By changing the Column.CellDisplayStyle = UltraGrid.CellDisplayStyle.PlainText, the newlines are respected.

[EDIT]

I'm using Infragistics2.Win.UltraWinGrid.v9.2 in a .Net 4.0 project.  This has to be very simple.

Assuming I'm populating the grid with a List, how do I simply display MyData.States as a newline delimited sting.  The grid is read-only.

public class MyData

{

  public int ID{get;set;}

  public List States{get;set;}

}

What I've done is to set the bound States column to hidden, added an unbound column and am manually doing the following in the InitializeRow method

...

var planStatesCell = e.Row.Cells[KEY_STATES];

if (planStatesCell != null)
planStatesCell.Value = string.Join("\n", language.PlanStates);

...

Oddly I get a column wraps based on the width of the column and not the newline character... as if the newline character is stripped.

What am I overlooking?

Kevin