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

Hide/Show toolbar on GridColumn template

3 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Avidan
Top achievements
Rank 1
Avidan asked on 04 Nov 2010, 02:01 PM
Hi,

How do I show a Toolbar placed on a GridTemplate column on item row selection (client) and hide it on item row deselection (client-side)?

Avidan

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Nov 2010, 02:11 PM
Hello Avi,


Attach OnRowSelected client event and get the GridDataItem client object in the event handler. Now use the findControl() method to get reference to the RadToolBar. Now hide the RadToolBar from client code.

Hope this helps.


-Shinu.
0
Avidan
Top achievements
Rank 1
answered on 07 Nov 2010, 10:30 AM
Shinu

I used a RadMenu instead of RadToolBar.  The RadMenu has CssClass that set it's Display property to 'none' (disabled)

I followed your instructions, I was able to get a reference to the RadMenu control, but I was unable to show or hide it.

At the "OnRowSelected" event handler I use the following to show the control. (rowMenu is var referenced to the RadMenu control)

rowMenu.get_element().style.display =

"";

 



 

At the "OnRowDeselected" event handler I use the following to show the control.

rowMenu.get_element().style.display = "none";

 


 


at any case the RadMenu remains hidden.
0
Avidan
Top achievements
Rank 1
answered on 07 Nov 2010, 11:39 AM
I found a solution but it is not so fency.

I removed the Css from the RadMenu and added OnRowCreated event handler (for the RadGrid) to hide the RadMenu control.

Avidan
Tags
Grid
Asked by
Avidan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Avidan
Top achievements
Rank 1
Share this question
or