Tuesday, July 7, 2009

hide/show column or hidden value in grid using client side code for ASP.NET

We all follow one problem with grid control that we need some value from one column but we do not want to display that value to user and this lead us to lots of problem.

The very easy solution to this problem is user css property display:none in style.

This is very easy to use and still we can get the control in javascript and get value.
Example

add label in templatecolumn :


asp:label id="lableid" runat="server" style=" style="display: none"

and now using itedatabound event attach your javascript and sent clientid of you label control in that. Now you can use the value in your lable control.

No comments: