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

Hide and show the particular row from client side

2 Answers 489 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pavan
Top achievements
Rank 1
Pavan asked on 15 Feb 2012, 03:13 PM

Hello,

I have radgrid control in my page. I want hide the some rows in grid depending on the data in it. And I want to show these rows when clicking on the button which is inside the grid. I have attached the sample screenshot here.

2 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 16 Feb 2012, 09:27 PM
Pavan:

It's a little difficult to understand your requirement from your description. It's possible to hide the row based on some conditional check of a column's data value, but once hidden, the button for that row would not be available.

See the How do I hide a row from view in a radgrid forum thread for a way to hide rows based on data.

Hope this helps!
0
Tsvetoslav
Telerik team
answered on 17 Feb 2012, 08:38 AM
Hi Pavan,

I just want to add that in order to display back the items you need to attach a client-side event handler to the button's click event. Using dom operations (preferrably jQuery) you should get the parent row where the buttons is located. The parent row has an id which consists of two parts: the id of the grid's table view client-side component which the row belongs to + "__" + the index of the row. So you should split the ID, get the first part and use the $find(...) directive to get hold of the table view. Now that you have the table view object, hide/show the item using the following API:
http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-hideitem.html 
http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-showitem.html 

Hope it helps.
 
All the best,
Tsvetoslav
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Grid
Asked by
Pavan
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or