Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have been browsing for examples on how to freeze a column in a datagrid. Any expert out there able to provide any solutions? I am using vb.net 2003.
Thank you very much
Posted

Not supported in .NET 1.1. You have to use .NET 2.0 or better, which means Visual Studio 2005 or better.

I HIGHLY sugest you upgrade. Nobody uses .NET 1.x anymore unless their hands are tied behind their back and there's a gun to their head.
 
Share this answer
 
You can use the Frozen property for the relevant column, like this
C#
this.DataGridView1.Columns["yourColumnName"].Frozen = true;
 
Share this answer
 
Comments
Dave Kreskowiak 15-Mar-12 13:30pm    
Frozen was introduced in .NET 2.0. He's using .NET 1.1.

There is no equivilent in .NET 1.1.
Try this:
C#
In RowDataBound event add css to GridView cell:

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[0].CssClass = "locked";
        }
    }
 
Share this answer
 
Comments
Dave Kreskowiak 15-Mar-12 13:32pm    
If it's not specified, assume everyone who asks a question is using WinForms, not ASP.NET.
Wayne Gaylard 16-Mar-12 1:14am    
I didn't realise VS 2003 was restricted to 1.1, oh well.

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