ListView: Update FocusedItem

M

Marc Ambrosius

Hello,

does anybody know when is the FocusedItem property of a ListView updated?
Using the code below I try to set the Focus to the next item. In the full
..NET Framework it works like this. In the .NET Compact Framework the
FocusedItem property does not change and the next time this code is reached
it is working on the same item again.

listView1.FocusedItem.Checked = !listView1.FocusedItem.Checked;
if (listView1.FocusedItem.Index < listView1.Items.Count - 1)
{
listView1.Items[listView1.FocusedItem.Index + 1].Selected = true;
listView1.Items[listView1.FocusedItem.Index + 1].Focused = true;
}

Thanks in advance,

Marc
 
S

Serg Kuryata [MS]

Hello Marc,

Yes, it seems to be a problem in the .NET Compact Framework. Thank you for
reporting it! I will file a bug to fix the problem in a future version.

Meanwhile, you can query the Focused property of listviewitems to determine
which item currently has focus.

Best regards,
Sergiy.

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Reply-To: "Marc Ambrosius" <[email protected]>
| From: "Marc Ambrosius" <[email protected]>
| Subject: ListView: Update FocusedItem
| Date: Thu, 29 Apr 2004 16:20:23 +0200
| Lines: 20
| Organization: Hoeft & Wessel AG
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| NNTP-Posting-Host: p508638ac.dip0.t-ipconnect.de 80.134.56.172
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13
..phx.gbl
| Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.compactframework:52057
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| Hello,
|
| does anybody know when is the FocusedItem property of a ListView updated?
| Using the code below I try to set the Focus to the next item. In the full
| .NET Framework it works like this. In the .NET Compact Framework the
| FocusedItem property does not change and the next time this code is
reached
| it is working on the same item again.
|
| listView1.FocusedItem.Checked = !listView1.FocusedItem.Checked;
| if (listView1.FocusedItem.Index < listView1.Items.Count - 1)
| {
| listView1.Items[listView1.FocusedItem.Index + 1].Selected = true;
| listView1.Items[listView1.FocusedItem.Index + 1].Focused = true;
| }
|
| Thanks in advance,
|
| Marc
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top