Home All Groups Group Topic Archive Search About
Author
27 Sep 2006 6:16 PM
mfleet1973@yahoo.ca
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.

Author
27 Sep 2006 10:37 PM
Steven Nagy
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
Author
28 Sep 2006 12:39 PM
mfleet1973@yahoo.ca
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:
Show quoteHide quote
> 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
Author
28 Sep 2006 8:26 PM
Steven Nagy
> 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
Author
3 Oct 2006 9:32 PM
mfleet1973@yahoo.ca
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:
Show quoteHide quote
> > 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
Author
4 Oct 2006 12:40 AM
Steven Nagy
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


mfleet1***@yahoo.ca wrote:
Show quoteHide quote
> 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
Author
4 Oct 2006 1:55 PM
mfleet1973@yahoo.ca
Hi...All data objects created in design time...Note the the new record
must be on top.

Thanks a lot!

Steven Nagy wrote:
Show quoteHide quote
> 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
>
>
> mfleet1***@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
Author
8 Oct 2006 10:29 AM
Steven Nagy
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
Author
28 Sep 2006 4:00 AM
Cor Ligthert [MVP]
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/content/content.aspx?ContentID=2220

Cor

<mfleet1***@yahoo.ca> schreef in bericht
Show quoteHide quote
news:1159380972.992853.232490@i42g2000cwa.googlegroups.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.
>