473,394 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to find selected row count in datagrid view control

I found the following code on the MS website:
and tried it, but it did not work:
Int32 selectedRowCount =
dataGridView1.Rows.GetRowCount(DataGridViewElement States.Selected);

The error says: Error 1 'System.Windows.Forms.DataGridView.SelectedRows' is
a 'property' but is used like a 'method'

Any ideas what I am missing?

Thanks,


Aug 24 '06 #1
1 8845
Ignore this. The line of code works fine.

"Tim Kelley" <tk*****@company.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>I found the following code on the MS website:
and tried it, but it did not work:
Int32 selectedRowCount =
dataGridView1.Rows.GetRowCount(DataGridViewElement States.Selected);

The error says: Error 1 'System.Windows.Forms.DataGridView.SelectedRows'
is a 'property' but is used like a 'method'

Any ideas what I am missing?

Thanks,


Aug 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sebastian Dau | last post by:
Hi, I'm trying to display a web site (help file) in a user control located in my managed c++ assambly. Unfortunately, I couln't find any generic HTML View Control so I decided to use the...
5
by: Praveen R | last post by:
Hi ! I am using a List view control to populate data onto. On the click event of the list view control, i need to find out whether the area clicked has any information of has no information. I...
2
by: Bob | last post by:
I looked at the sample in the msdn january 2005 - Introducing a new datagrid, but the project downloaded failed to open. Any one can point me to a bit of code on how to go and select an image...
1
by: eric.goforth | last post by:
Hello, I have the following select control: <SELECT name="Currency"> <OPTION VALUE="1">$-USD-US Dollar</OPTION> <OPTION VALUE="2" SELECTED >£-GBP-British Pound</OPTION> <OPTION...
1
by: Poornima | last post by:
Hello Iam new to .net languages.I want to create an editor(similar to ZelioSoft2 by Schneider Electricals) that takes input as electrical symbols .For that i need to create a table with 120 rows...
0
by: Rohit111111 | last post by:
Hello all, I have a tree view control that will populate data upto n level,on selection of a node i am binding a datagrid on the same page,now i have to expand that node which i have selected,which...
0
by: pankajprakash | last post by:
Hi, I have a treeview control which have checkbox control. I just need to fetch the selected checkbox value (id of selected node of tree view). I have used following code to get the no. of...
1
Eleven
by: Eleven | last post by:
Hi everybody! I've got a User Control "SelectBatchByTerminal", that has two dropdown lists, "TerminalDropDownList" and "BatchDropDownList". using System; using System.Data; using...
2
by: aapy | last post by:
I am trying to write a logic where upon selection of a row it should fill the form based on the value of the row selected from the datagrid view... But it is giving "select one row" message only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.