Hi:
It is possible to display ToolTip in the data? The aim is to display additional information.
Similar to "http://documentation.devexpress.com/#Xaf/CustomDocument3165", but it not the columns, if not the data.
Sorry my bad English
Thanks
Ricardo
We have closed this ticket because another page addresses its subject:
How to create an ASPxGridView cell tooltip with values from other datacolumn?ASPxGridListEditor: ToolTip in Data
Answers
Hi Ricardo,
The View.CurrentObject is usually Null in a web list view. Please use the ASPxGridView.GetRowValues method to access other column values, and pass the current row visible index to it. This method retrieves values directly from the data object even if there's no column for that field. Please try the following code (in MainDemo):
Visual BasicPublic Class MyController
Inherits ViewController
Public Sub New()
TargetObjectType = GetType(Contact)
TargetViewType = ViewType.ListView
End Sub
Protected Overrides Sub OnViewControlsCreated()
MyBase.OnViewControlsCreated()
Dim editor As ASPxGridListEditor = TryCast((CType(View, ListView)).Editor, ASPxGridListEditor)
If editor Is Nothing Then
Return
End If
AddHandler editor.Grid.HtmlDataCellPrepared, AddressOf Grid_HtmlDataCellPrepared
End Sub
Private Sub Grid_HtmlDataCellPrepared(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs)
Dim grid As ASPxGridView = CType(sender, ASPxGridView)
If e.DataColumn.FieldName = "Email" Then
e.Cell.Attributes.Add("title", Convert.ToString(grid.GetRowValues(e.VisibleIndex, new string[] { "TitleOfCourtesy" })));
End If
End Sub
End Class
If you are experiencing difficulty using this approach in your project, please post it to us. We'll be happy to assist you.
Thanks,
Michael.
Hi Ricardo,
You can implement cell tooltips for ASPxGridView control as described in issue How to create an ASPxGridView cell tooltip with values from other datacolumn?.
Please try this solution, and let us know if this helps.
Thanks,
Michael.
Ok, Thanks
Hi:
I can now add ToolTip to data, but not how to access other fields of view:
Dim a As String = CType(View.CurrentObject, ArchivoAdjunto).ArchivoAdjuntoNotas.ToString
e.Cell.Attributes.Add("title", "Notas:" & a)
This does not work, it gives me error "CType(View.CurrentObject, ArchivoAdjunto).ArchivoAdjuntoNotas.ToString) NullReferenceException".
Can you help me to get the information from another column in the view?
NOTE: The field "ArchivoAdjuntoNotas" is not visible in the view, exists in the database and have information, but is not visible in the current view
Thanks.
Ricardo Hidalgo