Hi:
I have a RadListView with some items. When one of the item is clicked a tooltip will appear corresponding to the item's position with detail info from an usercontrol (the tooltip's content is an usercontrol). This requires setting the "TargetControlID" when the listview item is clicked. Because the listview item is in a template, to distinquish each item when many items show at the same time can be done by including the item inside a div html element. And the selected item div can be obtained by onmouseDown event target. Since the content of tooltip is an usercontrol, and is a update target of ajaxmanager triggered by listview, I have to load it from server side. It ends up with setting TargetControlID on client side with set_targetControlID and show Tooltip on server side as demonstrated in the attached program fragment. I checked value of TargetControlID from client side in debug, value set accordingly, but tooltip displayed in wrong position. I checked TargetControlID from server side right before SHOW(), found out the value has not changed. I made sure set_targetControlID() happend before SHOW(). I even try to use set_title("test title") just for testing purpose, not thing happened on the server side. Some one please help. Thanks.
This is the RadToolTip declaration:
<telerik:RadToolTip ID="RadToolTip1" runat="server" Animation="FlyIn"
EnableShadow="True" HideEvent="ManualClose"
ManualCloseButtonText="关闭" ShowEvent="FromCode" Width="268px" IsClientID="True">
<asp:PlaceHolder ID="PlaceHolder1" runat="server" />
<br />
</telerik:RadToolTip>
This is the client script:
function SetTooltipControlID() {
var radToolTip = $find("<%= RadToolTip1.ClientID %>");
radToolTip.set_targetControlID("");
radToolTip.set_targetControlID(curItem.id);
radToolTip.set_title("this is a title"); //for testing purpose
}
This is the server code:
protected void lvwItemPictures_SelectedIndexChanged(object sender, EventArgs e)
{
string item = lvwItemPictures.SelectedItems[0].GetDataKeyValue("PLUCODE").ToString();
string title = lvwItemPictures.SelectedItems[0].GetDataKeyValue("TITLE").ToString();
CurrentItemCode = item;
this.RadToolTip1.Show(); // checked RadToolTip1 properties here. Any change made in client code is not reflected.
LoadUserControl(PlaceHolder1, CurrentControl, true);
}