?
Solved

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

Posted on 2004-04-29
4
Medium Priority
?
864 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
  • 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 1000 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 1000 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

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.
The video will let you know the exact process to import OST/PST files to the cloud based Office 365 mailboxes. Using Kernel Import PST to Office 365 tool, one can quickly import numerous OST/PST files to Office 365. Besides this, the tool also comes…
Suggested Courses
Course of the Month5 days, 19 hours left to enroll

589 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