|
|
note in row header
Last post 02-11-2010, 3:54 AM by Ankit_Nigam. 7 replies.
-
-
03-24-2006, 10:47 AM |
-
scotts
-
-
-
Joined on 02-20-2003
-
-
Posts 21,103
-
-
|
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 |
-
Rakesh_P
-
-
-
Joined on 06-23-2009
-
-
Posts 48
-
-
|
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 |
-
02-09-2010, 1:07 PM |
-
Rakesh_P
-
-
-
Joined on 06-23-2009
-
-
Posts 48
-
-
|
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 |
-
02-10-2010, 2:02 PM |
-
02-11-2010, 3:54 AM |
-
Ankit_Nigam
-
-
-
Joined on 12-15-2009
-
-
Posts 77
-
-
|
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
|
|
FarPoint Forums Home
|
|
|