Re: Selecting Listview Rows

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tim Wilson ("Tim)
Date: 03/30/04


Date: Tue, 30 Mar 2004 00:03:21 -0500

Are you trying to do multi-selection or just single-selection? I have tried
code similar to the code you posted and I do not see an issue. You might
need to post more of a complete picture as to what you are trying to do. In
addition, I don't specifically remember and issue like this but if you are
not already you may consider moving to CF SP2 to see if that helps at all.
http://www.microsoft.com/downloads/details.aspx?FamilyID=10600643-09b3-46d8-ba28-bc494bc20d26&DisplayLang=en

-- 
Tim Wilson
.Net Compact Framework MVP
{cf147fdf-893d-4a88-b258-22f68a3dbc6a}
"Jeff" <jeffg22@mindspring.com> wrote in message
news:d3ebee6.0403291926.7de014da@posting.google.com...
> Hi -
>
> I'm having a problem programmatically selecting listview items.
>
> I have a listview (Details view) with 59 rows, showing 7 visible rows.
>  My first selection runs fine, but my second selection throws a native
> exception.  For example, the following 4 statements run fine:
>
> frmlist.lvwList.Items(9).Focused=True
> frmlist.lvwList.Items(9).Selected=True
> frmlist.lvwList.EnsureVisible(9)
> frmlist.lvwList.Refresh
>
> But if I try to repeat the process, I get the exception on the
> selected statement:
>
> frmlist.lvwList.Items(25).Focused=True
> frmlist.lvwList.Items(25).Selected=True
>
> The error (displayed on the emulator screen) is:
>
> "A Native exception has occurred in MyApp.exe.  Select Quit and then
> restart this program, or select Details for more information."
>
> (If I select the Details button, nothing happens.)  Quit terminates
> the session.
>
> What am I doing wrong??
>
> Thanks for your help.
>
> - Jeff


Relevant Pages

  • RE: Ok to call Application.get_Selection()?
    ... We get an exception that says COMException ... Cannot create a Selection object when this dialog is active. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.office.developer.com.add_ins)
  • origin of error message
    ... i was trying to create an image using user selection of a file in tix ... Exception exceptions.AttributeError: "PhotoImage instance has no ...
    (comp.lang.python)
  • RE: problem in changing part of a sentence
    ... You originally wrote that you are seeing an exception in your call to ... But when I call "Select" on it the resulted selection will be the ... supplying in your calls to MoveStart and MoveEnd. ...
    (microsoft.public.word.vba.general)
  • RE: problem in changing part of a sentence
    ... it will cause the exception to occur. ... But when I call "Select" on it the resulted selection will be the ... supplying in your calls to MoveStart and MoveEnd. ...
    (microsoft.public.word.vba.general)
  • Selecting Listview Rows
    ... I'm having a problem programmatically selecting listview items. ... My first selection runs fine, but my second selection throws a native ... But if I try to repeat the process, I get the exception on the ... Quit terminates ...
    (microsoft.public.dotnet.framework.compactframework)