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

Open pop up with additional data

2 Answers 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 21 Jun 2016, 03:44 PM

Hi

Looking for some direction here:

I have a grid that I bind with data, and I have an imageButton control that I want to use to open a pop up with more data, but I don't want to do another database call, so the data in the pop up must be bound when the grid binds.

Any ideas / examples on how to achieve this.

Andy

 

 

2 Answers, 1 is accepted

Sort by
0
Andy Green
Top achievements
Rank 2
answered on 22 Jun 2016, 11:32 AM

Hi

Further to this I have a near working solution using your examples here: http://demos.telerik.com/aspnet-ajax/tooltip/examples/databasetooltipswithoutlod/defaultcs.aspx

 

All I need to achieve this is to change the target from the row, to an image button in the grid, and use its onClick event.

This is the JS from the example:

(function (global, undefined) {
var affectedSessions = global.affectedSessions = {
createContent: function (sender, args) {
//copy the content first to allow the browser to cache the image
sender.set_content($get("ttipContent").innerHTML);
var dataKeys = sender.get_value().split("|");
var ttipParent = sender.get_popupElement();
$get("idHolder", ttipParent).innerHTML = dataKeys[0];
$get("nameHolder", ttipParent).innerHTML = dataKeys[1];
$get("locationNameHolder", ttipParent).innerHTML = dataKeys[2];
$get("startHolder", ttipParent).innerHTML = dataKeys[3];
$get("endHolder", ttipParent).innerHTML = dataKeys[4];
}
}
})(window);

And the Markup from the desired target button:

<telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="ViewSessions" ><HeaderStyle Width="1px" /><ItemStyle Width="1px" /></telerik:GridButtonColumn>

How could I achieve this?

Andy

0
Andy Green
Top achievements
Rank 2
answered on 23 Jun 2016, 08:01 AM

Hi

I have this working now, for the community what I did was very simple, I get a handle on the image button:

ImageButton ShowSessions = (ImageButton) RowDataItem["ViewSessions"].Controls[0];

And in the code behind changed the ID of the target:

this.RadToolTipManager.TargetControls.Add(ShowSessions.ClientID, ttipValue, true);

 

Andy

Tags
Grid
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Andy Green
Top achievements
Rank 2
Share this question
or