Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

722 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