One Problem of the columns of GridView be changed.

1 posts, 0 answers
  1. jeremy
    jeremy avatar
    23 posts
    Member since:
    May 2011

    Posted 08 Oct 2011 Link to this post

        In my page, it consists of a ListBox and a GridView, when Selection of ListBox is Changed,  the Columns of GridView also be changed. Different listboxitem have different columns of GridView. I use this way to set the value to binding the different data Source to display: 
                target.DataMemberBinding = source.DataMemberBinding;
                target.Header = source.Header;
                target.DataFormatString = source.DataFormatString;
                target.TextAlignment = source.TextAlignment;
                if (target.DataMemberBinding != null && source.DataMemberBinding != null)
                    target.DataMemberBinding.Converter = source.DataMemberBinding.Converter;
                target.IsReadOnly = source.IsReadOnly;
                target.ItemsSource = differentSource;

    now, it has a problem, when changing the selection of ListBox, it is so slow to load the new columns. In other words, the page responses slowly.   there are two attachfile. please check it.

Back to Top