deleting a row in a datagrid

T

Tim Seaburn

after filling a datagrid from code, I now need to delete rows in the grid
based on some conditions. Can this be done in the ItemDataBound or
ItemCreated events? if not is there any other way to explicitly delete a
row before it displays?
thanks,
TM
 
A

ashelley

after filling a datagrid from code, I now need to delete rows in the grid
based on some conditions. Can this be done in the ItemDataBound or
ItemCreated events? if not is there any other way to explicitly delete a
row before it displays?
thanks,
TM

use a DataView RowFilter property.

-Adam
 
A

AZ Developer

In the ItemDataBound event, set the Visible property of the Row to
False.

For Example:
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
PrepRequests.ItemDataBound
'If some condition then
e.Item.Visible = False
End Sub

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top