473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Migration of MSFLEXGRID to DATAGRID in vb.net...

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!

Jan 9 '06 #1
1 16661
Zoneal,

Be aware that the DataGrid uses forever a datasource which is in your case a
DataTable/Dataview/DataTable.Defaultview.

Have than a look at our website. The datagrid part is full of samples which
are completely stand alone. (The one that are not standalone can you use as
well by the way, however than with creating the datatable as in the other
samples)

http://www.vb-tips.com/default.aspx

I hope this helps,

Cor
Jan 9 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JFB | last post by:
Hi Folks, I'm using ado.net and I have a combo box inside of a msFlexgrid, so when I selected the item from the combo I'm passing this value to the textMatrix(row,col). At the time to press the...
0
by: Martin K | last post by:
Hello all..thanks for everyone's advice regarding my SHBrowseForFolder API problem, I was able to put together a public class that runs great! But I have another migration headache regarding the...
2
by: Terry Olsen | last post by:
Most of the Apps I write are 'Data Mining' apps. In VB6, I used the MSFlexGrid a lot. Now i'm trying to understand the use of the DataGrid, DataTable, & DataSet. Using examples I've gotten...
1
by: Mad Scientist Jr | last post by:
can someone explain how to simply populate a grid in .net ? the way i understand it, there is no more msflexgrid, and instead is this new control that has to be tied to a dataset, and it is a real...
3
by: RBirney | last post by:
What has replaced or is best use now msflexgrid has gone. I don't bind it to a data source i put the data in using code after i have changed it. The only thing i have seen is a datagrid but i am...
1
by: schapopa | last post by:
Hi, I have a MSFlexGrid control on the SSTab and now I am trying to make it editable. I got some example on the net that explains how to achive that. So I have a text box that appears over the...
2
by: Ben | last post by:
after I migrated to dotNet, migration wizard transferred over my vb6.0 Msflexgrid activex com as a dll, it putted it in my bin dir as AxInterop.MSFlexGridLib.dll. however, I can't use this control...
1
by: Steven | last post by:
I develop the application which contains MSFlexGrid to display data. When I try to fill the grid with the text data, I want to adjust the column width so that the width is adjusted to the maximum...
2
by: uprakash14 | last post by:
i want to get excel data in datagrid or msflexgrid... gve me some hints '
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.