I've done it with a Web datagrid. The grid has a value column that's
hidden and a button that's visible. If the value column is empty it
shows the button. If the value is there it shows who pressed the button
and the tooltip is shown if notes were attached. In the ItemDataBound
event I get the underlying data to use to make desicions. I create a
label control on the fly and use it's ToolTip to show the tooltip. I
also wanted a different cursor so that's there also.
private void dgBids_ItemData Bound(object sender,
System.Web.UI.W ebControls.Data GridItemEventAr gs e)
{
if((e.Item.Item Type.ToString() == "Item" || e.Item.ItemType .ToString()
== "AlternatingIte m") || e.Item.ItemType .ToString() == "EditItem")
{
DataRowView drv = (DataRowView)e. Item.DataItem;
string sRejected = e.Item.Cells[5].Text.Trim().Re place(" ", "");
Button btnDis = (Button)e.Item. Cells[6].Controls[0];
if(sRejected.Le ngth == 0 || sRejected.Equal s("0"))
{
btnApp.Visible = false;
Label lb = new Label();
lb.Text = "Appr. by " + drv.Row["Approver"].ToString();
string tt = drv.Row["SupervisorNote s"].ToString();
if(tt.Length)
{
lb.ToolTip = tt;
lb.Style.Add("c ursor","url('co mment.cur')");
}
e.Item.Cells[4].Controls.Add(l b);
}
}
}
Hope that Helps
*** Sent via Developersdex
http://www.developersdex.com ***