Hi,
This is my third post since using new Prometheus controls (and that is only 2 weeks and only grid control). The first 2 problems are not yet solved and here is the new one.
I have a grid with check boxes and i do not want a user to be able to select a row if a check box is disabled, and i do not want a user to select a row by clicking on it and if the header check box is clicked i do not want the rows with disabled check boxes to be selected. It all worked in the previous rad grid like this:
and this is from the grid:
Now nothing works. I think i will go back to previous version.
This is my third post since using new Prometheus controls (and that is only 2 weeks and only grid control). The first 2 problems are not yet solved and here is the new one.
I have a grid with check boxes and i do not want a user to be able to select a row if a check box is disabled, and i do not want a user to select a row by clicking on it and if the header check box is clicked i do not want the rows with disabled check boxes to be selected. It all worked in the previous rad grid like this:
| <script type="text/javascript"> |
| var currentClickEvent = null; |
| function GridCreated() |
| { |
| var grid = this; |
| //non-ie click event capture |
| //the event handler will get fired *before* the row click event |
| //and we use that to cache the current event object |
| if (grid.Control.addEventListener) |
| grid.Control.addEventListener("click", GridTableClick, true); |
| } |
| function GridTableClick(e) |
| { |
| currentClickEvent = e; |
| } |
| //IE has a global event object. We get the previously cached event object for other browsers |
| function GetClickEvent() |
| { |
| return window.event || currentClickEvent; |
| } |
| //cancel all select/deselect operation triggered by non-checkbox row clicks |
| function CancelNonInputSelect(row) |
| { |
| var e = GetClickEvent(); |
| //IE - srcElement, Others - target |
| var targetElement = e.srcElement || e.target; |
| //is the clicked element a checkbox? <input type="checkbox"...> |
| if(targetElement.tagName.toLowerCase() != "input" && |
| targetElement.type.toLowerCase() != "checkbox") |
| { |
| //cancel the event |
| return false; |
| } |
| //clean up after all (de)selections are performed |
| window.setTimeout(function() { |
| currentClickEvent = null; |
| }, 0); |
| } |
| </script> |
and this is from the grid:
| <ClientSettings> |
| <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" ></Selecting> |
| <ClientEvents OnGridCreated="GridCreated" OnRowSelecting="CancelNonInputSelect" OnRowDeselecting="CancelNonInputSelect" /> |
| </ClientSettings> |
Now nothing works. I think i will go back to previous version.