473,503 Members | 7,823 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Add a Row in WebForm?

Hi,
I need to add a row in a WebForm, using VS 2005 and C sharp, using a
SQLDataSource.

If the table or SQLDataSource is empty, and you use a DetailsView
Control to let the user add a new row, the "New" hyperlink is
invisible. Therefore, the user can't add a row. So, what can I do?

Thank you

VictorReinhart

Dec 14 '05 #1
2 1248
I dont know if this will help since i dont have any experience with the
DetailsView control. In a DataGrid/DataSet/DataView scenario when the page
loads I check if the DataSet is empty and if it is I use
DataTable.Rows.Add() and DataTable.NewRow() to automatically add a blank
entry and then Set DataGrid.EditItemIndex = 0 to start editing the first
row.

Hope that helps,
Dave

"VictorReinhart" <vi**************@phs.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Hi,
I need to add a row in a WebForm, using VS 2005 and C sharp, using a
SQLDataSource.

If the table or SQLDataSource is empty, and you use a DetailsView
Control to let the user add a new row, the "New" hyperlink is
invisible. Therefore, the user can't add a row. So, what can I do?

Thank you

VictorReinhart

Dec 14 '05 #2
The solution for a FormView is:

FormView1.ChangeMode(FormViewMode.Insert);

For a DetailsView, it is probably:

DetailsView1.ChangeMode(DetailsViewMode.Insert);

Now, if only this could be done for a GridView!

Dec 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1433
by: Andrew | last post by:
Hi, Until now, I have used a single webform for my web app, and everything's been OK. Now, I've decided to create a main menu webform. So, I've got two webforms. Using Visual Studio .NET (with...
3
1834
by: Prasad Patil | last post by:
Hi, I have a webform, The link on the webform should call the exe program installed on the client machine when the user click the link on the webform. It should run the exe installed on the...
1
3511
by: hqdtech | last post by:
how to refresh webform from other webform I have 2 webform, i want if webform A was close then webform B wil refresh. And the problem second: how to catch packet on the network in C#. ...
3
3267
by: trint | last post by:
Ok, I have tried to do this with the System.Web.UI and can't find anything for the webform. It seems much easier for a Winform. Any help in trapping Webform keydown event and keyup event is...
5
2027
by: Jerry | last post by:
I am using .Net 2003. I have been working with this ASP.Net webform that I created a few weeks ago. It has been working fine. However, while modifying the webform today, this webform stopped...
2
1386
by: Craig Douthitt via DotNetMonster.com | last post by:
I am trying to capture an buttonclick on a usercontrol in the webform the usercontrol resides in. After researching this issue, I've come to believe that the best way of handling this is by raising...
6
1875
by: Skeptical | last post by:
Hello, I am trying to embed html output into my webform but could not figure out how to so far. The form will execute a Perl script with some parameters, and script will output some html...
2
1957
by: Rob | last post by:
I have a webform that uses the TabStrip and MultiPage webcontrols. I also have a Print button on the form to print all of the information of the webform (all tabs): <input type="button"...
3
3506
by: Dean Slindee | last post by:
Would like to call the TabShow function on WebForm InOutHost from another WebForm in same project, but cannot figure out how to get a reference. Can this be done? In this statement: Call...
5
2546
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have start web form and when the user clicks a button (server.transfer) they are directed to the second webform. I was wondering if there is a way to create an instance of the first webform...
0
7193
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
7067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7264
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
7316
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...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5562
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.