Results 1 to 2 of 2

Thread: [RESOLVED] itemdatabound and rowdatabound cancel display of one row

  1. #1

    Thread Starter
    Lively Member achor's Avatar
    Join Date
    May 2006
    Location
    Porto
    Posts
    123

    Resolved [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

  2. #2

    Thread Starter
    Lively Member achor's Avatar
    Join Date
    May 2006
    Location
    Porto
    Posts
    123

    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
  •  



Click Here to Expand Forum to Full Width