Click here to Skip to main content
15,902,299 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to have a fixed listview column width in a windows form application C# ?

[Edit]i want to stop the user adjusting the column width. I tried the above methods. none of them worked... :/[/Edit]
Posted
Updated 8-Nov-11 22:07pm
v2

These discussions[^] may help you.
 
Share this answer
 
 
Share this answer
 
Try
C#
private void listView_ColumnWidthChanging(object sender, ColumnWidthChangingEventArgs e)
{
    e.Cancel = true;
    e.NewWidth = listView.Columns[e.ColumnIndex].Width;
}


Reference Link :- how to fix the column width of a listview in c# windows form[^]
 
Share this answer
 
You cannot do this with a ListView. You should use a DataGridView and Set the Columns Resizable Property to false in the columns editor.

Hope this helps
 
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