Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
659
WebGrid with AllowUpdate=false, allow selection of text inside a cell
posted

Hi all,

is there a way to allow the selection of text inside a cell if the AllowUpdate is set to false?

Parents
No Data
Reply
  • 2677
    posted

    If you have AllowUpdate set to False, you will not be able to select the text within the cells.  This is because you can't enter edit mode and therefore you cant select anything because by default, the grid will steal the mouse events to process row activation/selection etc.  So, the only way to get around this is to disable some javascript events from the grid.  Here is the snippet below. 

    window.onload = function()    {        document.getElementById('UltraWebGrid1_main').onmouseup = null;        document.getElementById('G_UltraWebGrid1').onselectstart = null;        document.getElementById('G_UltraWebGrid1').onmouseover = null;    }

    Add this code to your javascript region (change UltraWebGrid1 to the name of your grid) and you will see that you can select all the text as a normal html table.  However, this workaround does come with some limitations.  Now there will be no concept of an active row or selected cells/rows.  Aside from that, this should give you what you want.

Children