dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Data Grid in Master/Details

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Data Grid in Master/Details

    [Originally posted by Roopa]

    Hi,

    I developed a master detail form using "textboxs" and "datagird" control in VB6 & Microsoft Access. I am able to do updating records, deleting records & saving records but i am having following problems with it
    a) able to add record but can't add a new row in the datagrid
    b) in that data grid for example i wanted to calculate the amount, ie one of the field in data grid by multiplying the quantity and rate which are the fields of the same data grid. i wanted to calculate the amount itself when i enter the quantity and rate and reach the amount field.

    i think i have clearly explained my doubt.
    please suggest me.
    i will be grateful if anyone clarify my doubt.
    You can mail me at benzer@eth.net
    thanks in advance.

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re: Data Grid in Master/Details

    [Originally posted by Andon K.]

    a) You don't say how you add new records. Is it directly in the grid, or you first enter the values in text boxes and then after validation you transfer them into the grid with some sort of Save button?
    In the first case, you should check the field AllowAddNew on the General tab in the Properties window of your grid. In the second case, try the grid's Refresh method. Maybe your grid is full, and as the records are added at the end of the grid (out of the visible part) you just dont't see them.

    b) As for your second problem, you need a calculated column in your grid. Add a new column using the Columns.Add method and don't bound the column to any data field. All you have to do after is to set the value of that column in the apropriate event procedure, such as AfterUpdate or AfterInsert.

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    delete a record from datagrid

    [Originally posted by ASHRAF]

    Windows XP
    VB.NET
    SQL Server

    sir,

    i am developing a form module for master/details entry e.g "Invoice" using Textboxes and Datagrid. I am using dataAdapter to fill data in dataset.
    I am able to enter and save data. But I am unable to delete a record from datagrid. Secondly, i need to insert some column in my datagrid which is not in table. Like Item_desc,TotalAmt.

    Pls. tell me how to delete a record from datagrid. And it will be greate help for me if you could provide me a related example source codes. I am stuckup here from 2 months.
    Pls. help me.
    Nehal

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:delete a record from datagrid

    [Originally posted by Tariq Ali Shaikh]

    There is a property of datagrid called AllowAddNew. if this property is set false, you can't add records to the table using the grid.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center