Compartilhar via


Wrapping text in DataGrid cells

One of the most common questions I've been asked in recent weeks has been in regards to creating a data grid column style that supports text wrapping. It's really unfortunate that the DataGrid control does not provide this type of functionality, and even more that achieving a such effect is such a daunting task that requires a thorough comprehension of the control's rendering infrastructure. Since this was a requirement for one of the tools that I'm currently working on, I had no choice but to sit down and endure some pain in attempting to make this happen. I just finished up a very rough slab of code that produces what is visible in the following screenshot:

 

Before you make a mad rush to download, please be cognizant that this is code in its crudest form. I'll update the sample as the tool proceeds through its stabilization phase. In the meantime, feel free to get in touch with me if there are any questions. Enjoy.