Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 20th, 2008, 01:26 PM
Authorized User
Join Date: Apr 2007
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help related to GridView using C# in asp.net 2.0

Hi all,
   I am new to Web development. I have taken a project "Inventory Management" at my office. Now I am got stuck in GridView part. I have designed a Purchase Order Web Page, in this the user is required to feed in (lets say) Five items along with their rates based on the purchase order number and vendor name through which the items are going to be purchased.
   Item description has been taken from ItemMaster table in dropdownlist control. The user is required to select an item from the dropdownlist and feed in their rates. This part is being done in gridview and is working.
   What I have come to know while developing, u cannot view GridView at runtime unless atleast one column is databound with some table.
   For that I have taken a temporary table which have only one field i.e. serial no. So when I click the button "AddNew" one row is added into the table thereby simultaneously incrementing one row of gridview. This is also happening whenever I click the Button.
   This grid view has 4 columns - 1.S.No. [DataBound], 2.Item Code, 3.Item Descripttion, 4. Rate.
Though HTML Templates I have created
                 a TextBox for ItemCode, (2)
                 a DropDownList for Item Description (3)
                 a Text Box for Rate (4)
Now when I run the program it shows the gridview in proper formatted way :

   Button => AddNew
  S.no. |Item Code | Item Description | Rate
   1 TextBox DropDownList TextBox

   In first row a user can select item description, item code automatically comes based on the selected item and then feed in the rate accordinglly.

PROBLEM => But the moment "AddNew" button gets clicked whole data gets cleared including the first row. why this is happening. How can I solve this problem? Please HELP ?


Another way of entering the data what I thought is :

Step 1 : Dyanamically I create a textbox for itemcode,
          dropdownlist for item description and textbox for rate.
Step 2 : Then count number of rows in a Grid.
Step 3 : If there is one row then these dynamically created
          controls will be placed in the respective cols of grid.

This should happen <Step 3> whenever "AddButton" is clicked

Now the same problem how to do this.

Please help ?

Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net 2.0 Gridview control vertical scroll bar kulkarnimonica ASP.NET 2.0 Professional 2 March 8th, 2010 08:14 AM
VB5.0 to VB .Net upgradation issue related to DAO setu VB How-To 1 October 10th, 2007 03:15 PM
storing a gridview to session in asp.net 2.0 thas123 ASP.NET 2.0 Basics 0 December 20th, 2006 06:12 AM
asp.net frames and gridview ramuis78 ASP.NET 1.0 and 1.1 Basics 2 August 2nd, 2006 10:04 AM
how to deal with this problem related with ADO.NET zouky ADO.NET 2 October 8th, 2004 04:30 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.