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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CellCommentTips in VirtTreeGrid

Thread ID:





34807 Sep 16,2005 09:16 AM UTC Sep 19,2005 10:20 AM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On September 16, 2005 09:16 AM UTC

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 03:48 PM UTC

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 10:45 AM UTC

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 10:20 AM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon