Hi,
I am involved in the process of migrating vb(6.0) application to
vb.net. My application contains only vb controls namely MSFLEXGRID. I
want to migrate my application to vb.net completely without any
OCX(MSFLEXGRID) controls.
I found datagrid to be an equivalent control of MSFLEXGRID in vb.net.
I am unable to find an equivalent method & property of datagrid in
vb.net. Please provide some examples which helps me to migrate the
MSFLEXGRID to datagrid in vb.net easily.
Below vb code shows flexgrid properties:
Sub InitCallInfo()
On Error GoTo err_handler
flexgrid.Rows = 50
With flexgrid
.ColWidth(0) = 900
.ColWidth(1) = 3100
.ColWidth(2) = 1200
.Row = 0
.Col = 0
.CellFontBold = True
.Text = "No.Calls"
.Col = 1
.CellFontBold = True
.Text = "Call Type"
.Col = 2
.CellFontBold = True
.Text = "Amount"
End With
cnPRU.sp_GetWTNDetail CurrentAcct 'cnPRU - SQL connection
Set rsCalls = cnPRU.LastQueryResults
j = 0
Do While Not rsCalls.EOF
j = j + 1
flexgrid.Row = j
With flexgrid
.Col = 0
.CellFontBold = True
.Text = rsCalls("NumCalls")
.Col = 1
.CellFontBold = True
.Text = rsCalls("Description")
.Col = 2
.CellFontBold = True
.Text = Format(rsCalls("CallDollars"),
"$#,##0.00;($#,##0.00")
End With
rsCalls.MoveNext
Loop
rsCalls.Close
flexgrid.Rows = j + 2 'set total number of rows
flexgrid.Row = j + 1
With flexgrid
.Col = 0
.CellBackColor = &HC0FFFF
.CellFontBold = True
.Text = intNumCalls
.Col = 1
.CellBackColor = &HC0FFFF
.CellFontBold = True
.CellFontItalic = True
.Text = "Total Calls"
.Col = 2
.CellBackColor = &HC0FFFF
.CellFontBold = True
.Text = Format(curUBIC, "$#,##0.00;($#,##0.00")
End With
Exit_Procedure:
Exit Sub
err_handler:
strErr = "Y"
MsgBox Err.Description
cnPRU.sp_InsertError1 Err.Number, Err.Description, "frmWorklist",
"InitCallInfo"
Resume Exit_Procedure
End Sub
Please provide equivalent properties of datagrid in vb.net to achieve
the same output.
Thank you!