Solved

vb.net tableLayoutPanel.rowcount is incorrect

Posted on 2014-10-06
3
169 Views
Last Modified: 2014-10-21
Visually i have 10 rows on the screen
If i query the tableLayoutPanel.rowcount is always equals 2
this coincidentally equal my initial design time rows
i basically want to cycle through each control in the first column and need to know the number of rows
0
Comment
Question by:glenn_r
  • 2
3 Comments
 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 40364639
RowCount and ColumnCount don't return the number of items

You can specify both the ColumnCount and the RowCount properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the GrowStyle property allows for such growth. If the value of RowCount is 0, the panel will grow by adding rows, and if the value of ColumnCount is 0, the panel will grow by adding columns. Specifying panel growth with the GrowStyle property is preferred to setting RowCount or ColumnCount to 0, however.
http://bit.ly/1vIINJx
0
 

Author Comment

by:glenn_r
ID: 40364732
how can i get the number of rows in the control?
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 40364831
if you want the number of rows returned
you need to use the SQL command rowcount
http://msdn.microsoft.com/en-CA/library/ms188774.aspx

USE AdventureWorks;
GO
SELECT count(*) AS Count
FROM Production.ProductInventory
WHERE Quantity < 300;
GO

Open in new window

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now