I hide the default ExpandCollapseColumn and create my own custom column using GridExpandColumn. My customed column is called "btnExpandColumn".
I use following code to hide/show my custom column, but for some reason, it doesn't allow me to change the tooltip text.
I assume to change the tooltip text, I just need to use:
col.ToolTip = "My custom text";
Is it correct?
protected void rgPatientList_PreRender(object sender, EventArgs e)
{
foreach (GridColumn col in rgPatientList.MasterTableView.RenderColumns)
{
if (col.UniqueName == "ExpandColumn")
{
col.Display = false;
}
}
foreach (GridDataItem dataItem in rgPatientList.Items)
{
GridImageButton btn = (GridImageButton)dataItem["btnExpandColumn"].Controls[0];
if (!dataItem.Expanded)
{
btn.Visible = true;
}
else if (dataItem.Expanded)
{
btn.Visible=false;
}
}
}