Data Grids

Results 1 to 2 of 2

Thread: Data Grids

  1. #1
    Join Date
    Dec 1969

    Default Data Grids

    Is there an easy way to create a data grid column out of the concatenation of multiple datasource fields and literals?<BR><BR>For example if a particular field in my dataset evaluates to "true", I would like to dynamically create an additional column for that record that contains a link to a details page.<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Data Grids

    Look into the ItemDataBound event. You would set up your template column with a HyperLink control with ID MyLink. You would then check the value of the datasource in the event handler and set the visibility of the control accordingly. For example:<BR><BR>&#039;Declare Global Variable...<BR>Dim MyGlobalDataReader As DataReader<BR>&#039;Bind DG somewhere...<BR>MyDG.Datasource = MyGlobalDataReader<BR>MyDG.DataBind<BR><BR>&#039;I nside ItemDataBound event handler...<BR>e.Item.FindControl("MyLink").Visible = MyGlobalDataReader("BooleanColumn")<BR><BR>&#039;. ..<BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts