We are beginning to add support for Comments in the UltraSpreadsheet. As you would expect, we would ultimately need to selectively hide/show/edit the comment when a cell is hovered over. But to start, we are programmaticly creating a comment on all of the cells in one specific spreadsheet column.
As a sanity check, when the spreadsheet is exported to Excel, the comments are visible and can be edited.
The comments do appear to be created successfully using the following code:
/////////////////////////////////////////////////////////////////////////////////////////////////// // 4/1/2018....debug test...add dummy comments...to test for hover, etc. dummyComment = new WorksheetCellComment (); dummyComment.Text = new FormattedString ("iDataRow[" + iDataRow + "] iDataCol[" + iDataCol + "] populate_spreadsheed_infragistics line[" + 1176 + "]"); dummyComment.PositioningMode = ShapePositioningMode.MoveWithCells; dummyComment.Visible = true; // just for testing Inf_Active_Worksheet.Rows [ iDataRow ].Cells [ iDataCol ].Comment = dummyComment;
The issue is that none of the cells display the 'triangle' indicator. It there a spreadsheet display setting that needs to be turned on? One other possible clue, the spreadsheet rows are formatted using one of your standard styles to display alternative color rows. We are using style 29. That formatting is performed when the table is first created using the following code:
////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// // the key to this is to first set the header/background-foreground and use a style // that does not change the font color...but has the desired alternating row colorsLogin_History_Spreadsheet.SpreadsheetLook.ColumnHeaderBackgroundColor = Color.AntiqueWhite; Login_History_Spreadsheet.SpreadsheetLook.ColumnHeaderForegroundColor = Color.Black; theNewTable = theTableRegion.FormatAsTable ( true ); theNewTable.Style = Inf_WorkBook.StandardTableStyles[table_style_index]; // table_style_index is 29
Hello Mark,
Thank you for contacting Infragistics. Displaying comments and/or indicators, to match Excel, is considered to be a new product idea. Note, these features are planned for development in the coming months.
In addition, you can suggest new product ideas for future versions (or vote for existing ones) on our ideas site.
Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.
Thank you in advance to submitting your product idea.
Thank you. I totally understand that we will need to create this functionality ourselves. We can create a new 'comment editor' control to display and edit the comment. So a couple of follow-up questions related to the positioning of this new control.
1. Getting the location of the cell in relationship to it's parent. We found the GetBoundsToTwips function for the selected cell, and are able to convert the Twips to points/pixels. However, what is the immediate graphic parent of the cell? The spreadsheet control on the dialog is the parent of all of the spreadsheet parts (e.g. Formula Bars, Column Headers, etc). We are able to compensate for the presence of the Formula bar and column header by adding 65 pixels to the GetBoundsToTwips ...but that is a hack. Especially since it does not compensate if the user has scrolled the spreadsheet.
2. Is there a 'scrolling event' for the spreadsheet cells, we would need to move the 'comment editor' on the screen when the user scrolls the worksheet. Perhaps this is not necessary if we can parent our 'comment editor' to the correct immediate graphic parent of the cell.
Thank you for following up.
I recommend waiting for us to finish implementing rather than implementing this yourself. The UltraSpreadsheet does provide you with some helpful resources such as the ActiveCell, ActivePane and ActiveSelection but not enough to easily achieve what you desire. Also you cannot get access to individual cells easily unless you access the ActiveWorkSheet and iterate through the Rows.Cells collection yourself.
Also, there is no scroll events on the component. The ActivePane does provide useful members such as the ColumnScrollRegion and RowScrollRegion that will reflect the column and row count that is in view.
Let me know if you have any questions.
Thank you for the suggestion. So far we have implemented the following with little issues:
1. Add New Comment
2. Highlight/Hide all comments.
3. Hover and display any comment using a popup formatted text editor in read-only mode.
4. Delete Comment
5. Next/Prior comment
6. Click cell to display and edit the comment with a popup formatted text edit control next to the upper right corner of the cell.
The only remaining functionality to to accommodate the cell scrolling to make sure that the comment edit box follows the cell as it moves.
We can wait a couple of months, but we will probably proceed to explore the modification of the spreadsheet source code to expose a scrolled event and/or exposing the graphic for the entire row/column structure. and if your functionality is then available, we would not have an issue with deprecating our code for standardization.
Feel free to close this topic if you want to.
Thank you for following up. If you do have any additional questions or concerns to discuss you may create a new thread.
- Mike