The converter is associated with the binding not with the column
DataGridBoundColumn bindcol = new DataGridTextColumn();
bindcol.Binding = new Binding("SomeBuffer"){Converter=new MyConverter()};
bindcol.Header = "Some Buffer";
*
*
mygrid.Columns.Add(bindcol);
On Sat, Nov 13, 2010 at 2:41 PM, Greg Keogh <[email protected]> wrote:
> Folks, I am binding a DataGrid to an arbitrary ItemsSource, so I have to
> dynamically create the columns and set the Binding property on each one.
> This is all working fine, but I want to manually format the cell contents of
> certain columns.
>
>
>
> In my case I might create a column which is bound to a byte array, and I
> don’t want to see "Sytem.Byte[]" in the cell, I want to format it nicely. I
> have a value converter class ready for format the bytes nicely, but I can’t
> figure out how to associate it with the column when I create it. I have:
>
>
>
> DataGridBoundColumn bindcol = new DataGridTextColumn();
>
> bindcol.Binding = new Binding("SomeBuffer");
>
> bindcol.Header = "Some Buffer";
>
> *bindcol cell content converter = ???????*
>
> mygrid.Columns.Add(bindcol);
>
>
>
> Somehow I have to associate bindcol with my converter class to format the
> cell Content, but I can’t figure out how. I’m still searching, but if anyone
> knows the trick, please let me know.
>
>
>
> Greg
>
> _______________________________________________
> ozwpf mailing list
> [email protected]
> http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf
>
>
--
Miguel A. Madero Reyes
www.miguelmadero.com (blog)
[email protected]
_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf