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
20
Checkbox Fields?
posted

So, I'm having a problem with a *check box* field not displaying the checkbox state correctly.  IMO, it should either be checked or not.  This image shows that the box is neither of those states... it's in some other tertiary state.

XamDataGrid

 

 

 

 

And here's the definition of the class that is passed to the DataContext for the XamDataGrid...

public class SampleGridItem : INotifyPropertyChanged
{
   public Int64 SkuOrUpc { get; set; }
   public String ItemDescription  { get; set; }
   public Int32 Quantity { get; set; }
   public String UserName { get; set; }
   public Boolean IsFlex { get; set; }
   //...
}

And the Property for getting/setting the DataContext...

public ObservableCollection<SampleGridItem> GridItems
{
   get { return DataContext as ObservableCollection<SampleGridItem>; }
   set { DataContext = value; }
}

And the partial XAML definition... 

<DataPresenter:XamDataGrid EditModeEnding="OnGridFieldValueChanged" SelectedItemsChanged="requestedLabelsGrid_SelectedItemsChanged" LostFocus="requestedLabelsGrid_LostFocus" GotFocus="requestedLabelsGrid_GotFocus" Name="requestedLabelsGrid" DataSource="{Binding}" RecordActivated="requestedLabels_RecordActivated" TabIndex="10" Theme="RoyaleStrong" GroupByAreaLocation="None">
            <DataPresenter:XamDataGrid.FieldLayoutSettings>
                <DataPresenter:FieldLayoutSettings AutoGenerateFields="False" HighlightAlternateRecords="True" MaxSelectedCells="1" MaxSelectedRecords="1" />
            </DataPresenter:XamDataGrid.FieldLayoutSettings>
            <DataPresenter:XamDataGrid.FieldLayouts>
                <DataPresenter:FieldLayout>
                    <DataPresenter:FieldLayout.Fields>

...
                        <DataPresenter:Field Name="IsFlex" Label="Flex">
                            <DataPresenter:Field.Settings>
                                <DataPresenter:FieldSettings CellMinWidth="0" CellMaxWidth="300" CellWidth="40" AllowEdit="False" LabelClickAction="SortByMultipleFields" AllowGroupBy="false"/>
                            </DataPresenter:Field.Settings>
                        </DataPresenter:Field>
                    </DataPresenter:FieldLayout.Fields>
                </DataPresenter:FieldLayout>

            </DataPresenter:XamDataGrid.FieldLayouts>
        </DataPresenter:XamDataGrid>

Everything works swimingly... except for the IsFlex field.  So... what am I missing and why is the *IsFlex* field the only one not displaying correctly?

 Thanks!

- Wil