I have the following scenario:
I am trying to change the value of a cell by using a custom presenter (see below for the XAML). My custom presenter is being hit but the grid is not showing the new value returned by the cusom converter. Can someone point out what i am doing wrong?
<Style x:Key="cvpValueChange" TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Value" Value="{Binding RelativeSource={RelativeSource Self}, Path=Value, Converter={StaticResource cvpValueConverter}}"/>
</Style>
Joe -
I need to do the same thing that Martin is doing. I tried the sample you provided and it worked, but I only need the style on a single cell and now that cell looks different from the other cells (does not have the same padding/margin). I snooped the different cells and noticed there is a bunch of stuff (XamTextEditor...) in the default cells that is not in the cell with the converter. Is there a way to simply apply the converter to the value of the cell without recreating all of the cell's contents? Or should I make a style for normal cells too and not use the default style provided by Infragistics?
John Myczek
"joem" wrote in message news:19110@forums.infragistics.com... Hi John - If all you need to do is supply a converter for the cell's value (i.e., you don't need/want to change the layout of the cell) you could take another approach that doesn't involve re-remplating and use an editor Style instead. Based on the data type of each Field the XamDataGrid creates one of our Editor elements and places it in the CellValuePresenter template. The base class for all the editors is ValueEditor. The ValueEditor class exposes a property called ValueToTextConverter that let you specify a converter to use when editing data. The TextEditorBase class is derived from ValueEditor and is the base class for all Editors that are text based. It exposes a property called ValueToDisplayTextConverter that lets you specify a converter that is used when displaying text (i.e., twhen the editor is not in edit mode). By creating a style for ValueEditor or TextEditorBase, and setting that style on your Field (via Field.Settings.EditorStyle), your converter will get called by the Editor used by all cells associated with that Field. Joe Modica http://forums.infragistics.com/forums/p/3017/19110.aspx#19110
Thank you. That worked perfectly.
John