Ticket Q269814
Visible to All Users
Duplicate

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

created 15 years ago

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

Comments (3)
DevExpress Support Team 15 years ago

    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

        Answers

        created 15 years ago

        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 Basic
        Public 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.

          Comments (1)

            Ok, Thanks

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.