473,811 Members | 3,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add Items in the DatagridViewCom boboxColumn of DatagridView during runtime

45 New Member
Hi,

My application is in VS2008 and coded in VB.net.

I have a datagridView(DG V) on one of my form.DGV contains a column of type DatagridViewCom boboxColumn.I have another column of SrNo.

Consider Table1 to be the table from where my DatagridView is filled which contains following fields SrNo,Value1,Val ue2.

My requirement is i want to fill the values in my DatagridViewCom boboxColumn from Table1.The DatagridViewCom boboxColumn's combobox should contain values of columns Value1,Value2 of Table1.

Sample data of Table1

SrNo Value1 Value2

1 2 3

2 4 5

As data in datagridView is filled from Table1 the data of SrNo column of Table1 is also populated in one of the column of DGV.

Now my DatagridViewCom boboxColumn combobox should contain the values of Value1 and Value2 of Respective SrNo.

Like Row one of my DGV has SrNo 1 as first value,so the Value1 and Value2 of SrNo 1 should be added to the row's DatagridViewCom boboxColumn.

Select distinct Value1,Value2 From Table1 where SrNo=DGV.items( 0,DGV.currentce ll.rowIndex).va lue.Hope this Query willl make things more clear

Please Suggest.
Oct 11 '11 #1
3 3306
kadghar
1,295 Recognized Expert Top Contributor
Try creating a DataSet, fill the data set and then just use the BIND method of your DGView.
Oct 11 '11 #2
SEhtesham
45 New Member
dude i know how to fill the datagridview...
i want to fill the DatagridViewCom boboxColumn.Ple ase help how can i fill that combobox in DatagridView.Da tagridViewCombo boxColumn should have the values of columns Value1 and Value2 from Table1.
Oct 12 '11 #3
1sanjeev
1 New Member
How to calcuate clossing balance when opening fix in sql server:
Oct 13 '11 #4

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

Similar topics

1
4376
by: Tom Rahav | last post by:
Hello. I use visual basic .net 2003 and Crystal Reports for creating win-reports. My question is if there is any possibility to set font properties (type, color and size) of a text control or data field during runtime. To be more accurate, I know I can set these settings by formula (next to each property in design time), but I would like to let the user choose what font settings he would like to use. I allow the user to set there...
1
32236
by: Jeff N | last post by:
It it possible to change a button's or text box's font size during runtime? When I try to build my application with this code: this.ActiveControl.Font.Size = "8.25"; I get this error message: Property or indexer "System.Drawing.Font.Size' cannot be assigned to -- it is read only I can change a button's text property during runtime, but I'd also like to change the font size as well.
2
1706
by: Newbie | last post by:
Hello! I'm trying to figure out how to do the following: I need to show a table (perhaps using DataGrids, repeaters or others) for each salesperson in the sales dept. But the no. of tables to be shown is to be determined during runtime. It's possible that some salespersons have no sales figures to begin with and therefore no table to show. Thanks in advance and please help!
3
3010
by: Newbie | last post by:
hi! i am able to upload files successfully. but i have one minor problem. files are uploaded correctly if the directory exists, it is throwing an exception if the directory doesnt exist. but the directory name is created during runtime. is there a way to create a directory during runtime? exception: Error saving file C:\temp\188\ System.IO.DirectoryNotFoundException: Could not find a part of the path
1
1361
by: sageer | last post by:
I'm want retrieve a file, edit it and then copy it to a folder during runtime I'm trying to figure where exactly can I store these files in the ..NET solution so that I can access them during RunTime.
3
10631
by: Sampson | last post by:
I have a question about enumeration and how to populate them during runtime. I am using vb.net but will happily take any advice in c# as well. Here is an example to help illustrate what I am after. Create a class named “clsMyItems” and in that class place an enum. Public Enum Items Item1 = 0 Item2 = 1 Item3 = 2
1
1050
by: polarbearvillage | last post by:
I am using Visual Basic 2005. Okay, I add items to a dropdown menu on a toolbar during runtime, and I when I click them, I need to shell the program that is associated with that one item (I have the program path figured out). Each item is in an array. How would I do this?
2
6236
by: sagarbakliwal | last post by:
hi, I am new to this forum but i have received a lot of help reading through this forum. I am creating a VB.NET application for Patient Record Management. In this there are various combo boxes and buttons being generated during run time when a particular patient ID is searched for. Say one patient might have 2 entries some may have 10 entries. So the controls are generated dynamically and then the control names are added to the forms...
8
39953
by: kashifabbasi786 | last post by:
I want to change the DataGridView Heading on run time by giving in textbox. how i will do this,plz help me Thnx
2
2289
by: letobale1982 | last post by:
Hello I would like to get some ideas on how to modify a Combobox during runtime and save the changes so next time the form is ran changes are available. Here is the plan. A form displays a combobox that get populated with several items. Next to the combobox I will add three buttons: Add, Delete and Modify. My idea is that the combobox will read a previously created file with the items of the list. And each button will modify that same...
0
9724
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
10644
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...
1
10394
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,...
1
7665
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
6882
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
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4336
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
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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.