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.

Font changes

Thread ID:

Created:

Updated:

Platform:

Replies:

14793 Jun 4,2004 06:35 AM Jun 4,2004 08:03 AM Windows Forms 3
loading
Tags: GridControl
Pete Davis
Asked On June 4, 2004 06:35 AM

I need to know when the font has changed for individual cells. There is a FontChanged event for the grid as well as one for the styles, but there''s not much documentation for it. There doesn''t appear to be any way to tell where the change is taking place. In my particular case, I need to resize rows to accomodate the largest font in the row. What event and from which object should I be handling? The GridStyleInfo doesn''t really make sense because that will only apply to styles I know about (unless I handle events for styles being added and removed and add and remove FontChanged event handlers as needed, but that seems overly complex. Thanks. Pete

Administrator [Syncfusion]
Replied On June 4, 2004 07:36 AM

Any time a style changes, the events CellsChanging, SaveCellInfo, and CellsChanged are raised. You would have to identify when a style.Font was changed in one of these events. Here is a snippet that does it in SaveCellInfo.
private void gridControl1_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
{
	if(e.Style.Store.IsValueModified(GridStyleInfoStore.FontProperty))
	{
		Console.WriteLine("Font changed");
	}
}

Pete Davis
Replied On June 4, 2004 07:41 AM

Thanks Clay. Since I may be resizing the row, I guess it would make more sense to do it on the CellsChanging event, since the row size change would start the whole event process over, correct? >Any time a style changes, the events CellsChanging, SaveCellInfo, and CellsChanged are raised. > >You would have to identify when a style.Font was changed in one of these events. Here is a snippet that does it in SaveCellInfo. > >
>private void gridControl1_SaveCellInfo(object sender, GridSaveCellInfoEventArgs e)
>{
>	if(e.Style.Store.IsValueModified(GridStyleInfoStore.FontProperty))
>	{
>		Console.WriteLine("Font changed");
>	}
>}
>

Administrator [Syncfusion]
Replied On June 4, 2004 08:03 AM

CellChanging would allow you to look at several cells at one time provided the change to the styles were done with a grid.ChangeStyles call. If it is done some other way, it will probably not make a difference.

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.

;