Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Produce functionality similar to notes in an Excel spreadsheet
posted

Hi,

I'm looking to create functionality similar to that seen in Excel where you can add notes/comments onto a cell and you get the little red triangle in the top corner of the cell.

Is this kind of thing possible with the WinGrid?

If so, any pointers to get me going please?

 

Thanks

Alan

Parents
  • 5118
    Verified Answer
    posted

    Hi Alan,

    So the idea is to present a context menu with an option to insert a comment to an UltraGridCell and supplying a UI for that input.  When that input disappears you render an image on that cell.  I went about that far with this example.  You also need to do the editing of the comment and the deletion of the comment.  This example is still a little finicky and will not always render the image for me but it should be plenty to get you started on this task. 

    1. Run the application.

    2. Right click on a cell and select Insert Comment from the context menu.

    3. Enter some text in the text editor that appears.

    4. Click off the input text box for the comment.

    5. Repeat these steps for another cell.

    6. The finicky portion... click on a row selector and then off to see the image show up sometimes. 

    Note: you can do a lot more with the input UI... I just used a PopupControlContainer and an UltraTextEditor with Multiline = true.  Also note that Edit TextBox will end up covering some but not all of the image rendered when there is a comment.  You would have to adjust the rect of the ImageUIElement to sneak in a bit or hide it or do something there.  I also did not have the comment show up when you mouse over the cell or the image but that should be trivial if you get this far.

    P.S. - The image is added via a CreationFilter on the UltraGrid control. 

    Happy Coding.

    WinGridWithExcelComments.zip
Reply Children
No Data