Code for Hiding Autogenerated columns in a data grid

Posted by .Netlearner under ASP.NET on 1/7/2013 | Points: 10 | Views : 1093 | Status : [Member] | Replies : 1
Hello All,

Am having a data grid hich is loaded dynamically and its autogenerated property is set to true. I wanna hide a particular column on execution.I tried the following code,

dg1.columns[1].visible=false;

but its not working.Can anyone please guide me how to hide the particular column on execution while autogenerated property is set to true.

Thanks in advance.




Responses

Posted by: muralikrishnasurap-12704 on: 1/8/2013 [Member] Starter | Points: 25

Up
0
Down
Hi you can try below code for hiding auto generated columns for dynamic datagrid

datagridID.AutoGenerateColumns = false;

Best Regards
Murali Krishna.S

.Netlearner, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response