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

How to make a button appear in a cell when a row is moused over?

2 Answers 27 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Brian Sayatovic
Top achievements
Rank 1
Brian Sayatovic asked on 20 Feb 2012, 03:45 PM
I'd like to have button/icon appear in a cell (either it's own cell, or within an existing cell with a composite template) when the row it is in is moused over.  I've seen a lot of web applications do this trick, but I'm trying to mimic it in Silverlight.

Has anyone done this or have an idea how to pull it off?

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 21 Feb 2012, 09:29 AM
Hello Brian,

 

You may predefine the template of GridViewCell to achieve your goal.
I am attaching you sample application which demonstrates how this can be achieved. 
Will you verify how this corresponds to your needs? 




 

Kind regards,
Vanya Pavlova
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Brian Sayatovic
Top achievements
Rank 1
answered on 21 Feb 2012, 03:33 PM
Not quite, but I'll take some time to dig deeper.

My cell template is essentially going to be a two-column grid (widths * and 20), where the first is a textblock holding a name and the second is more special.

I want it to be an icon based on a value of the data item, or blank.  But, when the row (or cell if I must limit myself to that) is hovered over, it needs to be a menu with a drop-arrow (click it to reveal options you can perform -- similar to a right-click context menu).  I figure I can use a menu where the label content is an icon and alter it's border to be invisible or visible, or perhaps a dropdown button similarly.

What I can't figure out is how to leverage the focus/mouseover state of the row/cell to alter the visual appearance of an item in thecell template.
Tags
GridView
Asked by
Brian Sayatovic
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Brian Sayatovic
Top achievements
Rank 1
Share this question
or