on button click the visibility of a column in listview should set to false
how can a visibility of a particular column can set to false in a listview..that is the column should exists in the client site but in hidden form... what is the option other than setting the width to 0. im working in c#.net VS2008开发者_运维知识库
Use ObjectListView. This was specifically designed with the idea of getting away from hidden columns to hold data.
With an ObjectListView, each row knows which model object was used to construct it. So, if you want to find the FilePath for the object that the user has selected you say:
MyDataModel model = this.objectListView.SelectedModel as MyDataModel;
if (model != null) {
DoSomething(model.FilePath);
}
Also, you might want to look at this other question which talks about the same problem from a higher point of view.
ObjectListView also adds lots of nice UI candy, which always impresses the users :)
(source: sourceforge.net)
BTW: ObjectListView is Windows Forms only.
You shall have to set the width of the column to ZERO in this case.
精彩评论