473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Bug in Datagrids

Hi.

When testing my app I believe I found a bug in datagrids (or is it just
me).

Here is the scenario:

Grid is attatched to a dataview. Dataview has a filter. I enter a new
record within the datagrid and when I click on the fixed column (the
grey bar on the left with an arrow pointing right when record is
selected) of the last record, I receive an error "Index was outside of
the bounds of the array". The new record must be on top.

To make sure that it was not something in my app I created a very basic
app with only data adapter, dataset, dataview ,datagrid. the dataview
had a row filter and when I entered a new record and clicked on the
last record to save the info, I got the error.

Has this ever been reported before? I did a search in google groups
for this error message and didn't get any hits. Is there any known fix
for this?

Thanks.

Sep 27 '06 #1
8 1022
1. Windows or web datagrid? Framework 1.1?
2. Are you handling any events in relation to the datagrid?
3. Post some code please, bare minimal example that demonstrates the
error

SN

Sep 27 '06 #2
MFleet,

With bugs we cannot help you in this newsgroup, we cannot affect that, this
website is for things like bugs.

http://connect.microsoft.com/Main/co...ContentID=2220

Cor

<mf********@yahoo.caschreef in bericht
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi.

When testing my app I believe I found a bug in datagrids (or is it just
me).

Here is the scenario:

Grid is attatched to a dataview. Dataview has a filter. I enter a new
record within the datagrid and when I click on the fixed column (the
grey bar on the left with an arrow pointing right when record is
selected) of the last record, I receive an error "Index was outside of
the bounds of the array". The new record must be on top.

To make sure that it was not something in my app I created a very basic
app with only data adapter, dataset, dataview ,datagrid. the dataview
had a row filter and when I entered a new record and clicked on the
last record to save the info, I got the error.

Has this ever been reported before? I did a search in google groups
for this error message and didn't get any hits. Is there any known fix
for this?

Thanks.

Sep 28 '06 #3
Hi.

1. I'm using a Windows Datagrid. I'm also using Framework 1.1.
2. The basic program that I wrote in which I got the error had no
events at all and I still got the same error.
3. The only code I have is loading the table and setting the row
filter of the dataview.

Note that it's an sql server database. I could try the same program on
an access database but I think that I would get the same error message.

Should I upgrade the .net framework?

Many Thanks!

Steven Nagy wrote:
1. Windows or web datagrid? Framework 1.1?
2. Are you handling any events in relation to the datagrid?
3. Post some code please, bare minimal example that demonstrates the
error

SN
Sep 28 '06 #4
Should I upgrade the .net framework?
Well yes, but not if its just to fix your problem!

Can you post your small example?
I will run it locally and see if I can recreate the bug.

SN

Sep 28 '06 #5
Hi.

Sorry for not getting back right away.

Here is the code example.

Try
'Fill the dataset
SqlDataAdapter1.Fill(DataSet11, "TestTable")
'Set a row filter to make sure that only one record is in the
grid
DataView1.RowFilter = "TableUID = 1 or testfield = ''"
'Now create a blank row
nr = DataSet11.Tables("testtable").NewRow

With nr
.Item("testfield") = ""
End With

DataSet11.Tables("testtable").Rows.Add(nr)

Catch x As Exception
MsgBox(x.Message)
End Try

That's it....Make sure that the Dataview does not allow new records but
does allow editing.

Thanks.

Steven Nagy wrote:
Should I upgrade the .net framework?

Well yes, but not if its just to fix your problem!

Can you post your small example?
I will run it locally and see if I can recreate the bug.

SN
Oct 3 '06 #6
Ok so the dataview is created in design mode and those properties are
added?
I can't look at this until the weekend sorry. I'll pull down your code
example and recreate the problem and have a look. Hope it can wait this
long.

Cheers,
Steven
mf********@yahoo.ca wrote:
Hi.

Sorry for not getting back right away.

Here is the code example.

Try
'Fill the dataset
SqlDataAdapter1.Fill(DataSet11, "TestTable")
'Set a row filter to make sure that only one record is in the
grid
DataView1.RowFilter = "TableUID = 1 or testfield = ''"
'Now create a blank row
nr = DataSet11.Tables("testtable").NewRow

