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.
And I also have a question about DateTimePicker. Is there any function can validate the format of the input date? The problem is that even I type this "abcde" in the input area of the DateTimePicker, it still let me go when I out-focus the DateTimePicker. Thanks.