Row Tooltip disappears on edit

4 posts, 1 answers
  1. Morgan McCollough
    Morgan McCollough avatar
    34 posts
    Member since:
    May 2010

    Posted 19 Jul 2010 Link to this post

    I'm wondering if someone could help me out. I have a RadGridView set up that displays row tooltips with error/warning information. The tooltips work just fine initially, but once the user changes anything in the row the tooltip disappears for some reason. I followed the example in the documentation to add tooltips to the rows, and there is nowhere else in the code where I am doing anything with tooltips. There must be something I am missing. I have confirmed it has nothing to do with my data because the same thing happens with tooltips that contain nothing but a constant string literal.

    I'm using Telerik Controls for Silverlight 4, version 2010.1.702.1040. Any help or insight you could provide would be much appreciated.

    void BaseDataGrid_RowLoaded(object sender, RowLoadedEventArgs e)
            {
                if (!(e.Row is GridViewNewRow) && !(e.Row is GridViewHeaderRow))
                {
                    Binding rowBgBind = new Binding("StoredErrors");
                    rowBgBind.Mode = BindingMode.OneWay;
                    rowBgBind.Converter = new RowColorErrorConverter();
                    e.Row.SetBinding(GridViewRowItem.BackgroundProperty, rowBgBind);
                    ToolTip toolTip = new ToolTip()
                    {
                        Content = e.Row.DataContext,
                        ContentTemplate = (DataTemplate)BaseDataGrid.Resources["RowToolTip"]
                    };
                    ToolTipService.SetToolTip(e.Row, toolTip);
                     
                    foreach (var cell in e.Row.Cells)
                    {
                        Binding cellBgBind = new Binding("StoredErrors");
                        cellBgBind.Mode = BindingMode.OneWay;
                        cellBgBind.Converter = new CellColorErrorConverter();
                        cellBgBind.ConverterParameter = cell.Column.UniqueName;
                        cell.SetBinding(GridViewCellBase.ForegroundProperty, cellBgBind);
                    }
                }
            }

  2. Morgan McCollough
    Morgan McCollough avatar
    34 posts
    Member since:
    May 2010

    Posted 19 Jul 2010 Link to this post

    Hmm. This seems to be a bug. If I get the tooltip using the ToolTipService in the RowEditEnded event, the tooltip is null. If I add the tooltip again in the RowEditEnded event it seems to work and I see the tooltip as expected...
  3. DevCraft banner
  4. Answer
    Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 20 Jul 2010 Link to this post

    Hello Morgan McCollough,

     This behavior occurs, because we use the tooltip to present validation result. To preserve your custom tooltip, you need to handle the RowValidated event like so:

    void radGridView1_RowValidated(object sender, GridViewRowValidatedEventArgs e)
    {
        e.Handled = true;
    }

    Sincerely yours,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Morgan McCollough
    Morgan McCollough avatar
    34 posts
    Member since:
    May 2010

    Posted 30 Jul 2010 Link to this post

    That makes sense. Thanks!

    It would probably help a great deal if you put that in the documentation where it gives the example of adding a row tooltip. Just a suggestion. Thanks again.
Back to Top