views:

28

answers:

2

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

A: 

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

Kangkan
i think i have said that i want the other option...
zoya
Why you want to avoid this option?
Kangkan
because...at run time anyone can drag the control and enlarge it...and set its width>0; i have done it but not a good option..
zoya
A: 

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

alt text

BTW: ObjectListView is Windows Forms only.

Grammarian
i just want to hide an existing column not to work with the idea of making that column not to hold a data....i want that it should hold a data because i have to use that data...for backend purpose..is there any way to do that for which users cannot see that information..
zoya