Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
xamDataGid CellValuePresenter and IsSelected behavoir
posted

Hi,

to bind different fields, I i created a new CellValuePresenter eg like here Sample. This works, but I loose the behavior to select mulitible cells. So I ussed the full template from DataPresenterGeneric_Express.xaml. I modified the ContentPresenter:

<ContentPresenter x:Name="PART_EditorSite"
Content="{Binding DataItem.Value}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Style="{TemplateBinding ForegroundStyle}" />

Value is a string.

With this, the selection works fine.
But: the cell cant't be edited. It shows the text of the underlying control: Infragistics.Windows.Editors.XamlTexteditor.

If I write Content="{Binding DataItem.Value}", the cell shows "MyNamespace.DataItem.Value"

If I set Conten to an own DataTablate, I also loose the cell selection behavior.

How can I achive, that the cell shows and edits Value?

Best Regards!

  • 20
    Offline posted

    Hello Christoph,


    Thank you for your post. I am not sure if I understand your requirement, and understand why you are doing this?
    Looking into your ContentPresenter code, you bind it to your underline datasource item ‘value’ so if you alredy have value then why not creating a separate field for that and each field has CellValuePresenterStyle which you can use to modify that.

    And regarding cell/row selection you can set the CellClickAction property which is use to determine what happens when the user clicks on a Field's cell. Something like this:

    <igDP:FieldLayout.FieldSettings>
    <igDP:FieldSettings CellClickAction="SelectRecord"/>
    </igDP:FieldLayout.FieldSettings>


    If this is not what you are trying to do then please provide more information .