Click here to Skip to main content
15,910,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to programmatically freeze columns in an ASP.Net gridview control with Visual Basic.

My code is taken from the msdn knowledge base at:

https://msdn.microsoft.com/en-us/library/28e9w2e1(v=vs.90).aspx

The code is:

mydatagridview.columns("manufacturer").frozen = true

The gridview has been bound with a data which is automatically generated from a data field "manufacturer".


However, I get the error message:

'Frozen' is not a member of 'System.Web.UI.WebControls.DataControlField'.


Can anyone point me in the right direction to correct this?
Posted
Comments
Member 11659261 16-Jun-15 14:17pm    
Unfortunately these solutions are for a complex javascript solution whereas the .Net Framework 4.5 already has the solution in the form of the '.frozen' property of the GridView Column, I just can't get it to work.

I've checked that IIS is running v4.5 - it shows v4 when the page fails to compile, but I understand that's normal, for some reason IIS error messages show v4 even if v4.5 is being used.

I think I can answer my own question here - the datagridview is a windows form control, not a GridView. Doh! Too much late night coding.
 
Share this answer
 
Comments
Member 12882545 16-Jan-17 1:12am    
sorry , so, may I know, the correct code is
'mydata.columns("manufacturer").frozen = true'?
See the solutions to this CP post - Freeze Asp.net GridView HaderRow & Some Columns[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900