Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2004, 10:14 AM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Datagrid problem

Hi.

I'm making a WinForms application in VB.NET, and have a problem with a datagrid filled from an arraylist containing the objects i want to display in the datagrid.

The datagrid is filled correctly from the arraylist when the form is loaded, but there is some strange error here. When I click inside the datagrid, and then click on another controll on the form, I get the following errormessage:

    Error when committing the row to the original data store.
    Index was out of range. Must be non-negative and less than the size og the collection.
    Parameter name: index Do you want to correct the value?

The datagrid is readonly, and I only want to be able to select a row in it. Can anyone help me with this?

__
torisch
Tromsø - Norway

 
Old December 14th, 2004, 08:35 AM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Implemented a currencymanager to update the grid, and the problem was gone!

 
Old January 17th, 2005, 10:41 AM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

U need to create a primary key at the top where the page load section lies...follow by typing the primary key field in the "datakeyitem" at your datagrid's properties box. I had encountered the same problem before and it can be solved by this way. Cheers!

 
Old September 4th, 2006, 10:41 AM
Authorized User
 
Join Date: Aug 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I'm having exactly the same problem. You say you implemented a CurrencyManager - what do you mean by this? I'm setting the data source of the grid, which behind the scenes will create a CurrencyManager for the data source, but I've not had to use it. Do you mean you managed to create your own type of CurrencyManager,or manage to replace the one that got created automatically?

Also, there is no DataKeyItem property for the DataGrid.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with datagrid Shishir ASP.NET 1.0 and 1.1 Professional 1 January 6th, 2007 09:01 AM
Datagrid Problem monika.vasvani ASP.NET 1.0 and 1.1 Professional 1 December 5th, 2006 03:09 AM
DataGrid Problem anujrathi VB.NET 2002/2003 Basics 2 June 15th, 2006 02:18 AM
DataGrid Problem anujrathi ASP.NET 2.0 Basics 1 June 12th, 2006 03:52 PM
Datagrid problem dotnetprogrammer VS.NET 2002/2003 1 February 17th, 2005 05:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.