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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Apply changes to GridStyleInfo

Thread ID:





43836 May 5,2006 03:00 AM UTC Jul 3,2006 03:52 PM UTC WinForms 7
Tags: GridControl
Terence Rossow
Asked On May 5, 2006 03:00 AM UTC

Hi there, I am trying to apply the changes from one GridStyleInfo to another. The situation is that I have a toolbar which modifies a GridStyleInfo drawn from the current selection of cells, after which it fires an event which is caught to update the styles in the grid (by firing the SaveCellInfo event). I am only interested in changed properties - if a user clicks bold, I simply want to apply bold formatting to each selection, without destroying their existing formatting. If the user removes a top border, I simply want to remove that top border from the selections. I think that I should be using the GridStyleInfo.ModifyStyle function - however I am having a hard time understanding it''s behaviour. I had thought that StyleModifyType.Changes was the one I needed - but it appears to only add properties that have changed - doesn''t change existing ones or remove remvoed ones. Is this correct? If anyone can help it would me most appreciated. Cheers, TERRY ROSSOW

Terence Rossow
Replied On May 5, 2006 03:23 AM UTC

Here is exactly what I want to do: Given a source and target GridStyleInfo (source comes from a control that modifies the style of a selection, and target is the style used by the grid), if the source has a value for a property, copy that to the target (regardless or whether the target has a value for the property or not). If the source does not have a value for a property that the target does, remove that property value from the target. Cheers, TERRY ROSSOW

Administrator [Syncfusion]
Replied On May 5, 2006 05:20 AM UTC

Hi Terry, Please refer to the below forum thread for more details. http://www.syncfusion.com/support/forums/message.aspx?MessageID=39135 Please let me know if this helps. Best Regards, Haneef

Terence Rossow
Replied On May 7, 2006 11:31 PM UTC

Hi Haneef, Thanks for the reply. What I am actually after here is the exact behaviours of the GridStyleInfo.ModifyStyle function for each of the StyleModifyType enumeration values. The documentation is a little vague, and my own tests of the function have not made it very much clearer to me. Thanks, TERRY ROSSOW

Terence Rossow
Replied On May 8, 2006 01:07 AM UTC

I have a specific example of my confusion here: I have a GridStyleInfo object that applies to a cell in the grid (theCellStyle): {Interior = Pattern; None; WindowText; 255, 204, 0 Format = "#,##0" Borders.Top = Solid; Black; ExtraThin Borders.Bottom = Solid; Black; ExtraThin VerticalAlignment = Middle ShowButtons = ShowCurrentCell } I then have a style that will be applied to the row that the aforementioned cell is in (theRowStyle): {Interior = Pattern; None; WindowText; Lime } What I want to do is remove all the properties that are set in the new row style from style of each cell in the row. So in this case, I want to remove "Interior = etc" from the cell as it is the only thing shared by the cell style or the row style. I call this line of code to attempt to do this: theRowStyle.ModifyStyle(theCellStyle, Syncfusion.Styles.StyleModifyType.Exclude); What I would expect after that operation is that theCellStyle would look like this: {Format = "#,##0" Borders.Top = Solid; Black; ExtraThin Borders.Bottom = Solid; Black; ExtraThin VerticalAlignment = Middle ShowButtons = ShowCurrentCell } However, it actually ends up like this: {Borders.Top = Solid; Black; ExtraThin Borders.Bottom = Solid; Black; ExtraThin } Is this a bug? Or am I doing something wrong? Cheers, TERRY ROSSOW

Administrator [Syncfusion]
Replied On May 9, 2006 05:02 AM UTC

Hi Terry, We regret for the inconvenience caused. We were able to see the issue here and I have logged a bug report. You could track the progress of the issue here: http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=2040 Thanks for your patience, Regards, Haneef

Leow Kah Man
Replied On July 3, 2006 07:46 AM UTC

Hi, Is this issue still under testing? as specified in http://www.syncfusion.com/support/issues/grid/Default.aspx?ToDo=view&questId=2040 Leow

Administrator [Syncfusion]
Replied On July 3, 2006 03:52 PM UTC

Hi Leow, Thanks for your feedback. This issue has been resolved in Essentail version 4.2. You can download the same from the following link: 4.2V DownloadLink Thanks for your interest in Syncfusion products. Best Regards, Hanef


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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