Solved

VB.NET DataGrid

Posted on 2002-04-22
5
2,760 Views
Last Modified: 2008-02-26
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.
0
Comment
Question by:iboutchkine
5 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6959912
have you tried something like :
((DataTable)dataGrid1.DataSource).Rows.Count
0
 
LVL 5

Accepted Solution

by:
rkot2000 earned 50 total points
ID: 6960344
   Dim x As Data.DataSet
    x.Tables("myTable").DefaultView.Count() 'rows
    x.Tables("myTable").Columns.Count() 'columns
0
 
LVL 28

Author Comment

by:iboutchkine
ID: 6960918
Worked as a charm!!!
0
 

Expert Comment

by:lovely_kishore
ID: 12206264
((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
 

Expert Comment

by:jhstinson
ID: 14683489
^ ^ You have to assign it to some integer
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question