This is a migrated thread and some comments may be shown as answers.
How to turn off selected row style on MouseOver with .Selectable()
2 Answers 57 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 20 Jul 2010, 01:01 PM
Hi,

We use the ClientEvent OnRowSelected to set a checkbox in our grid. This event is only triggered when .Selectable() is set. Selectable causes a selected row style on mouseover which taxes the CPU and does not fit our design. Also the font goes bold which causes a change in layout. For instance the command buttons can be aligned underneath each other instead of next to each other on the selected row. 

Is there a way we can have the OnRowSelected event without the row selected style?

Thanks in advance.




2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 21 Jul 2010, 07:01 AM
Hi Henrik van den Berge,

If you just want the click event you can implement it like this:

<%= Html.Grid()
        .Name("Grid")
        .ClientEvents(events => events.OnLoad("Grid_onLoad"))

%>
<script type="text/javascript">
function Grid_onLoad() {
   $('#Grid tr:not(.t-grouping-row').live('click', function (e) {
            var row = this;
            //Your code here
    });
}
</script>
Then disable the Selectable() feature.

Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Paul
Top achievements
Rank 1
answered on 22 Jul 2010, 11:57 AM
Fantastic, This solves our problem!

There was a little typo, a parenthesis missing in this line:
$('#Grid tr:not(.t-grouping-row)').live('click', function (e) {



Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Paul
Top achievements
Rank 1
Share this question
or