This question is locked. New answers and comments are not allowed.
I am creating dymanic columns (GridViewColumn) in code and assigning a DataTemplate to the column's CellTemplate. Dynamic columns are needed because the number of columns are not known. Here is my DataTemplate...
The object value that is passed through to the ValueConverter is my bound object. The problem is that I don't know which column I am on. The image displayed in the cell is multiple levels deep off of my bound object and I need to find it by key (which I have set as the UniqueName of the column).
I have already done this using an Infragistics silverlight grid as the object value passed to the ValueConverter is their UnboundColumnDataContext. Since I am only getting the bound object I have no reference to the cell or column.
How can I figure out within the ValueConverter or by passing in something through the ConverterParameter to know what cell/column I am in?
p.s. I am using Silverlight 5 beta so RelativeSource is better (if that would help in this situation).
Thanks,
Steve
<
local:QualImageConverter
x:Key
=
"QualImageConverter"
/>
<
DataTemplate
x:Key
=
"imageColumnDataTemplate"
>
<
Image
Source
=
"{Binding Converter={StaticResource QualImageConverter}}"
HorizontalAlignment
=
"Center"
VerticalAlignment
=
"Center"
/>
</
DataTemplate
>
The object value that is passed through to the ValueConverter is my bound object. The problem is that I don't know which column I am on. The image displayed in the cell is multiple levels deep off of my bound object and I need to find it by key (which I have set as the UniqueName of the column).
I have already done this using an Infragistics silverlight grid as the object value passed to the ValueConverter is their UnboundColumnDataContext. Since I am only getting the bound object I have no reference to the cell or column.
How can I figure out within the ValueConverter or by passing in something through the ConverterParameter to know what cell/column I am in?
p.s. I am using Silverlight 5 beta so RelativeSource is better (if that would help in this situation).
Thanks,
Steve