Solved

datagrid vs listview for self developed invoice control (or system)

Posted on 2004-04-29
4
856 Views
Last Modified: 2008-02-26
good day i need to make a form that can add items to a invoice
i am only aware of controls that i need to pay for and i live in a 3rd world country, (spare me the pity).
can anyone give me a tip on how to make one or what components i should use or any help would be appreciated.
these are the fields that need to be in the invoice system:
1      2            3      4      5            6      7      8
CODE      DESCRIPTION      QTY      UNIT      UNIT_PRICE      DISC      TAx      NET_PRICE

fields 1,2 requires another form to be called, and on this second form i will have a datagrid filled with appropriate values
once the user clicks on this second form, the values of the second form will be passed back to the invoice field.
fields 3,5,6,7,8 need to be similar to textboxes and will be filled from a dataset but will be editable as well
fields 4 is combobox type and the user will select for e.g. Meter/ kilogram/ etc.


so far it seems datagrid can do  most of them.
i have viewed this code from
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20728539.html
which enables a user to insert a combobox into a datagrid and it is brilliant.

Q1
would a datagrid or listview be better for this situation.
any other controls that would be suitable?

Q2
would i be able to call a combobox from a listview
as in http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20728539.html

Q3
will i be able to call another form from a cell in a datagrid?
would i be able to do it from a listview

Q4
any other known hiccups i will encounter

or

Q5
possible link to similar/helpful situation / solution
0
Comment
Question by:jxharding
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Expert Comment

by:tgannetts
ID: 10947997
The datagrid is a much better option from the listview.... You can respond to which column and row a user has selected using the HitTest class:

You need to handle the Mouse_Down event, and determine which column the user has selected - doing this you will be able to activate forms etc

0
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 250 total points
ID: 10948034
Q1 I would go for the datagrid, I find it easier to manipulate
Q2 Yes, look here http://support.microsoft.com/default.aspx?scid=kb;EN-US;q320342
Q3 Yes, you can use the mouseup or mousedown event to determine the row and collumn
Q4 I don't think you will encounter much problems with the thing you want to do
0
 
LVL 5

Assisted Solution

by:tgannetts
tgannetts earned 250 total points
ID: 10948056
So:

    Private Sub DataGrid1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseDown

        Dim ht As DataGrid.HitTestInfo

        ht = Me.DataGrid1.HitTest(e.X, e.Y)

        If ht.Type = Windows.Forms.DataGrid.HitTestType.Cell Then

            Select Case ht.Column

                Case 0
                    Dim form1 As New Form1()
                    If form1.ShowDialog = DialogResult.OK Then
                        Me.DataGrid1.Item(ht.Row, 0) = form1.YourValueName
                    End If
                Case 1

                Case 2

            End Select

        End If

    End Sub

This will open up a Modal form which the user can select a value from. If you make sure that value is stored in a property on the form, then you can add that value to the datagrid.

Hope this helps.

Tom
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 10948089
Q5. This is an excelent site for the datagrid control http://www.syncfusion.com/FAQ/WinForms/default.asp#44
You will find most of your problems explained here
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question