Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Data Entry in GridView Control

Data Entry in GridView Control

Scheduled Pinned Locked Moved C#
csharptutorialvisual-studio
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mads115
    wrote on last edited by
    #1

    Hi I am creating an Windows Application (C# Visual studio 2005) for Billing System in that i want to enter the fields(Product name,price,unit price, total) in GridView Control.... Please guide me how to enter the data in Gridview control Thanks in advance

    C N 2 Replies Last reply
    0
    • M Mads115

      Hi I am creating an Windows Application (C# Visual studio 2005) for Billing System in that i want to enter the fields(Product name,price,unit price, total) in GridView Control.... Please guide me how to enter the data in Gridview control Thanks in advance

      C Offline
      C Offline
      Chetan Patel
      wrote on last edited by
      #2

      Show the grid view with one blank row and then add one by one row if user press enter key in last one column of last row For validation use onEdit and OnEndEdit events...

      Best Regards, Chetan Patel

      1 Reply Last reply
      0
      • M Mads115

        Hi I am creating an Windows Application (C# Visual studio 2005) for Billing System in that i want to enter the fields(Product name,price,unit price, total) in GridView Control.... Please guide me how to enter the data in Gridview control Thanks in advance

        N Offline
        N Offline
        Niladri_Biswas
        wrote on last edited by
        #3

        Do you mean you want to bind the grid to some datasource? If this is the case, then get the source of the data and bind to the grid. e.g. Say I have a datatable(dtBilling) as my datasource and my gridview name is dgBilling.

        DataTable dtBilling = new DataTable();
        dtBilling.Columns.Add("Product Name");
        dtBilling.Columns.Add("Price");
        dtBilling.Columns.Add("Unit Price");
        dtBilling.Columns.Add("Total");

                dtBilling.Rows.Add("Prod1", "100", "2.50", "250");
                dtBilling.Rows.Add("Prod1", "200", "3.50", "3250");
                dtBilling.Rows.Add("Prod1", "300", "4.50", "450");
                dtBilling.Rows.Add("Prod1", "400", "5.50", "550");
        
                if (dtBilling.Rows.Count > 0)
                {
                    dgBilling.DataSource = dtBilling;
                }
        

        Hope this helps. But to be honest, the question does not seem to be very clear to me. Please let me know placidly, if you are looking a solution for this kind of problem or different! :)

        Niladri Biswas

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups