FlexGrid for WinForms
MergeWith Method
Example 



Copies all elements defined in a source style to this style.
Syntax
'Declaration
 
Public Sub MergeWith( _
   ByVal sourceStyle As CellStyle _
) 
'Usage
 
Dim instance As CellStyle
Dim sourceStyle As CellStyle
 
instance.MergeWith(sourceStyle)
public void MergeWith( 
   CellStyle sourceStyle
)
public:
void MergeWith( 
   CellStyle^ sourceStyle
) 

Parameters

sourceStyle
Remarks
This method is used to create styles preserving existing style elements such as DataType or Format.
Example
The code below changes a column so it looks like a fixed column, without modifying the column's data type, alignment, etc.
// create a new style
CellStyle cs = _flex.Styles.Add("newStyle");
            
// set data type, alignment
cs.DataType = typeof(int);
cs.TextAlign = TextAlignEnum.CenterCenter;
            
// copy remaining elements from "Fixed" style
cs.MergeWith(_flex.Styles.Fixed);
            
// assign new style to grid column
_flex.Cols[col].Style = cs;
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

CellStyle Class
CellStyle Members

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Send Feedback