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

How to display custom controls instead of the standard cell editor

$
0
0
This example demonstrates how to display custom controls instead of a cell's in-place editor.
• If an end-user tries to edit a cell located in the "Order Date" column of a worksheet table, the DateEdit control is displayed, so that the user can select the required date in the drop-down calendar.
• If the end-user tries to edit a cell in the "Category" column of a table, the LookUpEdit appears allowing the user to select one of predefined values.
• And finally, if the end-user activates a cell located in the "Discount" column, the CheckEdit control is displayed. It gives the user the true/false option to apply a 10% discount to the total amount.

To implement this behavior, subscribe to the SpreadsheetControl.CellBeginEdit event that is raised before the cell editor is activated, and then use the SpreadsheetControl.GetCellBounds method to obtain boundaries of the currently edited cell. Cell boundaries are defined by an instance of the System.Drawing.Rectangle class. Display the custom control over the cell editor by assigning the returned rectangle to the Control.Bounds property to specify the custom control's size and location.

Starting from v16.1, this method of supplying custom cell editors is outdated. For details and an updated example, refer to How to: Assign Custom In-Place Editors to Worksheet Cells.
Question Comments

Added By: Mani Duraisamy at: 7/2/2015 8:36:53 AM    

Can I implement the above in a ASP.NET MVC application? Thanks.

Added By: Oleg (DevExpress Support) at: 7/3/2015 12:12:39 AM    

Hello Mani,
To process your recent post more efficiently, I created a separate ticket on your behalf: T263003: How to use custom controls for editing cell values in the ASP.NET MVC Spreadsheet control. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



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