Re: limit number of rows in vb.net datagrid

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Andy O'Neill (aon14nocannedmeat_at_lycos.co.uk)
Date: 02/13/05


Date: Sun, 13 Feb 2005 16:44:49 GMT


"Melson" <wee789@hotmail.com> wrote in message
news:uC8Rj8SEFHA.3504@TK2MSFTNGP12.phx.gbl...
> Hi Andy
>
> Thanks for your help. I've done what you told me and it works. However,
> i'm still frustrated because i'm still stuck with this project. Pls help.
> Is there any example. I really appreciate if anyone can help me. I've
> tried to solve this for weeks but still fail.
> Description
>
>
> I would like to create a data entry form using vb.net. It is a
> master-detail windows form which the upper section is the product
> code(master) and the lower section is the part information (detail). The
> lower section is make up of a datagrid. First column is the part code and
> second column is part description. When user pressed the Enter key in the
> part code column, it opens the Part code form for the user to choose the
> part code. User can add as many part code as possible with the same
> product code.
>
> User is able to perform Add, Edit and Delete function on data entry form.
> It is connected to ms sql database.
>
>
> What I've tried
>
> I've tried to create a windows control library with the following code
> below. Then add the dll into the Toolbox. It is able to capture the Enter
> key. However, there are problems which I faced.
>
> a.. It captures Enter key in every column. e.g Part code column, Part
> description column

You can add handlers for all sorts.
I would think you could maybe inherit your own control from the textbox
goes in a grid and handle the return key in it.
But.
I would also suggest that this is maybe rather doing things the hard way.
Adding a column with just a button in it is maybe easier.
I think there's an example on george shepherd's faq site about adding a
button.

>
> b.. How can I open Part code form so that user can choose part code into
> the datagrid

A drop down combo is no good to you?
Lot of parts perhaps.

Hand over the calling form as an object.
Add a public procedure (method) allows the called form to set the part code.

>
> a.. How can I perform Add, Edit and Delete record which connect to ms
> sql.

Read up about dataadaptors and datasets.



Relevant Pages

  • Re: Editing Objects
    ... There is a selection on the Right Mouse Button menu, ... selection opens another menu with Edit, Open, and Convert. ... Selecting Edit ... Paste into PPT. ...
    (microsoft.public.powerpoint)
  • Re: Editing Word2007 document in Office Mobile 6.1
    ... Both my laptop and Device are set to Eastern Time. ... Blog: http://word2007bible.herbtyson.com ... It has a table of contents, and it opens just ...
    (microsoft.public.word.docmanagement)
  • Re: Wordperfect docs
    ... Instead people need to use Edit in Microsoft Word ... that it always opens in a new window. ... I am expecting to have wordperfect open in my computer ... >>> This mailbox protected from junk email by MailFrontier Desktop ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Putting database on a network drive
    ... I have built my 1st database and it is ready to go on a shared network ... You can apply user level security to an mdb file. ... the database but only let myself edit the database. ... search through the form that opens but then have a password for me or ...
    (comp.databases.ms-access)
  • Re: some errors - not sure
    ... >i get this message when i open gedit to edit files from root ... >gedit still opens and i can edit and save the changes, ... So consider updating your BIOS to fix the problem. ...
    (Fedora)