Hi Krzysztof,
First of all, I want to apologize that it took me so long to reply to you.
What you can do is to derive your own class from the ListViewItem class,
add some fields/properties in order to store required data and then use the
class as you would normally use the ListViewItem class. For example, you
could do something like the following:
public class MyListViewItem : ListViewItem
{
private int id;
public MyListViewItem()
{
this.id = -1;
}
public int Id
{
get
{
return(this.id);
}
set
{
this.id = value;
}
}
}
…
MyListViewITem item;
item = new MyListViewItem();
item.Text = "Item 1";
item.Id = 23;
this.listView.Items.Add(item);
Hope this helps,
Thank you,
Sergiy.
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: Prevent of list view columns width change
| thread-index: AcQcDE2wSYOREDSvTDOXITifrPixWg==
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
| From: =?Utf-8?B?S3J6eXN6dG9mIEthem1pZXJjemFr?=
<krzysztof@NO_SPAMsmartsolutions.pl>
| References: <
[email protected]>
<
[email protected]>
| Subject: RE: Prevent of list view columns width change
| Date: Tue, 6 Apr 2004 12:21:04 -0700
| Lines: 8
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:50389
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hi Sergiy!
I use ListView control in my mobile application. I create column in which i
have an Id, for example, but i dont't want my users to see that column. I
can set its width to 0, but user can resize that column. And that's why i
want to pervent columns resizing
Maybe there is some better way?
Kind regards!!
Krzysztof
|