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
425
XamDataGrid Databind Column Creation
posted

 Hi,

Still evaluating the controls but pretty much convinced folks to buy.  last thing I need to to is variable numbers of columns at Run-Time.  I have this class:

public class RawDataSetDto<T> : IList<T>

{

        public ReadOnlyCollection<T> Rows
        {
            get { return new ReadOnlyCollection<T>(_rows); }
        }

        public ReadOnlyCollection<string> Headers
        {
            get { return new ReadOnlyCollection<string>(_headers); }
        }

}

I just want the grid to create a column for each entry in Headers and then show the data in the Rows collection.  Simply cannot figure out how to bind the Field creation in XAML.

My Grid Declaration is:

        <ig:XamDataGrid DataContext="{Binding MyDataSet}" DataSource="{Binding Rows}" Grid.RowSpan="1" >
            <ig:FieldLayoutSettings AutoGenerateFields="False" />
        </ig:XamDataGrid>

MyDataSet is an instance of RawDataSetDto<RawDataRowDto>