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
215
Binding XamDataGrid to IEnumerable<XElement>
posted

Can someone tell me what I am doing wrong.....I am able to use the following syntax to bind the results of a Linq query(Jobs - IEnumerable<XElement> property on my view model) to a standard ListBox:  How do I make this happen with XamDataGrid?  I've posted my failed attempt at the bottom.  Thanks!

 

      <ListBox ItemsSource="{Binding Jobs}" Height="150">

      <ListBox.ItemTemplate>

        <DataTemplate DataType="{}Job">

          <StackPanel Orientation="Horizontal">

            <TextBlock Width="100" Text="{Binding Path=Element[JOB_ID].Value}" />

            <TextBlock Width="100" Text="{Binding Path=Element[TYPE_DESCR].Value}" />

          </StackPanel>

        </DataTemplate>

      </ListBox.ItemTemplate>

    </ListBox>

 

--------------------

<igDP:XamDataGrid IsUndoEnabled="True" Theme="Office2k7Blue" DataSource="{Binding Jobs}"  IsEnabled="True">

        <igDP:XamDataGrid.FieldLayoutSettings>

          <igDP:FieldLayoutSettings

            HeaderPrefixAreaDisplayMode="FieldChooserButton"

            AutoGenerateFields="False"

            AllowClipboardOperations="All"

            CopyFieldLabelsToClipboard="True" />

          </igDP:XamDataGrid.FieldLayoutSettings>

 

        <igDP:XamDataGrid.FieldLayouts>

          <igDP:FieldLayout>

            <igDP:FieldLayout.Fields>

              <igDP:Field DataType="{x:Type xlinq:XElement}" Name="Element[JOB_ID].Value" Label="Job Id"/>

              <igDP:Field DataType="{x:Type xlinq:XElement}" Name="Element[TYPE_DESCR].Value" Label="Job Type"/>

              <igDP:UnboundField Name="ActionItem" Label="Action Item"/>

              <igDP:UnboundField Name="Overdue" Label="Overdue"/>

              <igDP:UnboundField Name="Upcoming" Label="Upcoming"/>

            </igDP:FieldLayout.Fields>

          </igDP:FieldLayout>

        </igDP:XamDataGrid.FieldLayouts>

      </igDP:XamDataGrid>