This is a migrated thread and some comments may be shown as answers.

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

3 Answers 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexandre
Top achievements
Rank 1
Alexandre asked on 06 Jul 2015, 04:07 PM

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

 

3 Answers, 1 is accepted

Sort by
0
Alexandre
Top achievements
Rank 1
answered on 07 Jul 2015, 08:27 AM
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

 

0
Alexandre
Top achievements
Rank 1
answered on 07 Jul 2015, 08:28 AM
Solution of my prob :)
0
Accepted
Viktor Tachev
Telerik team
answered on 08 Jul 2015, 02:09 PM
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
Tags
Grid
Asked by
Alexandre
Top achievements
Rank 1
Answers by
Alexandre
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or