开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