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. Image for the cookie policy date
close icon

SaveCellInfo, ExcelTipComments, and GridDataBoundGrid

I found the ExcelCommentGDBG solution and implemented it to add comments to a few cells of my databound grid, but when I reload the grid with new data, the cells with the comments still contain the old data. The grid shows hourly totals for a store, Team, and date. When I change from Team 1 to Team 3 and reload the dataset, Team 1''s totals remain in the cells with the comments. I believe the issue is somewhere in the saveCellInfo sub, but I''m not sure where. When the dataset is reloaded I want it to get the new values for those cells with the comments. Below is the SaveCellInfo sub. The question is: how can I have comments on cells and have the cells reload their values when the dataset is reloaded? ------------------------------------------------ Private Sub hoursched_SaveCellInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridSaveCellInfoEventArgs) If e.RowIndex > 0 AndAlso e.ColIndex > 0 Then Dim excelStyle As New ExcelTip.GridExcelTipStyleProperties(e.Style) If excelStyle.ExcelTipText.Length > 0 Then ''MsgBox(e.ColIndex & Me.DsSchedHour1.Tables(0).Rows(e.RowIndex - 1)(e.ColIndex - 1)) Dim key As Object = myGetHashCode(e.RowIndex, e.ColIndex) If Me.excelTipsCache.ContainsKey(key) Then Me.excelTipsCache(key) = e.Style Else Me.excelTipsCache.Add(key, e.Style) End If End If End If End Sub

1 Reply

AD Administrator Syncfusion Team April 14, 2004 06:51 PM UTC

I am not sure if you are saying the cellvalue does not reflect the newly loaded datatable, or if the comment does not reflect the newly loaded datatable. If it is the comment you are concerns about, those are contained in your myGetHashCode hasttable. If youwant to clear these saved comments, then you should call myGetHashCode.Clear(). If you want to save them, and reload then later, then you would have to serialize this myGetHashCode hashtable somehow. If it is the cell value that is not behaving properly, then clearing the hashtable should help also since you are loading the style from teh hashtable in your QueryCellInfo (which you do not show here).

Loader.
Live Chat Icon For mobile
Up arrow icon