SharePoint Experts, Information Architects, Expert Witness

SICG provides a broad array of business and technology consulting from architecture to design to deployment of global systems with a focus on surfacing data in the enterprise. We focus on the "How", not just the possible. Contact me direct: david_sterling@sterling-consulting.com or call 704-873-8846 x704.

Search This Blog

Monday, November 29, 2010

Binding within Silverlight DataGrids and Controls

When trying to bind to controls and cells within DataGrids (particularly when using DataTemplates), it can be hard to figure out when you are not getting a value when you have a properly formed control as in:

<TextBlock Text="{Binding MyTextField}"...

If the value is not appearing (and you are not getting an error), this could mean that you have to preface the binding so Silverlight can 'find it' - this is done using either CellValue or RowValue as in:

<TextBlock Text="{Binding CellValue.MyTextField}"...

or

<TextBlock Text="{Binding RowValue.MyTextField}"...

Have fun...

No comments: