Hide a cell if i have a specific value in an other cell

4 posts, 1 answers
  1. Alexandre
    Alexandre avatar
    18 posts
    Member since:
    Sep 2013

    Posted 06 Jul 2015 Link to this post

    Hello,

     On my RadGrid, I have an column.

    On this column i have an image, but this image is hidden if i haven't a specific value in an other  column.

    How can i hide this ?

     

    Exemple :

    | ---------- | --------------------------|

    | Image   | Specific Value        |

    | -----------| --------------------------|

    | Nothing | Not specific Value  |   

    | -----------|---------------------------|

     

     

    Thanks for your support,

    Alexandre

     

  2. Alexandre
    Alexandre avatar
    18 posts
    Member since:
    Sep 2013

    Posted 07 Jul 2015 Link to this post

    Dim imgButton As ImageButton
               Dim label As Label
               Dim item As GridDataItem
     
               For Each item In RG_Matrice.Items
     
                   label = item("Statut_Matrice").FindControl("Lbl_StatutMatrice")
                   If label.Text = "En cours d'analyse" Then
                       imgButton = item("Freeze").Controls(0)
                       imgButton.ImageUrl = "~/Gen_Images/Freeze.png"
                   Else
                       imgButton = item("Freeze").Controls(0)
                       'imgButton.ImageUrl = "~/Gen_Images/Blanc.png"
                       imgButton.Visible = False
                   End If
               Next

     

  3. Alexandre
    Alexandre avatar
    18 posts
    Member since:
    Sep 2013

    Posted 07 Jul 2015 in reply to Alexandre Link to this post

    Solution of my prob :)
  4. Answer
    Viktor Tachev
    Admin
    Viktor Tachev avatar
    2342 posts

    Posted 08 Jul 2015 Link to this post

    Hi Alexandre,

    I am glad that you have found a solution that works for you.

    As an alternative approach I can suggest handling the ItemDataBound event of RadGrid. The event is fired for every row in the grid.

    In the handler you can check the value in the required cell. In case it does not equal a specific value you can hide the image in that row.



    Regards,
    Viktor Tachev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top