Hi Suren,
Unfortunately, disable text selection on double click is one of those things
that is hard to prevent across all browsers. I tried a couple of
implementations to disable text selection on double-click, but neither of
them worked.

However, you can use an onselectstart='return false;' attribute which does
seem to work on IE6/7 and Chrome (see code snippet below). Although this
works on Chrome (which is WebKit-based), you'll have to try it out on Safari
to see if it works there as well. This definitely doesn't work on FF3, so
that may hinder your decision to depend on the onselectstart attribute for
text selection prevention.

HTMLPanel panel = new HTMLPanel("<div id='grid' onselectstart='return
false;'></div>");
    Grid grid = new Grid(10, 10);
    for (int i = 0; i < 10; i++) {
      for (int j = 0; j < 10; j++) {
        grid.setText(i, j, "Bonjour");
      }
    }
    panel.add(grid, "grid");

As a sidenote, you may not necessarily want to disable text selection in the
grid, however. It's generally not a good idea to go against standard browser
functionality that users may have grown accustomed to in their web browsing
experience.

Hope that helps,
-Sumit Chandel

On Wed, May 27, 2009 at 8:00 PM, Suren <[email protected]> wrote:

>
> Hi All,
>
> I am having a grid with 100 columns. Among these certain columns are
> meant for readonly purpose. For these columns I want to disable the
> text selected when user tries to double click on that cell.
>
> Currently when a user double click any cell in the Grid, the text get
> selected with blue background. I want to disable this functionality
> for certain cells / entire columns.
>
> Can anyone help me in this regards
>
> Thanks
> Suren
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to