Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Problem binding to a nullable property

Sort Posts: Previous Next
  •  05-20-2008, 8:14 PM Post no. 12392

    Problem binding to a nullable property

    I have a nullable property and if the property is null then the editor doesn't appear for that cell. All other cells in the row work fine and If the property gets a value, then the editor works just fine. Could this be a bug or am I doing something wrong? I have records with initially null values for integers and only should get filled out through the editor - but the editor never takes me to edit mode for that cell!

     

    <xcdg:DataGridControl

    Name="ManageGrid"

    ItemsSource="{Binding Source={StaticResource ManageGridView}}"

    AutoCreateColumns="False"

    CellEditorDisplayConditions="RowIsCurrent"

    AutoCreateDetailConfigurations="True"

    >

    <xcdg:DataGridControl.View>

    <xcdg:TableView ShowFixedColumnSplitter="False">

    </xcdg:TableView>

    </xcdg:DataGridControl.View>

    <xcdg:DataGridControl.Resources>

    <ResourceDictionary>

    <Style TargetType="xcdg:GroupByControl">

    <Setter Property="Visibility" Value="Collapsed"/>

    </Style>

    </ResourceDictionary>

    </xcdg:DataGridControl.Resources>

    <xcdg:DataGridControl.Columns>

    <xcdg:Column FieldName="ActiveInd" Title="Active" Width="80"/>

    <xcdg:Column FieldName="DeductionTypeName" Title="Deduction Type Name" Width="300"/>

    <xcdg:Column FieldName="RankSeq" Title="Rank" Width="80" />

    <xcdg:Column FieldName="DeductionTypeGroupEnumDescription" Title="Deduction Type Group" CellContentTemplate="{StaticResource DeductionTypeGroupTemplate}" Width="200">

    <xcdg:Column.CellEditor>

    <xcdg:CellEditor EditTemplate="{StaticResource DeductionTypeGroupListTemplate}" />

    </xcdg:Column.CellEditor>

    </xcdg:Column>

    </xcdg:DataGridControl.Columns>

    </xcdg:DataGridControl>

    </Grid>

     

    This is the property (RankSeq) that is giving me trouble:

    public int? RankSeq

    {

    get

    {

    return m_RankSeq;

    }

    set

    {

    if (m_RankSeq == value)

    return;

    m_RankSeq = value;

    }

    }

  •  05-21-2008, 3:49 AM Post no. 12393 in reply to 12392

    Re: Problem binding to a nullable property

    Same for us
  •  05-21-2008, 9:30 AM Post no. 12406 in reply to 12392

    Re: Problem binding to a nullable property

    Not all cell editors are created when AutoCreateColumns is set to false. That said, you will need to add a NumericTextBox editor as the RankSeq column's CellEditor.
    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
  •  05-21-2008, 10:15 AM Post no. 12409 in reply to 12406

    Re: Problem binding to a nullable property

    a string property set to null, I can't edit the value
  •  05-21-2008, 10:19 AM Post no. 12410 in reply to 12409

    Re: Problem binding to a nullable property

    Have you provided that column with a CellEditor?
    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.