This is a migrated thread and some comments may be shown as answers.

Lost Primary key value after filter radgrid

3 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Abdulaziz Bekr
Top achievements
Rank 1
Abdulaziz Bekr asked on 10 Oct 2012, 11:48 AM
Dear all

I have radgrid to show all student information (Data key:student_id) and i use radtooltip to show details information about this student , but the problem hapen after filter my radgrid when mose move over any row the radtooltip retrive wrong information about student , the radtooltip use the previous primary key like before filter

here simulation example

before filter

student_id       Name
A1                    A
A2                    B
A3                    C
A4                    D
A5                    E
A6                    F



After filter

student_id            Name
A5                           E
A6                           F


when mouse move over A5   the radtooltip show A1  and when mouse move over A6 the radtooltip show A2

also the code to retriev primary key to radtooltip is

Protected Sub OnAjaxUpdate(sender As Object, args As ToolTipUpdateEventArgs)
       Me.UpdateToolTip(args.Value, args.UpdatePanel)
   End Sub
 
 
 
Private Sub UpdateToolTip(elementID As String, panel As UpdatePanel)
       
       Dim ctrl As Control = Page.LoadControl("../Class_Details.ascx")
       Session("center_id") = elementID
       panel.ContentTemplateContainer.Controls.Add(ctrl)
   End Sub


how to solve this problem



3 Answers, 1 is accepted

Sort by
0
Abdulaziz Bekr
Top achievements
Rank 1
answered on 11 Oct 2012, 02:34 AM
Any idea
0
Martin
Top achievements
Rank 1
answered on 05 Nov 2012, 02:09 PM
HI,

Did you find the solution to this?
0
Vasil
Telerik team
answered on 08 Nov 2012, 08:28 AM
Hello,

Seems that you are passing ItemIndex to the ToolTip instead of the PrimaryKey of the record.

You can add a column to the grid that to holds the Primary Keys, or you can set the PrimaryKey field as ClientDataKeyNames for your table view. When you need to open the ToolTip use the value from this field.

Check this demo, it is not with RadGrid, but the logic is similar:
http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltiptreeview/defaultcs.aspx?

Greetings,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Abdulaziz Bekr
Top achievements
Rank 1
Answers by
Abdulaziz Bekr
Top achievements
Rank 1
Martin
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or