MSFlexGrid Error

bjdobosh

Member
Joined
Sep 5, 2006
Messages
6
Programming Experience
1-3
I'm having a problem with a project that i'm converting from VB6 to VB.NET

The program is using an MSFlexGrid.

When trying to add a row of data,

i get this error

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in axinterop.msflexgridlib.dll

Exception from HRESULT: 0x800A017D (CTL_E_INVALIDPROPERTYARRAYINDEX).

Does anyone have any idea what the problem is?

The code that is getting an error is:

GridEntryToMNudt.Generic = grdInv.get_TextMatrix(intRow, cstGridCols.Generic)

where GridEntryToMNudt.Generic is getting the string in the specific row, in the specific column called Generic.

I've googled and have come up with little explanation or work around.

Please help! Thanks
 
i have never used a MSFlexGrid but it sounds to me that intRow is an integer that is not representing a valid row in the Grids array. possibly try using intRow-1 instead?
 
Msflexgrid

Well, There are anywhere from 2 to 100 rows in the grid at a time, and i used the debugging to see what the intRow is returning in vb6 and then in vb.net. In vb6, it starts at 1 and then cycles through all of the rows. In vb.net, it also starts at 1. So, i'm not sure, but i will try using intRow -1 . Thanks
 
the idea behind using -1 was if the collection started at 0 in .net instead of 1, which apparently it dosent.

All i can suggest is to use a datagrid instead of a MSFlexGrid.
 
Msflexgrid

Thanks - i think i solved the issue for right now - i was calling the wrong number for the column.

This is an old vb6 project i'm upgrading for someone and the reasoning behind using the flexgrid over the datagrid is because it takes data from a access database and manually inserts it. As opposed to a datagrid where you need a dataset - its too complicated of a project to start re-writing the code for using the full capabilities of .net unfortunately...and it's time sensitive. :cool:
 
you have to change the grid fonts and the reader data fonts same. flexgrid format and retrieved data should be in equal fonts.
 
Back
Top