GrapeCity Forums

The GrapeCity Message Boards
Welcome to GrapeCity Forums Sign in | Join | Help
in Search

note in row header

Last post 02-11-2010, 3:54 AM by Ankit_Nigam. 7 replies.
Sort Posts: Previous Next
  •  03-23-2006, 6:42 PM 30998

    Sad [:(] note in row header

    although in documentation, it says "can't set note in the row/column header".

    is it possible that when user mouse over a row header, we display a "note" just like cell note?

    thanks,
  •  03-24-2006, 10:47 AM 31029 in reply to 30998

    Re: note in row header

    Hello,

    Sure, You can assign a title attribute to the TableCell that is the column header. The easiest way to do this is creating a custom celltype to assign to the header.

      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If IsPostBack Then Return

        FpSpread1.Sheets(0).ColumnHeader.Cells(0, 1).CellType = New myHeader

      End Sub

     


     

    <Serializable()> Public Class myHeader

      Inherits FarPoint.Web.Spread.GeneralCellType

      Public Overrides Function PaintCell(ByVal id As String, ByVal parent As System.Web.UI.WebControls.TableCell, ByVal style As FarPoint.Web.Spread.Appearance, ByVal margin As FarPoint.Web.Spread.Inset, ByVal value As Object, ByVal upperLevel As Boolean) As System.Web.UI.Control

        parent.Attributes.Add("title", "Col 1")

        Return MyBase.PaintCell(id, parent, style, margin, value, upperLevel)

      End Function

    End Class


     

    Scott S.
    Product Manager, Spread ASP.NET
    GrapeCity FarPoint
  •  02-08-2010, 6:21 PM 87162 in reply to 31029

    Re: note in row header

    Hi Scott!!

    I am able to create the tool tip for the column header but its lost when we go to next page. Is there a way to retain the tool tip on paging.

    Thanks,

    Rakesh 

     

     

  •  02-09-2010, 6:04 AM 87173 in reply to 87162

    Re: note in row header

    Hello,

    Are you using the code provided by Scott in the previous post? Using the above code you can retain the tool tip for a column on paging.

    Regards,
    Ankit Nigam

  •  02-09-2010, 1:07 PM 87188 in reply to 87173

    Re: note in row header

    Hi Ankit!!

    Actually I am using little bit modified version of Scott's code which is as follows.

    <Serializable()> _

    Public Class ColHeaderToolTip

    Inherits FarPoint.Web.Spread.GeneralCellType

    Private message As String

    Private Sub New()

    MyBase.New()

    End Sub

    Public Sub New(ByVal mess As String)

    MyBase.New()

    message = mess

    End Sub

    Public Overloads Overrides Function PaintCell(ByVal id As String, ByVal parent As System.Web.UI.WebControls.TableCell, ByVal style As FarPoint.Web.Spread.Appearance, ByVal margin As FarPoint.Web.Spread.Inset, ByVal value As Object, ByVal upperLevel As Boolean) As System.Web.UI.Control

    parent.Attributes.Add("title", message)

    Return MyBase.PaintCell(id, parent, style, margin, value, upperLevel)

    End Function

    End Class

    The reason why I am doing this is so I don't have to create a different class for each Column header.  I have 70 cols in my grid and they all need a header tool tip.

    Thanks,

    Rakesh

     

     

     

     

  •  02-10-2010, 7:42 AM 87204 in reply to 87188

    Re: note in row header

    Hello,

    I was able to replicate the issue at my end. I have submitted it as a bug 99914361. It should get fixed in next maintenance release.

    Regards,
    Ankit Nigam

  •  02-10-2010, 2:02 PM 87212 in reply to 87204

    Re: note in row header

    Thanks,

    Rakesh

     

  •  02-11-2010, 3:54 AM 87219 in reply to 87212

    Re: note in row header

    Hello Rakesh,

    Please disregard the case number I had provided you. Spread for ASP.NET uses XML serialization, by default, to store State. Since this class has a property that Spread can not use XML serialization to store, then the property will be lost between postbacks.

    So to achieve the desired results can do one of two things:

    You can either reset the CellType on the ColumnHeader on every postback.
    Or
    You can have Spread use binary serialization on this class and then the property will be saved between postbacks. To implement this, you would need to implement the ICanSerializeXML interface and return False to the CanSerializeXML property. Here is how the class will look:

    <Serializable()> _
    Public Class ColHeaderToolTip
          Inherits FarPoint.Web.Spread.GeneralCellType
          Implements FarPoint.Web.Spread.Model.ICanSerializeXml

    Private message As String

    Private Sub New()
           MyBase.New()
    End Sub

    Public Sub New(ByVal mess As String)
          MyBase.New()
          message = mess
    End Sub

    Public Overloads Overrides Function PaintCell(ByVal id As String, ByVal parent As System.Web.UI.WebControls.TableCell, ByVal style As FarPoint.Web.Spread.Appearance, ByVal margin As FarPoint.Web.Spread.Inset, ByVal value As Object, ByVal upperLevel As Boolean) As System.Web.UI.Control

    parent.Attributes.Add("title", message)
    Return MyBase.PaintCell(id, parent, style, margin, value, upperLevel)

    End Function

    Public ReadOnly Property CanSerializeXml() As Boolean Implements FarPoint.Web.Spread.Model.ICanSerializeXml.CanSerializeXml
        Get
    Return False
        End Get
    End Property

    End Class


    Regards,
    Ankit Nigam

View as RSS news feed in XML
     FarPoint Forums Home