In my last project i want to calculate only those rows who display in grid not all.

when i am using MyGrid.RowCount or MyGrid.Rows.Count it gives me all rows..

Finally i find event DisplayedRowCount

Here is sample

public int DisplayedRowCount(
bool includePartialRow
Parameter : includePartialRow
true to include partial rows in the displayed row count; otherwise, false.

Int32 count = DisplayedRowCount(true);
Int32 count1 = DisplayedRowCount(false);

count return all row count
count1 return all visible row count..



About Asif
Hello Friends… I have done my Bachelor of Engineering in Information Technology from Gujarat University. I have 1.7 years experience of web and windows based application development.. My basic idea to start a blog is to store all important link which help me in my application and access to every where. Also this information is help others who want to makes their application powerful. I am interested in .net framework (1.0,2.0,3.0,3.5 and more). This blog contain also many information related to SQL, Custom Controls in Please share your ideas and any query if you have...

One Response to DataGridView.DisplayedRowCount

  1. Guest says:

    > count return all row count

    That does NOT return “all rows”.

    Only the visible rows.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: