Error icon tooltip not visible when editing a cell

Hi,

I copy/paste the code from the DatagridView FAQ "How do I show the error icon when the user is editing the cell " but the errorTooltip isn't diplayed when the user move the cursor over the error icon (but the CPU is 100% !!!!)

I'm using a datagridview bounded to a dataview

Any idea

Thanks for your help





Answer this question

Error icon tooltip not visible when editing a cell

  • DBAMANI

    You'll need to calculate the bounds for where you are drawing the error icon and return that rectangle/bounds in your override.

    -mark

    DataGridView Program Manager

    Microsoft

    This post is provided "as-is"


  • Jeff Beranek

    That is correct. To correctly show the error icon and have the tooltip correctly show when its over the icon you'll need to create a custom DataGridViewCell that overrides GetErrorIconBounds. Without doing this, the grid still thinks the error icon is under the editing control.

    -mark

    DataGridView Program Manager

    Microsoft

    This post is provided "as-is"


  • Lada Sobr

    It is by design that the error icon doesn’t not appear when editing a cell, so this isn't a bug. In the DataGridView FAQ I have some simple code that shows how to show the error icon for the editing a cell. What my code doesn't help with is the tooltip that appears.

    -mark

    DataGridView Program Manager

    Microsoft

    This post is provided "as-is"


  • MiniSong

    Hi Mark,

    I have tried to override the GetErrorIconBounds method but what should I do in the overrided method
    Thanks for your answer

    Regards

    Stephane


    private class customDataGridViewCell : DataGridViewCell
    {
    protected override Rectangle GetErrorIconBounds(Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
    {
    return base.GetErrorIconBounds(graphics, cellStyle, rowIndex);
    }

    }




  • Alexei Baskakov

    Yes – there are some issues with the tooltip and the operating system where the tooltip loses its z-order top-most. We have filed a bug on the Windows team, but they do not have plans to fix it since it doesn’t always happen.

    -mark

    DataGridView Program Manager

    Microsoft

    This post is provided "as-is"


  • Valdimar

    So, it's necessary to override the GetErrorIconBounds method because it doesn't work out of the box

    If so, at least provide some example code. Will this error be fixed in a later release of the .NET runtime


  • Jivesh

    Actually, I understand that the error icon doesn't show up by design - my problem (and still is) is that the tooltip that shows up when you hover on the error icon is UNDERNEATH the form. I see no way to change the z order of the tooltip. I can't bring it forward, and If I send the datagrid backward it doesn't help, but then again I can't send it behind the form where the tooltip pops up anyways. It doesn't seem like this behavior could possibly be by design...

    I am not doing anything abnormal with the form, it's just an unbinded datagridview control, and I am setting the row errortext on the cellvalidating callback. It all works, but like I said the tooltip pop up underneath the main form...

    Setting the main form to topmost seems to 'fix' the situation, but that is not an acceptable kludge.

    Any help would be greatly appreciated.

    Thanks!


  • Error icon tooltip not visible when editing a cell