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

Grid Column Resizing Tooltip

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 09 Aug 2012, 01:34 PM
Hello,

I am have currently added the following piece of JavaScript to the Column Resizing Event of a RadGrid I am using:

function ColumnResizing(sender, args)
{
    if (args.get_gridColumn()._columnResizer._currentWidth < 60)
    {
        args.set_cancel(true);
    }
}

It works so far, but now I would also like the "tool tip", which appears during the resizing and displays the exact width of the column, to stop at 60px. Is it possible to access the tool tip and set it's text in the code above, and would that work out as intended?

Thanks in advance,
Robin

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 10 Aug 2012, 05:55 AM
Hi Robin,

Please try the following Javascript to give your own ToolTip while resizing the column. Set the EnableRealTimeResize to true.

ASPX:
<ClientSettings>
    <Resizing AllowColumnResize="true" EnableRealTimeResize="true"/>
    <ClientEvents OnColumnResizing="ColumnResizing" />
</ClientSettings>

Javascript:
<script type="text/javascript">
    function ColumnResizing(sender, args)
    {
        args.get_gridColumn()._columnResizer._resizerToolTipFormatString = "Your tool tip here: Width: <strong>{0}</strong> <em>pixels</em>";
        if (args.get_gridColumn()._columnResizer._currentWidth < 60) {
            args.set_cancel(true);
        }
    }
</script>

Thanks,
Princy.
Tags
Grid
Asked by
Robin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or