GrapeCity.Win.MultiRow Namespace > NamedCellStyle Class : NamedCellStyle Constructor |
Public Function New( _ ByVal cellStyleName As String _ )
Dim cellStyleName As String Dim instance As New NamedCellStyle(cellStyleName)
public NamedCellStyle( string cellStyleName )
private void Form1_Load(object sender, EventArgs e) { Template template1 = Template.CreateGridTemplate(20, 50, 21); for (int i = 0; i < template1.Row.Cells.Count - 1; i++) { if (i % 2 == 0) { //The even columns use the "AlternatingColumnsDefaultCellStyle" template1.Row.Cells[i].Style = new NamedCellStyle("AlternatingColumnsDefaultCellStyle"); } else { //The odd columns use the "ColumnsDefaultCellStyle" template1.Row.Cells[i].Style = new NamedCellStyle("ColumnsDefaultCellStyle"); } } gcMultiRow1.Template = template1; gcMultiRow1.RowCount = 20; }
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim template1 As Template = Template.CreateGridTemplate(20, 50, 21) For i As Integer = 0 To template1.Row.Cells.Count - 2 If i Mod 2 = 0 Then 'The even columns use the "AlternatingColumnsDefaultCellStyle" template1.Row.Cells(i).Style = New NamedCellStyle("AlternatingColumnsDefaultCellStyle") Else 'The odd columns use the "ColumnsDefaultCellStyle" template1.Row.Cells(i).Style = New NamedCellStyle("ColumnsDefaultCellStyle") End If Next gcMultiRow1.Template = template1 gcMultiRow1.RowCount = 20 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