473,938 Members | 11,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to simulate the bindingNavigato r's AddNew Button

1 New Member
Hello,
First, sorry for my English, I hope you will understand me:) I'm new in using C Sharp and more with the bindingNavigato r.

What I would do is to simulate the button "add" (bindingnavigat orAddNewItem_Cl ick) programmaticall y. Indeed, rather than either the user who clicks on this button, I will like to call it programmaticall y.
What I do is:

bindingNavigato r.BindingSource = bindingSource;
...
...
...

bindingNavigato rAddNewItem_Cli ck (...){

BindingSource.A ddNew ();

}


It seems that I didn't do the simulation it in the right way. I wouldn't like to be obliged to make a EndEdit () and an Update() prior to navigate my bindingnavigato r. And if I didn't do the Update, I lose the data I've entered ?!?!?!

What I understand is that when you don't set de AddNewItem to None in the bindingNavigato r, it calls something (that I don't know) and after call the event bindingNavigato rAddNewItem_Cli ck. What I miss?


Is there someone who could help me please?
Jun 23 '09 #1
0 3958

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

Similar topics

4
5186
by: johnny | last post by:
On a form I would like to simulate a button click when the Enter is pressed. My form is setup and it works if the delegate for the key pressed on the form calls the delegate for the button pressed. But can we simulate a button click instead? This way if later the delegate is changed for the button, we don't forget to do the changes on other events?
5
14223
by: John | last post by:
Hi When I press the delete button on the BindingNavigator it deletes the record without any warning. How can I add a warning dialog when the delete button on the BindingNavigator is pressed and before the record is actually deleted? Thanks Regards
0
1121
by: Chuck Gantz | last post by:
I have a child table (the "TestType" that is in my code below) that I am trying to bind to its parent ("Test" in the code. I've commented out that line below sice it doesn't fix my problem). The Test table is bound to a BindingNavigator. Everything displays ok. In other words, when I click the advance or back buttons of the navigator, the nameTextBox1 control shows the correct Test text, and the TestTypeControl (which is my user control)...
1
20177
by: reidarT | last post by:
I have entered a BindingNavigator toolbar in a bound form and can manage to browse records and I am able to enter data in a new record. I am ot able to save the data and therefore I have entered the save-button. How do I code this button to save a new record? reidarT
2
7283
by: Dave | last post by:
I have a c# program that uses the bindingnavigator control. It works fine, but I want to add the ability for a user to change his mind after clicking 'delete' to delete a record. So if the user clicks delete I want to show a message box that says are you sure, and then stop the delete if the user wants to. I've places a messagebox.show in rowdeleteing, but when you say no, it deletes anyway. Where can I trap the delete and stop it?
3
9685
by: michael sorens | last post by:
I have generated an XmlDocument, then bound it to a DataGridView (thanks to a pointer from PeterBromberg in a separate, recent posting). Now I want to connect a BindingNavigator, but my rudimentary attempt failed. In the Visual Designer I added a BindingSource bs, then a BindingNavigator bn, and assigned bs to the BindingSource property of bn. In code, I generate my XmlDocument, massage it to fit into a DataSet, then assign it to the...
0
1495
by: eljainc | last post by:
Hello, I'm using a BindingNavigator control in my c# program. However, when the click() event is fired for an event, say the DeleteItem button, how do I modify the event handler to confirm the deletion? Also, I want to create a button as part of the BindingNavigator to make a copy of the current
7
27853
by: Dale Sampson | last post by:
As you can tell, I am new to VS.net. I have a VB project with a defined data source pointing to a table in a ..mdb file.-- The associated fields are displayed in textboxes using the tableBindingSource. There is also an associated BindingNavigator. The table's primary key is a field called 'who'. I have a valid value for 'who' and want to set the Navigator to the record that contains this value so the fields are displayed in the associated...
2
1448
by: csharpa | last post by:
Hi, I’m using VS2005 and the bindingnavigator control. Right now I’m using 2 bindingnavigator control (each for one table) in order to generate the new ID when I clicked the ‘add new” button. But I want to know what command and line of C# I must add to my program to generate the new ID when I clicked the “add new” button IF I want to have 1 bindingnavigator control for both of them. Thank you
0
10133
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9963
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11522
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11104
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10655
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9854
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8216
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7380
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
3499
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.