Link to home
Start Free TrialLog in
Avatar of Johny Bravo
Johny Bravo

asked on

Vb code in C#

Hi experts,
I m a real fresher so I am seeking your help in this.
I tried VB.net to C# converter.But it is also not working for me.
I am having following code in VB,I just need it in C#.
Thanks in advance.
Private Sub FormatSpread()
 
With FpSpread1.Sheets(0)
 
.ColumnHeader.Rows(0).Height = 30
 
.Columns(0).Visible = False
 
End With
 
End Sub
 
 
 
Private Sub FpSpread1_ChildViewCreated(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.ChildViewCreatedEventArgs) Handles FpSpread1.ChildViewCreated 
 
Dim dateType As New FarPoint.Win.Spread.CellType.DateTimeCellType()
 
 
If e.SheetView.ParentRelationName = "Root" Then
 
With e.SheetView
 
.DataAutoCellTypes = False
 
.DataAutoSizeColumns = False
 
.ColumnHeader.Rows(0).Height = 30
 
.Columns(0).Visible = False
 
.Columns(3).Visible = False
 
.Columns(4).Visible = False
 
.Columns(1).Width = 200
 
.Columns(2).Width = 185
 
.Columns(6).Width = 85
 
.Columns(7).Width = 80
 
.Columns(8).Width = 80
 
.Columns(5).CellType = New FarPoint.Win.Spread.CellType.CurrencyCellType()
 
.Columns(7).CellType = New FarPoint.Win.Spread.CellType.CheckBoxCellType()
 
End With
 
Else
 
With e.SheetView
 
.DataAutoCellTypes = False
 
.DataAutoSizeColumns = False
 
.ColumnHeader.Rows(0).Height = 30
 
.Columns(0).Visible = False
 
.Columns(2).Visible = False
 
.Columns(3).Visible = False
 
.Columns(4).Visible = False
 
.Columns(7).Visible = False
 
.Columns(8).Visible = False
 
.Columns(9).Visible = False
 
.Columns(1).Width = 100
 
.Columns(6).Width = 80
 
.Columns(5).CellType = New FarPoint.Win.Spread.CellType.CurrencyCellType()
 
dateType.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.ShortDate
 
.Columns(1).CellType = dateType
 
'Add a total column
 
.ColumnCount = .ColumnCount + 1
 
.ColumnHeader.Cells(0, .ColumnCount - 1).Value = "Total" 
 
.Columns(.ColumnCount - 1).CellType = New FarPoint.Win.Spread.CellType.CurrencyCellType()
 
.Columns(.ColumnCount - 1).Formula = "F1*G1"
 
End With
 
End If
 
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of HarryNS
HarryNS

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Gautham Janardhan
Gautham Janardhan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Johny Bravo
Johny Bravo

ASKER

Thank you experts,
all of your code is working with very little modifications such as replacing ( with [
.
Has anyone of you used farpoint.I need to display hierarchical data in farpoint as shown in the example
http://www.clubfarpoint.com/FarPointSupportSite/Modules/Docs/SpreadWin4.0/spwin-databind-hierarchy.html

If you can guide me in this,it would be great