With nr
.Item("testfield") = ""
End With

DataSet11.Tables("testtable").Rows.Add(nr)

Catch x As Exception
MsgBox(x.Message)
End Try

That's it....Make sure that the Dataview does not allow new records but
does allow editing.

Thanks.

Steven Nagy wrote:
Should I upgrade the .net framework?
Well yes, but not if its just to fix your problem!

Can you post your small example?
I will run it locally and see if I can recreate the bug.

SN
Oct 4 '06 #7
Hi...All data objects created in design time...Note the the new record
must be on top.

Thanks a lot!

Steven Nagy wrote:
Ok so the dataview is created in design mode and those properties are
added?
I can't look at this until the weekend sorry. I'll pull down your code
example and recreate the problem and have a look. Hope it can wait this
long.

Cheers,
Steven
mf********@yahoo.ca wrote:
Hi.

Sorry for not getting back right away.

Here is the code example.

Try
'Fill the dataset
SqlDataAdapter1.Fill(DataSet11, "TestTable")
'Set a row filter to make sure that only one record is in the
grid
DataView1.RowFilter = "TableUID = 1 or testfield = ''"
'Now create a blank row
nr = DataSet11.Tables("testtable").NewRow

With nr
.Item("testfield") = ""
End With

DataSet11.Tables("testtable").Rows.Add(nr)

Catch x As Exception
MsgBox(x.Message)
End Try

That's it....Make sure that the Dataview does not allow new records but
does allow editing.

Thanks.

Steven Nagy wrote:
Should I upgrade the .net framework?
>
Well yes, but not if its just to fix your problem!
>
Can you post your small example?
I will run it locally and see if I can recreate the bug.
>
SN
Oct 4 '06 #8
Hi there,

Well I recreated your program as best I could.
But I could not recreate your problem at all.

Here's what I did:
1. Create new windows app in 1.1. Created a sql server table called
"Test" with a "TestID" and "TestField". TestID is PK and is an
identity.
2. In design mode created SqlDataAdapter, Dataset, and a dataview,
pointing the datagrid to the dataview, and the dataview to
Dataset1.Test table.
3. added your code in form_load (with slight adjustment for table
names).
4. Ran it and the filter worked. Could not cause an error. Clicked
everywhere.

So I am not sure what I can do next to recreate this.

Steven

Oct 8 '06 #9

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

Similar topics

1
by: | last post by:
In SQL Server Query Analyzer, if I type in, say, 2 select queries, it returns 2 datagrids of results, with a scrollbar on the right to scroll between the 2 (or more) datagrids. I wanted to...
1
by: Simon Harris | last post by:
Hi All, I wish to populate more than one datagrid from the same OleDBCommand. The code I have is: Dim objCmd As New OleDbCommand(strSql, objConn) Then... ...
4
by: ree32 | last post by:
I have a placeholder and depending on a user input(a drop downlist) when the user clicks a button I dynamically create a number of datagrids and fill them with data from a database. But the problem...
0
by: Scott Meddows | last post by:
I'm having trouble scrolling some datagrids so they sync up... I have two identical datagrids on a form, filled with eh same dataset. I want a user to be able to scroll on the datasets and the...
4
by: | last post by:
Hello. In SQL Server Query Analyzer, if I type in, say, 2 select queries, it returns 2 datagrids of results, with a scrollbar on the right to scroll between the 2 (or more) datagrids. I wanted to...
3
by: Mark Wiewel | last post by:
hi all, i am a newbie in ASP.NET and i couldn't find the solution to this one: i have a form with three datagrids on it. i would like to align them vertically with a space between each grid of...
7
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table...
2
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
0
by: Jim | last post by:
OK here's my disclaimer: I'm very new to ASP.NET and posting on Google Groups, so please bear with me and feel free to correct either the way I code or the way I post. I have an ASP.NET page...
1
by: =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post by:
Hi, I am using the code below to export a webpage to Excel. The webpage has three datagrids on it and they are all exported to Excel properly and everything looks very nice, but we would really...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.