Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

vb.net tableLayoutPanel.rowcount is incorrect

Posted on 2014-10-06
3
177 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 80

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 80

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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