Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListView Control
Message
De
14/09/2004 12:22:29
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00941889
Message ID:
00941952
Vues:
23
This message has been marked as the solution to the initial question of the thread.
Einar,

You'll need to run the EnsureVisible() method. You'll also probably want these other properties set:
this.oList.Scrollable = true;
this.oList.HideSelection = false;

int count = this.oList.Items.Count - 1;
this.oList.Items[count].Selected = true;
this.oList.EnsureVisible(count);
~~Bonnie

>Kevin,
>Thanks for the reply and thanks for the hints. I noticed that multiselect is defaulted to true so I had to make that false and I had to set focus to the control to see the last item hightlighted.
>But I still have not solved my initial problem. I thought setting the last item in the items collection selected property to true would move the scrolbars to that item but the list view scrolbar does not move as I add items to the items collection.
>
>So I guess my follow up question is do you or Bonnie or anyone else know how I can advance the scrollbars in a listview control.
>
>Interesting that I cant databind the listview I'll have to remember that.
>
>Thanks,
>Einar
>
>>Einar,
>>
>>I had initially typed out that you could try to use databindings for the listview, access the control's binding manager and set the binding manager position to wherever you need it...but Bonnie just pointed out to me that databinding isn't available for the listview.
>>
>>(What threw me off is that Intellisense shows DataBinding capability for the listview, and I can bind at runtime without getting an error, but I also get blank list...sorry)
>>
>>I just saw Bonnie's reply, which will work. (If the listview supports multi-select, you may need to 'unselect' any row(s) that are currently selected, but it will work). If the control isn't already selected, you may want to put in a Focus().
>>
>>Kevin
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform