Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

ASPxGridView - How to implement Excel-like comment functionality for cells

$
0
0

This example illustrates how to provide an end-user with the capability to assign comments to different cells (this is similar to the Excel-based feature: Annotate a worksheet by using comments). Here are implementation details:


All comments as stored in the dictionary:
[C#]
publicstaticclassCommentsStorage{privatestaticDictionary<Tuple<object,string>,string>Comments...

The first parameter (Tuple) is a compound key value that consists of a row key and column name. The second parameter is a comment text. Although in the current implementation all values are stored in the Session variable, you can easily modify the CommentsStorage class method to store them in the database if necessary.

As for the ASPxGridView-specific implementation part, we handle the ASPxGridView.HtmlDataCellPrepared event to assign the required attributes, CSS styles and client-side event handlers (onmouseover, oncontextmenu) to cells. We customize the Context Menu for rows to display the Insert/Edit/Delete commands for end-users, so that they can modify comments at runtime. Finally, we use two ASPxPopupControl instances to display and edit comments correspondingly.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>