GrapeCity.Win.MultiRow Namespace > Template Class : NamedCellStyles Property |
<BrowsableAttribute(False)> <DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Content)> Public ReadOnly Property NamedCellStyles As NamedCellStyleDictionary
Dim instance As Template Dim value As NamedCellStyleDictionary value = instance.NamedCellStyles
[Browsable(false)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public NamedCellStyleDictionary NamedCellStyles {get;}
void setSecondNamedCellStyle_Click(object sender, EventArgs e) { CellStyle alternatingColumnsDefaultCellStyle = new CellStyle(); alternatingColumnsDefaultCellStyle.BackColor = Color.Orange; alternatingColumnsDefaultCellStyle.ForeColor = Color.Black; alternatingColumnsDefaultCellStyle.NullValue = "Text"; //Change the "AlternatingColumnsDefaultCellStyle" this.gcMultiRow1.NamedCellStyles["AlternatingColumnsDefaultCellStyle"] = alternatingColumnsDefaultCellStyle; CellStyle columnsDefaultCellStyle = new CellStyle(); columnsDefaultCellStyle.GradientColors = new Color[] { Color.Orange, Color.Lime }; columnsDefaultCellStyle.GradientDirection = GradientDirection.Center; columnsDefaultCellStyle.GradientStyle = GradientStyle.Vertical; //columnsDefaultCellStyle.BackColor = Color.FromArgb(230, 255, 230); //columnsDefaultCellStyle.ForeColor = Color.Red ; columnsDefaultCellStyle.NullValue = "Text"; this.gcMultiRow1.NamedCellStyles["ColumnsDefaultCellStyle"] = columnsDefaultCellStyle; //You can load one predefined NamedCellStyleDictionary from one file. //this.gcMultiRow1.NamedCellStyles.Load(@"C:\temp\NamedCellStyles.xml"); //You can save the NamedCellStyleDictionary to one file. //this.gcMultiRow1.NamedCellStyles.Save(@"C:\temp\NamedCellStyles.xml"); }
Private Sub setSecondNamedCellStyle_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setSecondStyle.Click Dim alternatingColumnsDefaultCellStyle As New CellStyle() alternatingColumnsDefaultCellStyle.BackColor = Color.Orange alternatingColumnsDefaultCellStyle.ForeColor = Color.Black alternatingColumnsDefaultCellStyle.NullValue = "Text" 'Change the "AlternatingColumnsDefaultCellStyle" Me.gcMultiRow1.NamedCellStyles("AlternatingColumnsDefaultCellStyle") = alternatingColumnsDefaultCellStyle Dim columnsDefaultCellStyle As New CellStyle() columnsDefaultCellStyle.GradientColors = New Color() {Color.Orange, Color.Lime} columnsDefaultCellStyle.GradientDirection = GradientDirection.Center columnsDefaultCellStyle.GradientStyle = GradientStyle.Vertical 'columnsDefaultCellStyle.BackColor = Color.FromArgb(230, 255, 230); 'columnsDefaultCellStyle.ForeColor = Color.Red ; columnsDefaultCellStyle.NullValue = "Text" Me.gcMultiRow1.NamedCellStyles("ColumnsDefaultCellStyle") = columnsDefaultCellStyle 'You can load one predefined NamedCellStyleDictionary from one file. 'this.gcMultiRow1.NamedCellStyles.Load(@"C:\temp\NamedCellStyles.xml"); 'You can save the NamedCellStyleDictionary to one file. 'this.gcMultiRow1.NamedCellStyles.Save(@"C:\temp\NamedCellStyles.xml"); End Sub
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