Problem with datagrid in visual basic .net

cuisancio

Member
Joined
Mar 7, 2006
Messages
11
Programming Experience
Beginner
Hello, i have to migrate some code from VB6 to VB .net and i've found a problem with the datagrid.

I've this method, it runs well in VB6.

Public Sub ShowDatagrid(ByVal dtg As DataGrid)

Dim i As Integer
Dim HeighN As Long
Dim ValidColumns As Integer

ValidColumns = dtg.Columns.Count / 2

HeighN = VB6.TwipsToPixelsY(360)

For i = ValidColumns To dtg.Columns.Count - 1
If dtg.Columns(i).dataField <> "" Then
Load_label(dtg.Columns(i), i - ValidColumns)
[...]

But in VB .net it doesn't compile because Columns is not a member of DataGrid. Please, there is some easy way to solve that?????

Thanks.
 
Well, this is going to sound like a silly idea.... but how about typing (in the IDE) dtg. and see what comes up when you hit the . .... use the intellisense that's built-in to see what's in there.

-tg
 
TechGnome said:
Well, this is going to sound like a silly idea.... but how about typing (in the IDE) dtg. and see what comes up when you hit the . .... use the intellisense that's built-in to see what's in there.

-tg

Well, obviusly i did that first of all. My question isn't if Columns is or not member of datagrid, that it's obvious that it isn't, but how can i do the same thing i did in VB6 with .Columns in VB .net. When i typed dtg. i saw a lot of methods and i searched for something with a similar function, but the descriptions of some of them were slightly different and i doubt they do the same. (F.E. VisibleColumns.Count). Thanks anyway, TechGnome.

Another replies?

Thanks.
 
Back
Top