Dear Sir:
I have a telerik gird and I would like to add tool tip in grid with add control during itemDataBound. it is ok for the static control in the grid template but if i try to dynamic add control with tool tip manager during grid itemDataBound and the tool tip didn't show up.
will you have any sample which i can follow or any correction for my coding?
Thank you very much for your support!
From Edmond
I have a telerik gird and I would like to add tool tip in grid with add control during itemDataBound. it is ok for the static control in the grid template but if i try to dynamic add control with tool tip manager during grid itemDataBound and the tool tip didn't show up.
will you have any sample which i can follow or any correction for my coding?
Thank you very much for your support!
From Edmond
protected void grdOwnerHistory_ItemDataBound(object sender, GridItemEventArgs e)
{
STEPS_AdditionalOwner_DataAdapter additionalDA = new STEPS_AdditionalOwner_DataAdapter();
STEPS_Client_DataAdapter clientDA = new STEPS_Client_DataAdapter();
if (e.Item is GridHeaderItem)
{
GridHeaderItem headerItem = (GridHeaderItem)e.Item;
}
else if (e.Item is GridDataItem)
{
GridDataItem dataItem = (GridDataItem)e.Item;
if (!Object.Equals(this.RadToolTipManager1, null))
{
RadToolTipManager1.TargetControls.Add(((HyperLink)dataItem["Owner_Name"].FindControl("lnkOwner_Name")).ClientID, "Owner_Name|" + dataItem["Owner_ID"].Text.Replace(" ", "").Replace("<
nobr
>", "").Replace("</
nobr
>", ""), true);
//((HyperLink)dataItem["Owner_Name"].FindControl("lnkOwner_Name")).Font.Underline = true;
DataSet ds = additionalDA.getAdditionalOwnerByTenureId(long.Parse(dataItem["Tenure_Id"].Text));
foreach (DataRow dRow in ds.Tables[0].Rows){
DataSet clientDS = clientDA.GetClientById(CommonFunction.ConvertIDToInt64( dRow["Owner_Id"]), long.Parse(this.employeeId));
string clientName;
if (clientDS.Tables[0].Rows.Count > 0){
clientName = clientDS.Tables[0].Rows[0]["Rn_Descriptor"].ToString();
HyperLink link = new HyperLink();
link.Text = clientName;
RadToolTipManager1.TargetControls.Add(link.ClientID, "Owner_Name|" + dRow["Owner_Id"].ToString(), true);
dataItem["Owner_Name"].Controls.Add(link);
}
}
}
}
}