We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

CellCommentTips in VirtTreeGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

34807 Sep 16,2005 05:16 AM Sep 19,2005 06:20 AM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On September 16, 2005 05:16 AM

Hi, I''ve taken the VirtTreeGrid sample, and added some validation of the cell value during GridSaveCellInfo. What I now want to do is display a cell comment tip if the validation fails. What I want to do is store the validation message in a hash during GridSaveCellInfo, then display it during GridQueryCellInfo . I''ve tried taking code from the CellCommentTip sample, and adding it to GridQueryCellInfo , but I seem to end up in a infinite loop. The code I added was something like: Dim style As New ExcelTipDLL.GridExcelTipStyleProperties(Me.Grid(e.RowIndex, e.ColIndex)) style.ExcelTipText = CStr(Me.CommentHash(me.GetHashCode(e.RowIndex, e.ColIndex))) The actaul code is too large to post. I will try to put together a simple sample, but in the meantime any help would be appreciated. Thanks Akash

Administrator [Syncfusion]
Replied On September 16, 2005 11:48 AM

Here is a sample illustrating the problem. I have code in SaveCellInfo that does validation on CellValue, and stores the error in a hashtable. Code in QueryCellInfo attempts to set the cell comment based on the hashtable value, but fails. Any ideas what I need to change? Thanks Akash VirtualTreeGrid+CellComments_246.zip

Administrator [Syncfusion]
Replied On September 18, 2005 06:45 AM

Hi Akash, Getting the style values using indexer causes recursive QueryCellInfo calls. You could change the code in QueryCellInfo handler as follows to get this working. Private Sub GridQueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs) If ((e.RowIndex > 0) _ AndAlso (e.ColIndex > 0)) Then e.Style.CellValue = externalData((e.RowIndex - 1)).Items((e.ColIndex - 1)) ''Add cellcommment Dim Key As String = Me.GetHashKey(e.RowIndex, e.ColIndex) If Me.CommentHash.ContainsKey(Key) Then ''MsgBox("oops") '' Getting the style value using indexer causes recursive loop '' instead get it using e.Style Dim style As New ExcelTip.GridExcelTipStyleProperties(e.Style) style.ExcelTipText = CStr(Me.CommentHash(Key)) End If Best regards, Jay N

Administrator [Syncfusion]
Replied On September 19, 2005 06:20 AM

Jay, Many thanks for the solution - didn''t expect an answer this early in the morning! Akash

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;