Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

DataGrid Bugs RSS

17 replies

Last post May 25, 2009 02:22 AM by oyanglulu

(1)
  • sladapter

    sladapter

    All-Star

    43609 Points

    7910 Posts

    DataGrid Bugs

    Jun 17, 2008 03:14 PM | LINK

    I have found several DataGrid non-fatal UI bugs:

    1) There are 2 horizontal lines at top of the DataGrid container when the grid is empty. They just look weird.

    2) When setting HeadersVisibility="Column" in the XAML, the header cells and the data cells down below are not aligned. The header has some offset to the right.  The strange thing is when I set the HeadersVisibility=DataGridHeaders.Column in code, it works fine.

    3) If I have many columns in the DataGrid,  when I scroll to right to see all the columns, sometimes the data row are broken in the middle. The Header row is extending to all the way to the right, but data rows are stopped in the middle, not extending all the way to the right until I try to resize a column. When I try to resize a column, everything is back to normal.

     

     


    Sally Xu
    Software Engineer
    Aprimo, Inc

    Please remember to mark the replies as answers if they answered your question
  • samcov

    samcov

    Participant

    1673 Points

    719 Posts

    Re: DataGrid UI Bugs

    Jun 20, 2008 05:16 AM | LINK

    I have a problem where I populate the datagrid, then select a cell for editing, then scroll up and down, and the datagrid fatally crashes.

  • hangkous

    hangkous

    Member

    56 Points

    41 Posts

    Re: DataGrid UI Bugs

    Jun 20, 2008 02:34 PM | LINK

    I have seen fatal crashes of the Silverlight plugin with the datagrid. For example when I sort a column and before it is finished I start a couple of other sort actions by clicking column headers. The DataGrid is surely not at beta level yet.

    Rick

    Rick

    IdeaPlease remember to mark the replies as answers if they answered your question
  • sladapter

    sladapter

    All-Star

    43609 Points

    7910 Posts

    Re: DataGrid UI Bugs

    Jun 20, 2008 03:51 PM | LINK

     Found more problems with DataGrid:

    1) FrozenColumnCount is not working at all. It does nothing. It should freeze the first 2 columns if I set it to FrozenColumnCount = 2. But it does not.

    2) CanUserReorderColumns not working with custom header. Only works with default header.

    In beta 2 DataGrid got several new settings. One of them is CanUserReorderColumns setting. If do not use any custom header, just set the column.Header = "MyHeaderText".  This feature works fine. I can drag the column header and re-order them.

    The default header is not center aligned.  So I need custom header. I create my column header in code:

                   foreach (DataGridColumn col in theGrid.Columns)
                    {
                       Grid g = new Grid();                  
                        TextBlock txt = new TextBlock();
                        txt.Margin = new Thickness(5, 5, 5, 5);
                        txt.Text = col.Header;
                        txt.HorizontalAlignment = HorizontalAlignment.Center;
                        txt.VerticalAlignment = VerticalAlignment.Center;             
                        g.Children.Add(txt);
                        col.Header = g;                  
                    }

    The problem is when I create custom header, I can no longer re-order the columns. When I tried to drag the header I would get "Value does not fall within expected range" error. If I do not catch this error, it crashes.

     

     

     

     

    Sally Xu
    Software Engineer
    Aprimo, Inc

    Please remember to mark the replies as answers if they answered your question
  • samcov

    samcov

    Participant

    1673 Points

    719 Posts

    Re: DataGrid UI Bugs

    Jun 21, 2008 05:33 AM | LINK

    This isn't a bug, but does anyone else notice that when you click to sort the grid, it's VERY slow?

    Sam...

     

  • hangkous

    hangkous

    Member

    56 Points

    41 Posts

    Re: DataGrid UI Bugs

    Jun 21, 2008 07:28 AM | LINK

    Sorting is indeed very slow especially the first time. I have a 30x30 grid and it can take a couple of seconds for sorting. That's why (since there is no hourglass) I can accidently start multi sort operations and get Silverlight plugin to crash.

    Rick

    IdeaPlease remember to mark the replies as answers if they answered your question
  • sladapter

    sladapter

    All-Star

    43609 Points

    7910 Posts

    Re: DataGrid UI Bugs

    Jun 21, 2008 01:20 PM | LINK

    samcov

    This isn't a bug, but does anyone else notice that when you click to sort the grid, it's VERY slow?

     

    Yes, I've noticed that too.

     

    Sally Xu
    Software Engineer
    Aprimo, Inc

    Please remember to mark the replies as answers if they answered your question
  • sladapter

    sladapter

    All-Star

    43609 Points

    7910 Posts

    Re: DataGrid UI Bugs

    Jun 23, 2008 03:11 PM | LINK

    Found another one:

    DataGrid.SelectedIndex is always -1 no matter which row is selected.

    Sally Xu
    Software Engineer
    Aprimo, Inc

    Please remember to mark the replies as answers if they answered your question
  • sladapter

    sladapter

    All-Star

    43609 Points

    7910 Posts

    Re: DataGrid UI Bugs

    Jun 27, 2008 04:18 PM | LINK

     Another one:

    When clicking column header to sort, sometimes the whole grid (every row) become highlighted (like they are selected).

    Sally Xu
    Software Engineer
    Aprimo, Inc

    Please remember to mark the replies as answers if they answered your question
  • SpaceSlug

    SpaceSlug

    Member

    4 Points

    6 Posts

    Re: DataGrid UI Bugs

    Jun 27, 2008 04:51 PM | LINK

     I found that sometimes if you have lets say 50 items in the datagrid source and have to scroll to see all of the items, the datagrid scroller will stop before you get to see all of the items. If there are 50 total items sometimes I will get to like 47/48 and it will be at the very bottom of the scroller. Sometimes you can see part of 49 or 50 and if you click on it, it seems to fix the datagrid.

     Clicking the scroll bar on the right seems to make this happen more often than the up/down arrows for scrolling.

     -Eric