473,804 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_GetWTN Detail CurrentAcct 'cnPRU - SQL connection
Set rsCalls = cnPRU.LastQuery Results

j = 0

Do While Not rsCalls.EOF
j = j + 1
flexgrid.Row = j
With flexgrid
.Col = 0
.CellFontBold = True
.Text = rsCalls("NumCal ls")
.Col = 1
.CellFontBold = True
.Text = rsCalls("Descri ption")
.Col = 2
.CellFontBold = True
.Text = Format(rsCalls( "CallDollar s"),
"$#,##0.00;($#, ##0.00")
End With
rsCalls.MoveNex t

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_Insert Error1 Err.Number, Err.Description , "frmWorklis t",
"InitCallIn fo"
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 16750
Zoneal,

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

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
3216
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 save botton I'm using a for loop thru the msFlexgrid to get the data and save it in the table, but I have the lastname+firstName values in the cell and I need the customerID. How can I fix this? Any idea? Tks JFB
0
1422
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 MSFlexGrid. I have been able to successfully add a COM object MSFlexGrid in my VB.Net project. I can successfully populate and manipulate the grid. But, I have two problems, that I used to be able to do with no issues in VB 6. 1) AutoSizing...
2
1673
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 from here and from other web sites, I've been able to populate a DataGrid with a CSV file (though I can't say I fully understand the code used to do it). Like, where do I find references to all that gibberish in the ConnectionString?...
1
4978
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 pain to work with if you just want to throw some values in a grid and edit them with a textbox. i don't want to persist anything in a database, i just need a fast cheap and easy grid in memory that i can work with! i had functions in vb6 that...
3
4054
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 not sure whether i can use it in the same way.
1
2689
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 MSFlexGrid. It works, but location of the text box is a little bit off the cell. (A bit to much to left and to high) With MSFlexGrid(Index) txtCellEditor.Location = New Point(SSTab1.Location.X + TwipsToPixelsX(.CellLeft) + .Location.X,...
2
3346
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 at all. each time, I opened up my form layout. I get this message: "The following exception has occurred: TargetInvocationException: Unable to get the window handle for the 'AxMSFlexGrid' control. Windowless ActiveX controls are not...
1
5129
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 pixel width of the column text data. I have a function to measure the pixel width of the string data, however, I found that the parameter of the Set_ColWidth() function in MSFlexGrid is not in pixel unit. How can I convert the pixel unit to the...
2
2481
by: uprakash14 | last post by:
i want to get excel data in datagrid or msflexgrid... gve me some hints '
0
9711
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.