VB.NET DataGrid

How to find the last row number ( the last column number) for DataGrid in VB.Net. IN VB6 it is DataGrid1.Columns.Count. I did not find such property in VB.NET. There is a property VisibleRowCount and VisibleColumnCount but it does not give the total quantity of rows.
LVL 28
iboutchkineAsked:
Who is Participating?
 
rkot2000Connect With a Mentor Commented:
   Dim x As Data.DataSet
    x.Tables("myTable").DefaultView.Count() 'rows
    x.Tables("myTable").Columns.Count() 'columns
0
 
Éric MoreauSenior .Net ConsultantCommented:
have you tried something like :
((DataTable)dataGrid1.DataSource).Rows.Count
0
 
iboutchkineAuthor Commented:
Worked as a charm!!!
0
 
lovely_kishoreCommented:
((DataTable)dglist.DataSource).Rows.Count

When i Tried the same code in vb.net the following error is displayed as tool tip
'DataTable' is a type and cannot be used as an expression.
can you give me the solution in vb.net

thanks in advance
email: kishore@sgstechnologie.com
0
 
jhstinsonCommented:
^ ^ You have to assign it to some integer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.