473,386 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to write values in DataGridView

3
Hellow All
I am new in ASP.Net Application. I have a page with some TextBoxes and GridView. I have Done the Values of Textboxes save into Invoice Table and i want to save Invoice Detail values through DataGridView, But the DataGridView behave readonly.
In Windows Application form i can write in DataGridView (As many Record) and click save Botton then textboxes value save in Invoice table & DataGrid Values save in Invoice Detail Table. using this
Expand|Select|Wrap|Line Numbers
  1.  foreach (DataGridViewRow dr in dgview.Rows)
  2.  {
  3.    if (dr.Cells[1].Value != null)
  4.    {
  5.      CMS.Components.WEB.Invoice_Detail objd = new CMS.Components.WEB.Invoice_Detail();
  6.      objd.Description = Convert.ToString(dr.Cells["Description"].Value);
  7.      objd.Quantity = Convert.ToString(dr.Cells[2].Value);
  8.  
How can i use this senerio in ASP.Net Application?
Dec 9 '09 #1
1 2763
Frinavale
9,735 Expert Mod 8TB
In ASP.NET you don't have a DataGridView available to you.
You have a GridView instead.

They are very similar but not quite the same since they are developed for different environments.

So, what you need to do is create an Edit Template for your columns. In each edit template you need to define the appropriate controls that will let the user edit the record. These controls will be displayed when the user clicks the "edit" button.

All the information you need on the GridView and any other .NET controls can be found in the MSDN Library. This resource should get you pointed in the right direction....there are multiple articles on the GridView there. I recommend bookmarking the MSDN Library and using it as your primary resource when developing in .NET.

Also, take a look at the TemplateField as well. You use the TemplateField to define the Edit Template that I was talking about... check it out :)

-Frinny
Dec 9 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: dbuchanan | last post by:
Hello, Is this a bug? Is there some kind of work around? I want to add default values for a few columns in my datagridview I found the "DefaultValuesNeeded" event for the datagridview I...
0
by: schoultzy | last post by:
Hello Everyone, I have been trying to figure this one out for two days now. I have created a DataGridView which is populated by an ObjectDataSource. My problem occurs when I attempt to use the...
9
by: =?Utf-8?B?UGV0ZXJX?= | last post by:
I have a TabControl on a Windows form in which I have various tab pages each with a DataGridView, the first column of which is a DataGridViewCheckBoxColumn and subsequent columns being...
3
by: sankarpulivarthi | last post by:
Hi i have a checkbox in first datagridview . when it is checked it should get that row values.and iam trying to display that checked row values in a second datagridview after clicking a button....
1
by: gkinu | last post by:
Application-Generated Column Values in DataGridView on New Record I have a DataGridView which I am using to enter new records to a table with 5 columns/fields. However, values for two of the...
20
by: Phil | last post by:
VB2008 I have a DataGridView with MultiSelect = True and SelectionMode=FullRowSelect. One of the columns is a checkbox column. I have a function that goes through all the selected rows and sets...
0
by: gauravaroraasr1984 | last post by:
Hi all, I m making a project in which i need to select a row in datagridview. I have added a checkbox column in datagridview to select a particular row. But i want to trap that particular...
3
by: bharathi228 | last post by:
hi, how to assign a array as datasource to datagridview in vb.net. my problem is iam having an array with 60 values
3
by: buterfly0707 | last post by:
i want to get multiple values from datagridview to same textbox and i want to seperate those values from commas. and my datagridview in one form and the textbox in another form.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.