Re: Strange Problem: Removing rows from Table object doesnt update rowcount of Gridview
- From: "MasterGaurav \(www.edujini-labs.com\)" <gaurav.vaish.nospam@xxxxxxxxxxxxxxxx>
- Date: Wed, 9 May 2007 13:05:37 +0530
I'm removing rows from a gridview using Table.Remove( ). This removes the
rows from the gridview.
But the problem is although it removes rows from the gridview it doesnt
update the Gridview.Rows.Count to return correct number of rows remains on
the gridview. Instead it always returns the number of rows gridview
originally had prior to removing them.
Anybody know why this is happening? How to remove gridview rows in a
manner so that it will update the rows.count property correctly?
That's not the way of removing rows.
Gridview.Rows.Count does not return Table.Rows.Count!
Gridview.Rows.Count is for the DataSource's row-count.
Well, you cannot control the items that will be pushed in the grid if you
cannot control the data-source.
If you want to remove any item, ensure that you also remove it from the
datasource to which you are binding the gridview.
--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujini-labs.com
http://eduzine.edujini-labs.com
-----------------------------------------
.
- Follow-Ups:
- References:
- Prev by Date: Re: Key in Dictionary
- Next by Date: Re: grid cell has onclick but hand is not shown
- Previous by thread: Re: Strange Problem: Removing rows from Table object doesnt update rowcount of Gridview
- Next by thread: Re: Strange Problem: Removing rows from Table object doesnt update rowcount of Gridview
- Index(es):
Relevant Pages
|
Loading