473,666 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.NET 2005 DataGridView

NaasDup
3 New Member
Hi

I have to read a CSV file in with 6 columns of data. The last column contains values delimited by & eg.
"Lastname","Fir stName","Zip"," Phone","Area"," 001&002%008&012 "

There are 100's of these rows in this CSV file. I have created a DGV with the type in the last column set to ComboBox and I have parsed the last column into a String array.

Question I have is, how do I load the contents of that array into the Combobox?

I have tried this but it does not work.

Expand|Select|Wrap|Line Numbers
  1. Dim comboboxColumn As New DataGridViewComboBoxCell
  2.  
  3. Temp2 = Split(Temp1, "&", , CompareMethod.Text)
  4.  
  5. For I = 0 To Temp2.GetLength(0) - 1
  6.   comboboxColumn.Items.Add(Temp2(I))
  7. Next
  8. DGV1.Rows(myRowCounter).Cells("colCodes") = comboboxColumn
Any help would be appreciatted.

Thanks
Feb 16 '08 #1
2 1388
kenobewan
4,871 Recognized Expert Specialist
You are not iterating the i, usually done using i++. HTH.
Feb 16 '08 #2
NaasDup
3 New Member
Hi

This is VB not C# . FOR - NEXT loops.
Maybe I need to be more specific. The above FOR loop works loading the array items in the define d combobox but not the part where I assign the box to a particular cell.

DGV1.Rows(myRow Counter).Cells( "colCodes") = comboboxColumn

This is the part that is not working - listing the data in the DGV cell's combobox.
Feb 16 '08 #3

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

Similar topics

1
5607
by: Arvind | last post by:
Hi I edit a cell in a DataGridView, and then would move to another cell in the DataGridView using mouse. Then the DataGridView as of now does scroll down to the last visited cell. But when I try to edit the same last visited cell, focus gets shifted to the first few visible rows as per the dimensions set for the DataGridView. To be exact it goes to the cell in the first row, and the same column. If I can say it this way, I would like...
0
1251
by: David Veeneman | last post by:
I've come across an odd bit of behavior on the VS 2005 TabControl, and I'm wondering if its a bug, or if I'm missing something. I have a TabControl with five tab pages. Each page has a DataGridView control. On FormLoad, I bind the grids to DataTables and set the grid columns' HeaderText to the column captions from the DataTables. The HeaderText assignment works fine for the grid on the first tab page, but for none of the others. For...
7
8359
by: Robert Koller | last post by:
Hello i have this problem: In a DataGridView the user work with data from a DataSet. on Start the row index from datagridview is the same as the row index from the dataset. Also: DataGridView.Rows(5) <=====> DataSet.Rows(5) .
1
7583
by: thomasp | last post by:
I have a datagridview in vb.net 2005 that pulls its data from an Access Database. The database has a time column. When you view the data in Access it shows only a time in 24hour format. When the same column is displayed in the datagridview, it displays a date and time. I assume the date is a default date as all 4000+ records display the same date in 1899. How do I format the column to show only the time? Thanks, Thomas
0
954
by: Jeff Vaccaro | last post by:
All I have a object that contains another object. For example my Provider object contains a clinic object. I added the Provider object as a datasource in 2005. It shows all of the properties including the clinic object (expandable). When I drag over the Provider object it creates a DataGridView with all of the Provider properties. Including just a column for Clinic. I have tried to edit the column of Clinic to something like
4
10231
by: dm1608 | last post by:
Hello, I have a DataGridView control in VB.NET 2005 that I would like to iterate thru row by row and parse out the individual columns into variables. Can someone provide me example code or direct me to a document that shows how this can be done? Thank you
5
1255
by: matthewtec | last post by:
I realize there are probably many discussions on these two... whether to get now or wait or yadda yadda yadda. My question is that I can continuing training on visual studio.net 2003, and continue to learn and be able to be an experienced programmer. And I fully realize that I'd obviously be missing out on some functionality. However, in the actual phase of getting a job, does anyone have any thoughts that would suggest I would get...
1
3836
by: ken | last post by:
Hi, Lets say we have a form that displays time card entries based on the calendar control date on the form. So the user clicks on a date and the form filters the table where the time card entries come from to get you proper data. In access I would just filter the query(rewrite its qrydef) and I'd get my answer. My question is, what is the proper way of doing this in ADP and SQL Server 2005. I could filter the data from the view on the...
0
1246
by: ken | last post by:
Hi All, I wanna to change the specific cell background color or text color in DataGridView according to diff cell content (say, if "APPLE" then the cell have red in color, if "ORANGE" then the cell have blue in color...etc, and the DataGridView control is binding to BackEnd SQL Server Database) So, what should I handle this case with DataGridView control in VB.NET 2005 ? can anyone give me in idea or some reference links?
3
8532
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I'm trying to add a datagridview control to a Windows Form to display read-only information in visual basic 2005. My understanding is that datareader will be faster for this purpose. I have the following questions: 1. Can DataReader be bound DIRECTLY to DataGridView? 2. If DataReader cannot be bound directly to DataGridView, how can I load a DataReader into a DataTable and bind the DataTable to DataGridView? Can the DataTable be a...
0
8443
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
8356
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
8866
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
8781
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
8550
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
5663
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
4198
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...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2769
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.