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
530
Xamdatagrid unbould filed type of dynamic unbound filed
posted

I am creating my data grid clomns dynamically. Each have different data type and precision value.

My Parameter class

 public class Parameter
        {

            public string ParameterName { get; set; }
            public double Value { get; set; }
            public Type Type { get; set; }
            public string Precision { get; set; }
        }

Colum initialization

 void xamDataGrid_FieldLayoutInitialized(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializedEventArgs e)
        {

            SpreadsheetViewModel.MyViewModel columns = this.ViewModel.Data.First();






            for (int i = 0; i < columns.Parameters.Count; i++)
            {
                var field = new UnboundField
                {
                    Name = columns.Parameters[i].ParameterName,
                    BindingMode = BindingMode.TwoWay,
                    DataType = columns.Parameters[i].Type,
                    Format = columns.Parameters[i].Precision,
                    BindingPath = new PropertyPath("Parameters[" + i + "].Value"),
                    AllowEdit = false,




                };

                field.Settings.EditAsType = typeof(String);
                e.FieldLayout.Fields.Add(field);


            }



        }

If I manually set DataType = typeof(double ) it has no problem, but when I send same thing though parameter  it gives an error

What might be the reason ?

Parents
  • 25665
    Verified Answer
    Offline posted
    Hello Guray,
    Thank you for contacting Infragistics!
    What are the errors you are getting?
    The best way for us to assist you is if you provide a small isolated sample that we can run and use for debugging locally.
Reply Children
No Data