473,625 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to fill all controls with a record by selecting a record from datagridview

3 New Member
In my form i want to be able to fill all my controls with a particular record by selecting that record from my datagridview.If i select a particular record after clicking on it all my controls like textbox etc will be filled with that specific record.
Can i do this without using binding context?
Dec 17 '09 #1
4 1900
GaryTexmo
1,501 Recognized Expert Top Contributor
Yes. There are several events on the DataGridView class that you can use... RowEnter looks promising, or perhaps SelectionChange d? Whichever one suits your needs, you should be able to set it up so that you fill your controls with the data from the selected row or cell
Dec 17 '09 #2
techno58
3 New Member
Thanks for the quick reply .I know that i can use those events,but my point how am i supposed to tell which row.How am i supposed to say that i have selected that particular row
Dec 17 '09 #3
ThatThatGuy
449 Recognized Expert Contributor
put this code in DataGrid_RowCha nged or some relevant event and then type this code...

Expand|Select|Wrap|Line Numbers
  1. if(DataGrid1.SelectedRows.Count!=-1)
  2. {
  3. DataRow dr=DataGrid1.SelectedRows[0];
  4. }
  5.  
Now Loop through dr and then get all the values
Dec 17 '09 #4
GaryTexmo
1,501 Recognized Expert Top Contributor
I'd also be willing to bet that the row comes through in the event arguments... depending on what level of detail comes through.
Dec 17 '09 #5

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

Similar topics

0
4050
by: dbuchanan | last post by:
Hello, I have added a query to my TableAdapter that accepts a parameter (The ID) to filter the data. It will return only one record. I tested it in the designer and it returns one record as expected. However I cannot get it to populate a form of databound controls. What could I be doing wrong? The controls were dragged onto the form surface which then made the dataset, tableAdapter and bindingSource in the forms component tray.
0
1577
by: Pieter Coucke | last post by:
Hi, I have a DataGridView, that contains a list of Articles, which can be added (automaticly via the AllowUserToAddRows) and changed by the user. The current item is also displayed in textboxes under the datagridview, to give more space for the user to change the item. But I'm getting some werid results with it: - When I add the first item to the DataGridView, and I change the values of the cells in the DataGridView, these values are...
2
15157
by: Bob | last post by:
How do I show a calendar control or another appropriate control to pick a date and time for a cell in a column in a datagridview? Thanks for any help. Bob
0
2689
by: KelHemp | last post by:
Greetings, I've been using this site for lots of access help in the past, and it's very helpful! I have a new complexity for you all. Reworking a form to record 70-80 years of oil production on multiple leases, which have multiple wells within them. Most wells can fit on one printed page (one record), but in the case of overspill, we want to do the following: -Move to a new record and auto fill the LeaseName, LeaseNumber, Operator,...
2
16841
by: Adrien Reboisson | last post by:
I'm trying to build a basic DB explorer using C# & Visual Studio 2005. I installed SQL Server 2005 Express, created a blank project, dropped a TreeView, a ListView and a DataGridView : DB objects (Databases, tables, SPs, and so on) are displayed in the tree, table colums definitions in the list and I want to display the selected table content in the DataGridView. So far so good. Currently, I succedded in loading the treeview and the...
1
2596
by: Bob | last post by:
Hello, Using VB 2005.net. I have a bound datagridview and a delete button control (or when the user pressed the 'Delete' key) I can successfully delete the selected record from the table and it is removed from the dgv. But then I want to select the previous row in the dgv and select it so on 'Select Index Changed' event I can populate text boxes referring to the selected row. The user may have selected the 5th row in the dgv then...
5
1444
by: Paul Hemans | last post by:
Hi, I am using VS2005. I have a form with a tabControl on it. Suddenly I can no longer see any of my controls, on any of the pages, or even the tabControl itself. They still exist because the various objects are available in the properties interface. If I select one I can see all the properties but the control doesn't show in the design area. When I run the application the form appears blank. Here are the properties on the tabControl that...
2
294
by: DaveL | last post by:
Hello, I have a Custome Control which contains TextBox Button DataGridView design is Textbox , button When a user clicks the button i resize the custom control canvasarea to expose the datagridview below the textbox
6
5487
by: akshaycjoshi | last post by:
I have one datagridview which i fill using the connected verion of ADO.NET. When the user presses the search button a seperate thread is created and in that thead i connect to the database and fill the datagridview. private void cmdsearch_Click(object sender, EventArgs e) { ThreadStart t = fillthegrid; Thread fillthread = new Thread(t); fillthread.Start(); }
0
8251
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
8635
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...
1
8352
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8494
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
7178
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
6115
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
5570
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();...
0
4085
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2614
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.