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

Highlight cell on hover

4 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 31 Oct 2008, 10:49 AM
Is there a way to highlight the cell you are currently hovering over?
Cheers,
Paul

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 31 Oct 2008, 11:18 AM
Hello Paul,

Please test the example project I created in order to illustrate a possible approach.

I hope it helps.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Princy
Top achievements
Rank 2
answered on 31 Oct 2008, 11:48 AM
Hello Paul,

You can also try out an alternative solution for the same scenario as shown below.
cs:
 protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem)      
       {       
                 
            GridDataItem dataItem = (GridDataItem)e.Item; 
            int length = dataItem.Cells.Count; 
            for (int i = 0; i <length ; i++) 
            { 
            dataItem.Cells[i].Attributes.Add("onmouseover", "this.style.backgroundColor = 'blue';"); 
            } 
        } 
    } 

Thanks
Princy.
0
Paul
Top achievements
Rank 1
answered on 31 Oct 2008, 12:40 PM
Thanks a lot Daniel and Princy, appreciate you help. Will try both solutions out and let you know how I get on.

From your solution Daniel, it appears that you have code in there to handle the onClick event of the cell as well, I will actually need that functionality as well so it looks promising.
0
Daniel
Telerik team
answered on 03 Nov 2008, 01:32 PM
Hello Paul,

Please let us know whether you managed to achieve the desired functionality or you need further assistance.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Princy
Top achievements
Rank 2
Paul
Top achievements
Rank 1
Share this question
or