GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class > AddTable Method : AddTable(String,Int32,Int32,Int32,Int32) Method |
'Declaration Public Overloads Function AddTable( _ ByVal tableName As System.String, _ ByVal row As System.Integer, _ ByVal column As System.Integer, _ ByVal rowCount As System.Integer, _ ByVal columnCount As System.Integer _ ) As SheetTable
'Usage Dim instance As Worksheet Dim tableName As System.String Dim row As System.Integer Dim column As System.Integer Dim rowCount As System.Integer Dim columnCount As System.Integer Dim value As SheetTable value = instance.AddTable(tableName, row, column, rowCount, columnCount)
public SheetTable AddTable( System.string tableName, System.int row, System.int column, System.int rowCount, System.int columnCount )
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.Windows.SpreadSheet.Data.TableStyleInfo tablestyle = new GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo(); tablestyle.Background = new SolidColorBrush(Colors.Red); tablestyle.BorderBottom = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Purple); tablestyle.BorderTop = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.DarkGray); tablestyle.BorderLeft = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick); tablestyle.BorderRight = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick); GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo tablestylerow = new GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo(); tablestylerow.BorderBottom = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick); GrapeCity.Windows.SpreadSheet.Data.TableStyle testtable = new GrapeCity.Windows.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.Invalidate();
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.Windows.SpreadSheet.Data.TableStyleInfo() tablestyle.Background = New SolidColorBrush(Colors.Red) tablestyle.BorderBottom = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Purple) tablestyle.BorderTop = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.DarkGray) tablestyle.BorderLeft = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick) tablestyle.BorderRight = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick) Dim tablestylerow As New GrapeCity.Windows.SpreadSheet.Data.TableStyleInfo() tablestylerow.BorderBottom = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(System.Windows.Media.Colors.Red, GrapeCity.Windows.SpreadSheet.Data.BorderLineStyle.Thick) Dim testtable As New GrapeCity.Windows.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.Invalidate()
Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6