private void CreateToolTip()
{
GridDataItem DataItem;
int iPageIndex = rgSNLoc.CurrentPageIndex;
int iPageSize = rgSNLoc.MasterTableView.PageSize;
int iFactor = iPageIndex * iPageSize;
for (int i = iFactor; i < rgSNLoc.MasterTableView.Items.Count + iFactor; i++)
{
DataItem = rgSNLoc.MasterTableView.Items[i - iFactor] as GridDataItem;
if (sMultiAddr[i].Length == 1)
{
DataItem["loc_name"].ToolTip = sMultiAddr[i][0];
}
else
{
for (int j = 0; j < sMultiAddr[i].Length; j++)
{
if (j == sMultiAddr[i].Length - 1)
DataItem["loc_name"].ToolTip = sMultiAddr[i][j];
else
DataItem["loc_name"].ToolTip = sMultiAddr[i][j] + "\n\n";
}
}
}
}
I wrote the above function and put it in the "PreRender" event handler of the RadGrid. What I want to do is to assign a unique tooltip to each row of a specified column in the grid, and the tooltip will still exist correctly even the user change the page size or switch to another page of the grid dynamically. However, if the user sort on a column, the value of the tooltips will become wrong. So how can I keep the tooltips correctly in this case? Thanks.