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

How to hide the data in cell inside radgrid

1 Answer 196 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Akki
Top achievements
Rank 1
Akki asked on 14 May 2012, 02:30 AM
Hi,

I have a grid with 4 coulmns as shown below, i want to make the id column with data 0 and 888 empty.
How can i achieve this ? Please suggest


Id

Desc

Stats

Action

0

asas

T

A

11

Public

T

A

 12  asdgf  T A
 888  ghjk;  T  A


Regards,
Akki

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 May 2012, 04:46 AM
Hello Akki,

Try the following code to achieve your scenario.
C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
 if (e.Item is GridDataItem)
 {
    GridDataItem item = (GridDataItem)e.Item;
    TableCell cell = item["Id"];
    if (cell.Text == "0" || cell.Text=="888")
    {
       cell.Visible = false;
    }
 }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Akki
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or