Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

WPF datagrid is coming in a skewed mode initially

Back to Forum: Tech Off
  • User profile image
    ramaT

    Hi

    I am working with the WPF Toolkit data grid and when a search is performed which involves high no. of resultsets then initially the grid comes in a skewed mode with all columns squeezed and then once search/binding done, the grid looks normal.

    One thing to note is I am dynamically adding the columns on creation of the datagrid. Could that be effecting anything? (I also dynamically create the celltemplate at the same time so that my bindings are set right.)

    Below is the code from the template for most of the cells that get generated.

     DataGridTemplateColumn tCol = new DataGridTemplateColumn() tCol.CellTemplate = new DataTemplate(); tCol.CellTemplate.VisualTree = new FrameworkElementFactory(typeof(ContentPresenter)); Binding binding = new Binding(e.PropertyName); binding.Converter = new ControlConverter(); tCol.CellTemplate.VisualTree.SetBinding(ContentPresenter.ContentProperty, binding); e.Column = tCol; e.Column.Width = new DataGridLength(1, DataGridLengthUnitType.Star); 

     

    Thanks in advance.

     

    Regards,

    Rama

     

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.