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
590
XamWebGrid Custom Footer with Totals
posted

I am using XamWebGrid 10.1 and I want to have 3 different totals at the bottom of my screen, so I thought using the FooterTemplate would work best.  I am setting a key on a TextColumn, but the 3 different totals are seperate items in my class.  How would I bind the 3 TextBlock's or should I be using TemplateColumn?  Is there a way to access My 3 totals from the footer?

public class Data

{

   public Data LongExposure {get;set;}

   public Data ShortExposure {get;set;}

   public Data GrandTotal {get;set;}

   public decimal? Exposure {get;set;}

}

 

<igGrid:TextColumn Key="Exposure">

  <igGrid:TextColumn.FooterTemplate>

    <DataTemplate>

       <StackPanel Orientation="Vertical">

         <TextBlock Text="{Binding}">

         <TextBlock Text="{Binding}">

         <TextBlock Text="{Binding}">

       </StackPanel>

    </DataTemplate>

 </igGrid:TextColumn.FooterTemplate>

</igGrid:TextColumn>

  • 40030
    Offline posted

    Hi, 

    The only way to bind to something in the Footer, is via a StaticResource outside of the xamGrid, ad the Footers don't have a DataContext

    So, if you stored your data in a ViewModel, that you can access via a StaticResource you can bind to it like so:

    <TextBlock Text={Binding Source={StaticResource yourViewModel}, Path="LongExposure"}/>

    -SteveZ