locked
How do I wrap text in a datagrid? RRS feed

  • Question

  • Hello,

    How do I force the text in a datagrid to wrap down to the next line to make the grid as narrow as possible?

    Thanks,
    Bob
    Tuesday, September 15, 2009 7:18 PM

Answers

  • a) New Silverlight 3 project
    b) Draw a DataGrid
    c) Create new Sample data source
    d) Drag and drop Property1 onto the DataGrid so you have a text column
    e) Right click on the Column created in the object tree -> Edit Column Styles -> Edit Element Style -> Create Empty
    f) In the property grid, set the TextWrapping property to "Wrap"

    Thanks,
    Unni
    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Bobindy Wednesday, September 16, 2009 10:05 PM
    Wednesday, September 16, 2009 8:51 PM

All replies

  • a) New Silverlight 3 project
    b) Draw a DataGrid
    c) Create new Sample data source
    d) Drag and drop Property1 onto the DataGrid so you have a text column
    e) Right click on the Column created in the object tree -> Edit Column Styles -> Edit Element Style -> Create Empty
    f) In the property grid, set the TextWrapping property to "Wrap"

    Thanks,
    Unni
    This posting is provided "AS IS" with no warranties, and confers no rights.
    • Marked as answer by Bobindy Wednesday, September 16, 2009 10:05 PM
    Wednesday, September 16, 2009 8:51 PM
  • Unni,

    Excellent, thank you!  That works!  I was having a hard time locating the TextWrapping property.

    Regards,
    Bob
    Wednesday, September 16, 2009 10:05 PM