PC Review


Reply
Thread Tools Rate Thread

Bug in Datagrids

 
 
mfleet1973@yahoo.ca
Guest
Posts: n/a
 
      27th Sep 2006
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.

 
Reply With Quote
 
 
 
 
Steven Nagy
Guest
Posts: n/a
 
      27th Sep 2006
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

 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      28th Sep 2006
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

<(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
mfleet1973@yahoo.ca
Guest
Posts: n/a
 
      28th Sep 2006
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


 
Reply With Quote
 
Steven Nagy
Guest
Posts: n/a
 
      28th Sep 2006

> 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

 
Reply With Quote
 
mfleet1973@yahoo.ca
Guest
Posts: n/a
 
      3rd Oct 2006
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


 
Reply With Quote
 
Steven Nagy
Guest
Posts: n/a
 
      4th Oct 2006
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


(E-Mail Removed) 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


 
Reply With Quote
 
mfleet1973@yahoo.ca
Guest
Posts: n/a
 
      4th Oct 2006
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
>
>
> (E-Mail Removed) 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


 
Reply With Quote
 
Steven Nagy
Guest
Posts: n/a
 
      8th Oct 2006
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrids Uncle X Microsoft C# .NET 0 8th Feb 2006 03:51 PM
Datagrids??? Darryn Ross Microsoft C# .NET 1 19th Aug 2004 10:55 AM
Datagrids??? Darryn Ross Microsoft C# .NET 1 9th Aug 2004 06:25 AM
Using Datagrids in vb.net Ryan McConnell Microsoft VB .NET 4 13th Feb 2004 01:10 PM
Re: dataGrids Majid Qazi Microsoft VB .NET 0 7th Sep 2003 07:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:46 PM.