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.
Syncfusion Feedback

Standard Style overrides all others

Thread ID:

Created:

Updated:

Platform:

Replies:

6156 Aug 2,2003 01:31 PM UTC Aug 2,2003 03:02 PM UTC Windows Forms 3
loading
Tags: GridControl
ERobishaw
Asked On August 2, 2003 01:31 PM UTC

The documentation implies that the styles are cascading, but it does not seem to be entirely true. For example, I've set the "Standard Style" to read-only=true, cell-type=Static, enabled=false. Then, I set individual cells to other properties, such as read-only=false, cell-type=currency|textbox|etc..., and enabled=true, and in the ChangeCells routine, I have use StyleModifyType.Override. My thinking was that the I could have all the cells static and read-only, except the cells I wanted to be editable. However, the end result is that all the cells are read-only and enabled=false, although the Cell-Type is not being ignored. Any thoughts? How can I best accomplish make all cells by default static/not enabled, EXCEPT specific cells? Eric Robishaw New to THE grid.

ERobishaw
Replied On August 2, 2003 01:49 PM UTC

To further demonstrate this occurance, see the attached picture. I set the Standard style, celltype = Pushbutton, enabled=false, readonly=true. The non-pushbutton cells are set to various other styles, cell-type either static, textbox or currency... the textbox and currency cells set to read-only:false, and enabled:true. As you can see from the pic, the cell-style is NOT ignored, however the read-only and enabled properties are. HELP

Administrator [Syncfusion]
Replied On August 2, 2003 01:58 PM UTC

If I drop a GridControl on a form, and place this code in form_load, then cell 2,2 is editable and all other cells are not.
private void gridControl1_Click(object sender, System.EventArgs e)
{
	this.gridControl1.BaseStylesMap["Standard"].StyleInfo.ReadOnly = true;
	this.gridControl1[2,2].ReadOnly = false;
}
Are you trying to do this for a GridDataBoundGrid? In a GridDataBoundGrid, you cannot directly set any cell specific properties except the CellValue (or Text). So you will have to handle the Model.QueryCellInfo event, and set the readonly property there for specific cells.
//hook the event
this.gridDataBoundGrid1.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(grid_QueryCellInfo);

//the handler
private void grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
	if(e.ColIndex == 2 && e.RowIndex == 2)
		e.Style.ReadOnly = false;
}

ERobishaw
Replied On August 2, 2003 03:02 PM UTC

Actually, not a regular grid. I found the problem though.... In the overriding styles I created (from the IDE), I hadn't explicity set the read-only and enabled properties... they were showing the defaults of false and true respectively, but after setting them they were BOLD, signifying explicit settings, and it now works. BTW, I assume you work for Syncfusion, but in any event, I've got to say-- Clay, you provide extreme, equisite, superb, succinct, impressive, and timely support for this product. Thanks Eric

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

;