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

Hide Rows while prerendering

1 Answer 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Yasin
Top achievements
Rank 1
Yasin asked on 18 Jun 2014, 05:54 PM
HI,

I am trying to hide few rows based on some condition. I am able to hide content of the row, but the row is rendered with property display:'table-row'. It should have been 'none'.

I am traversing through mastertableviews.GetItems(GridItemType.Item,GridItemType.AlternatingItem)

to hide the row, i have tried griddataitem.Visible = false and also griddataitem.Display=false.

Please suggest me an approach to hide the row while prerender event handling.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Jun 2014, 04:07 AM
Hi Yasin,

Try the following code which is worked as expected.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
   {
       foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
       {
           if (item.ItemIndex == 0) //your condition
               item.Display = false; //render as display as none
       }
 
   }

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