I have problem with using ToolTip & Grid
First i have function to update the grid and i will call at page load (not postback)
First i have function to update the grid and i will call at page load (not postback)
| Protected Sub UpdateGV() |
| cmd = New SqlCommand("Select * From View_DIS_GROUP Order By SEQ") |
| Me.RadGrid1.MasterTableView.DataKeyNames = New String() {"UID"} |
| Update_GV_Global(cmd, Me.RadGrid1) |
| 'rebind will add ToolTip again |
| Me.RadToolTipManager1.TargetControls.Clear() |
| Me.RadGrid1.MasterTableView.GetColumnSafe("UID").Visible = False |
| Me.RadGrid1.MasterTableView.GetColumnSafe("GROUP_NAME").HeaderText = "群組名稱" |
| Me.RadGrid1.MasterTableView.GetColumnSafe("SEQ").HeaderText = "次序" |
| Me.RadGrid1.MasterTableView.GetColumnSafe("counter").HeaderText = "群組人數" |
| Me.RadGrid1.Rebind() |
| End sud |
and also i will call it in Sorting
| Protected Sub RadGrid1_SortCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridSortCommandEventArgs) Handles RadGrid1.SortCommand |
| UpdateGV() |
| End Sub |
i adding tooltip at ItemDataBound
| Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound |
| If TypeOf e.Item Is GridDataItem Then |
| Me.RadToolTipManager1.TargetControls.Add(dataItem("counter").ClientID, dataItem("UID").Text, True) |
| end if |
| End Sub |
i find that if i sort the data in the Grid ,The tooltip will going wrong context.
Like:
First Page Load
Grid Item/ ToolTip Context
1 1
2 2
3 3
4 4
5 5
*Context Match
First Sort
Grid Item/ ToolTip Context
5 1
4 2
3 3
2 4
1 5
*Context Wrong
Second Sort
Grid Item/ ToolTip Context
1 5
2 4
3 3
4 2
5 1
*Context Wrong but match first sort
Can anyone help me? Thanks!