|
-
Jun 5th, 2008, 08:52 AM
#1
Thread Starter
Lively Member
[RESOLVED] itemdatabound and rowdatabound cancel display of one row
Hello all,
I want to cancel a display of one row in a gridview if the field reference is "something"
something like this:
Code:
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
Dim objDT As Data.DataTable
objDT = Me.Session("cart")
If e.Row.Cells(1).Text = "S2" then
'cancel the display of that row and move on to the next one.
'somenthing like : e.row.canceldisplay (I know that this method doesn't exist :( )
Else
'--do stuff like formating the field--
aux = CDbl(e.Row.Cells(3).Text / 1.21)
e.Row.Cells(3).Text = Format(CDbl(aux), "#0.00")
End if
End Sub
Is it also possible to do this in a Repeater?
I hope i was clear on my explanation.
PS: I already searched here in vbforums but I could only digg up this thread http://www.vbforums.com/showthread.p...cancel+display posted by Wokawidget.
Best regards,
Achor
-
Jun 5th, 2008, 10:02 AM
#2
Thread Starter
Lively Member
Re: itemdatabound and rowdatabound cancel display of one row
Forget this thread,
I have approached the problem from another view.
The solution was to do a add a data.dataview and through the row filter I do another select clause: select * from objDT where reference not like 'Something'.
Easy and Effective.
Hope that this solution works for any other programmer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|