This is a migrated thread and some comments may be shown as answers.

Row Tooltip disappears on edit

3 Answers 60 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Morgan McCollough
Top achievements
Rank 1
Morgan McCollough asked on 19 Jul 2010, 09:28 PM
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);
                }
            }
        }

3 Answers, 1 is accepted

Sort by
0
Morgan McCollough
Top achievements
Rank 1
answered on 19 Jul 2010, 09:42 PM
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...
0
Accepted
Yavor Georgiev
Telerik team
answered on 20 Jul 2010, 01:31 PM
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
0
Morgan McCollough
Top achievements
Rank 1
answered on 30 Jul 2010, 03:52 PM
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.
Tags
GridView
Asked by
Morgan McCollough
Top achievements
Rank 1
Answers by
Morgan McCollough
Top achievements
Rank 1
Yavor Georgiev
Telerik team
Share this question
or