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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change cellType dataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

7247 Sep 17,2003 07:14 AM UTC Sep 18,2003 04:58 AM UTC WinForms 2
loading
Tags: GridControl
ionutB
Asked On September 17, 2003 07:14 AM UTC

I'm using a DataBoundGrid which uses a collection derived from CollectionBase, IBindingList, ITypedList, ITransaction as DataSource. I need to change the CellType of the current cell from TextBox to Currency when I click the cell (or RowEnter) and after the string in the cell is modified(RowLeave), change again to TextBox. I need these behavior because the grid doesn't validates the data if the cellType isn't TextBox.

Administrator [Syncfusion]
Replied On September 17, 2003 08:25 AM UTC

Exactly what do you mean by "because the grid doesn't validates the data if the cellType isn't TextBox"? The CurrentCellValidating event should be hit no matter what the cell type is. Swapping out a cell control while the cell is the active cell is problematic. If it is not the active cell, you could subscribe to the Model.QueryCellInfo event and set e.Style.CellType depending upon whether e.RowIndex was the grid.CurrentCell.RowIndex and if e.ColIndex pointed to the column. Here is a forum thread that has a little sample that derives a cell control that only uses a currency control if the cell is actively being edited. Otherwise, it uses a static cell. Maybe something like this would work for you.

ionutB
Replied On September 18, 2003 04:58 AM UTC

Thanks for the quick response.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;