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.
Unfortunately, activation email could not send to your email. Please try again.

Disabling cells in a databound grid...HELP!

Thread ID:

Created:

Updated:

Platform:

Replies:

2712 Feb 10,2003 08:15 PM Mar 9,2003 03:49 PM Windows Forms 5
loading
Tags: GridControl
Gwen Pier
Asked On February 10, 2003 08:15 PM

Hi, all... I'm using the data bound grid, and cannot figure out how to disable individual cells at runtime. The grid is bound to a datatable...at runtime, I want to disable individual cells...I was trying to do mygrid.Model[row,col].Enabled = false; or... mygrid[row,col].Enabled = false; ...for specific row/col combinations [this code fires AFTER the grid has been populated]. However, the code doesn't have any effect. So how can I disable individual cells in a databound grid? Thanks, Kevin

Administrator [Syncfusion]
Replied On February 11, 2003 08:50 AM

You need to handle the PrepareViewStyleInfo event if you want to change style information for specific cells. Stefan

Gwen Pier
Replied On February 11, 2003 11:01 AM

> You need to handle the PrepareViewStyleInfo event if you want to change style information for specific cells. > > Stefan Stefan... Thanks for your response. I'm fairly new to EssentialGrid, so I'm not overly famililar with this event. 1) When does this fire? On a cell-by-cell basis? I tried to look up this event in the documentation, but couldn't find much. Can you point me in the direction of a useful sample that I can read, to get an idea of how I'd apply it? Thanks, Kevin

Administrator [Syncfusion]
Replied On February 11, 2003 11:22 AM

It's fired on cell-by cell basis. Check out the Grid\Samples\DataBound\GDBGMultiHeader sample. There you will find an override for this event. There should be also other samples that handle this event. Stefan

Pal Koncsik
Replied On March 9, 2003 02:12 PM

Funny, this does not work with ReadOnly. I had to resort to the enabled property, because the setting was given dynamically in this event was simply ignored. Seems to me the databound grid has some rough edges.

Administrator [Syncfusion]
Replied On March 9, 2003 03:49 PM

With the ReadOnly property, you probably would need to handle the Model.QueryCellInfo, change the e.Style there as well as setting e.Handled = true. The reason is that ReadOnly is a property that is checked other than when the cell is drawn. The PrepareViewStyleInfo event is used to setup the style for drawing.

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.

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.

;