473,569 Members | 2,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

populating datagrid error

Hello,

I am having trouble with a datagrid.
I received help online to create the datagrid the way I needed it, so I'm
not entirely clear on how/why it works.

I use the following code to populate the rows of my datagrid.
The variable _arrstr contains my column headers.

For i = 0 To (_dataset1.Tabl es(0).Rows.Coun t) - 1
dataTable.LoadD ataRow(_arrstr, True)
'column 1 - Cutting Permit
datagrid1(i, 0) =
_dataset1.Table s(0).Rows(i).It emArray(1).ToSt ring()
'column 2 - Cutblock
datagrid1(i, 1) =
_dataset1.Table s(0).Rows(i).It emArray(2).ToSt ring()

'etc for all my columns.
Next i

For the most part this works great.
I run into a problem when:
I have a combobox that provides a filter, and a button that when pressed,
populates this datagrid, based on the filter.
The first time I select a filter, then press the button, this works fine.
If I change the value again, and press the button, the correct rows display,
but additionally, for each row displayed, the values of _arrstr populate a
row after that.
So if there should be 4 rows of data, there are, and there are 4 additional
rows containing my column header information.

I'm not sure where this problem is coming from...

Any suggestions??
TIA,
Amber
Oct 4 '05 #1
0 1014

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

Similar topics

2
10560
by: Robert | last post by:
I'm sure this is a fairly basic question, but I've been looking all over the web for days for suggestions on how to do this. I've got a datagrid that's bound to a dataset on my form. It includes several columns, the last of which (with the header Quantity) contains int16 values. When a user selects a row, I would like to have a combobox on...
4
3918
by: Paul | last post by:
I sometimes get a timeout error when populating my datagrid, the code is WizardConnection.Open() UpdateCommand.CommandText = "EXECUTE sp_assign_user '" & PhysOffice.SelectedValue & "', '" & Context.User.Identity.Name & "'" UpdateCommand.ExecuteNonQuery()
5
2269
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a collection object -- say, a dictionary. Populating that collection object with custom objects, say, Person. What I really want to see is how to...
7
5316
by: coleenholley | last post by:
Hi all :-) I have a couple of web pages created using ASP.Net and VB code-behind. We use a connection call through an RPC to COBOL, NOT an SQL connection, so my connection to get the data is done in a Class Module (VB), which populates the datagrid. The datagrid is bound in the code-behind the ASPX page, as such dtg_worksheet1.DataSource =...
1
1765
by: Mike P | last post by:
I am populating a drop down column in a datagrid on page load. Here is my code : <asp:TemplateColumn> <ItemTemplate> <asp:DropDownList ID="ddlUserName" Font-Name="Verdana" Font-Size="8pt" Runat=server DataValueField="UserName" DataTextField="UserName" DataSource='<%# GetUserList() %>'>
0
7695
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...
0
8119
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...
1
7668
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...
0
6281
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...
1
5509
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...
0
3653
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...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
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...

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.