Conditionally display DataGrid or DalaList content

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Danny Ni

    Conditionally display DataGrid or DalaList content

    Hi,

    Is there a way to selectively display content of a DataGrid or DataList?
    Normally I bind them to datareader or datatable, and they will display all
    the rows, what if I don't want to display some of the rows.
    Please don't tell me get rid of the rows from datareader or datatable,
    that's not the answer I am looking for.

    TIA


  • Joe Fallon

    #2
    Re: Conditionally display DataGrid or DalaList content

    Here is an untested idea:

    Air code:

    Private Sub dg_ItemDataBoun d(ByVal sender As System.Object, ByVal e As
    DataGridItemEve ntArgs) Handles dg.ItemDataBoun d
    If e.Item.ItemType = ListItemType.It em OrElse e.Item.ItemType =
    ListItemType.Al ternatingItem Then
    Dim oHyl1 As HyperLink = CType(e.Item.Fi ndControl("hyl1 "), HyperLink)
    oHyl1.Visible=F alse
    End If
    End Sub

    --
    Joe Fallon



    "Danny Ni" <dndn@yahoo.com > wrote in message
    news:%236J%23x6 zfEHA.1048@tk2m sftngp13.phx.gb l...[color=blue]
    > Hi,
    >
    > Is there a way to selectively display content of a DataGrid or DataList?
    > Normally I bind them to datareader or datatable, and they will display all
    > the rows, what if I don't want to display some of the rows.
    > Please don't tell me get rid of the rows from datareader or datatable,
    > that's not the answer I am looking for.
    >
    > TIA
    >
    >[/color]


    Comment

    Working...