开发者

on button click the visibility of a column in listview should set to false

开发者 https://www.devze.com 2022-12-22 01:25 出处:网络
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...

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 :)

on button click the visibility of a column in listview should set to false


(source: sourceforge.net)

BTW: ObjectListView is Windows Forms only.


You shall have to set the width of the column to ZERO in this case.

0

精彩评论

暂无评论...
验证码 换一张
取 消