GrapeCity.Xaml.SpreadSheet.Data Namespace > Worksheet Class > AddTable Method : AddTable(String,Int32,Int32,Int32,Int32,TableStyle) Method |
'Declaration Public Overloads Function AddTable( _ ByVal tableName As String, _ ByVal row As Integer, _ ByVal column As Integer, _ ByVal rowCount As Integer, _ ByVal columnCount As Integer, _ ByVal tableStyle As TableStyle _ ) As SheetTable
'Usage Dim instance As Worksheet Dim tableName As String Dim row As Integer Dim column As Integer Dim rowCount As Integer Dim columnCount As Integer Dim tableStyle As TableStyle Dim value As SheetTable value = instance.AddTable(tableName, row, column, rowCount, columnCount, tableStyle)
public SheetTable AddTable( string tableName, int row, int column, int rowCount, int columnCount, TableStyle tableStyle )
gcSpreadSheet1.Sheets[0].Cells[1,1].Text = "Last Name"; gcSpreadSheet1.Sheets[0].Cells[1, 2].Text = "Value"; gcSpreadSheet1.Sheets[0].Cells[2, 1].Text = "Smith"; gcSpreadSheet1.Sheets[0].Cells[2, 2].Value = 50; gcSpreadSheet1.Sheets[0].Cells[3, 1].Text = "Vil"; gcSpreadSheet1.Sheets[0].Cells[3, 2].Value = 10; gcSpreadSheet1.Sheets[0].Cells[4, 1].Text = "Press"; gcSpreadSheet1.Sheets[0].Cells[4, 2].Value = 78; GrapeCity.Xaml.SpreadSheet.Data.TableStyleInfo tablestyle = new GrapeCity.Xaml.SpreadSheet.Data.TableStyleInfo(); tablestyle.Background = new SolidColorBrush(Windows.UI.Colors.Azure); tablestyle.BorderBottom = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.DarkOrchid); tablestyle.BorderTop = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.DarkSlateBlue); tablestyle.BorderLeft = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Crimson, GrapeCity.Xaml.SpreadSheet.Data.BorderLineStyle.Thick); tablestyle.BorderRight = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Crimson, GrapeCity.Xaml.SpreadSheet.Data.BorderLineStyle.Thick); GrapeCity.Xaml.SpreadSheet.Data.TableStyleInfo tablestylerow = new GrapeCity.Xaml.SpreadSheet.Data.TableStyleInfo(); tablestylerow.BorderBottom = new GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Crimson, GrapeCity.Xaml.SpreadSheet.Data.BorderLineStyle.Thick); GrapeCity.Xaml.SpreadSheet.Data.TableStyle testtable = new GrapeCity.Xaml.SpreadSheet.Data.TableStyle(); testtable.WholeTableStyle = tablestyle; testtable.HeaderRowStyle = tablestylerow; //gcSpreadSheet1.Sheets[0].AddTable("Table1", 1, 1, 5, 2); gcSpreadSheet1.Sheets[0].AddTable("Table1", 1, 1, 5, 2, testtable);
GcSpreadSheet1.Sheets(0).Cells(1, 1).Text = "Last Name" GcSpreadSheet1.Sheets(0).Cells(1, 2).Text = "Value" GcSpreadSheet1.Sheets(0).Cells(2, 1).Text = "Smith" GcSpreadSheet1.Sheets(0).Cells(2, 2).Value = 50 GcSpreadSheet1.Sheets(0).Cells(3, 1).Text = "Vil" GcSpreadSheet1.Sheets(0).Cells(3, 2).Value = 10 GcSpreadSheet1.Sheets(0).Cells(4, 1).Text = "Press" GcSpreadSheet1.Sheets(0).Cells(4, 2).Value = 78 Dim tablestyle As New GrapeCity.Xaml.SpreadSheet.Data.TableStyleInfo() tablestyle.Background = New SolidColorBrush(Windows.UI.Colors.Azure) tablestyle.BorderBottom = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.DarkOrchid) tablestyle.BorderTop = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.DarkSlateBlue) tablestyle.BorderLeft = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Crimson, GrapeCity.Xaml.SpreadSheet.Data.BorderLineStyle.Thick) tablestyle.BorderRight = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Crimson, GrapeCity.Xaml.SpreadSheet.Data.BorderLineStyle.Thick) Dim tablestylerow As New GrapeCity.Xaml.SpreadSheet.Data.TableStyleInfo() tablestylerow.BorderBottom = New GrapeCity.Xaml.SpreadSheet.Data.BorderLine(Windows.UI.Colors.Crimson, GrapeCity.Xaml.SpreadSheet.Data.BorderLineStyle.Thick) Dim testtable As New GrapeCity.Xaml.SpreadSheet.Data.TableStyle() testtable.WholeTableStyle = tablestyle testtable.HeaderRowStyle = tablestylerow 'GcSpreadSheet1.Sheets(0).AddTable("Table1", 1, 1, 5, 2) GcSpreadSheet1.Sheets(0).AddTable("Table1", 1, 1, 5, 2, testtable)
Target Platforms: Windows Server 2012, Windows RT