listviewitem

How to get SelectedItems from ListView in my ViewModel [duplicate]

℡╲_俬逩灬. 提交于 2019-12-08 07:03:09
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Binding SelectedItems of Listview I have a ListView and User can select multiple items. I need to get list of items selected from ListView in my View Model. please suggest to get SelectedItems from ListView. Thank you 回答1: There are two ways I usually do this If I only need to know what is selected for the purpose of a command, I will setup my RelayCommand or DelegateCommand in the ViewModel to expect a

How I can remove a item in my ListView?

和自甴很熟 提交于 2019-12-08 06:19:40
问题 I want do delete a entry in my asp.net ListView and it don't work with my code. my code: protected void ListView_ItemCommand(object sender, ListViewCommandEventArgs e) { if (e.CommandName == "Delete") { int index = Convert.ToInt32(e.CommandArgument); int listcount = ListView.Items.Count; if (listcount - 1 == index) { ListView.Items.RemoveAt(index); //go do ListView_Deleting } } } protected void ListView_SelectedIndexChanging(object sender, EventArgs e) { // } protected void ListView_Deleting

Create a custom listViewItem class to store additional hidden info - VB .Net

佐手、 提交于 2019-12-08 05:50:42
问题 I want to store additional information about a listview item using a custom class, but I can't seem to get it to work. I'm currently using this code to accomplish something similar using a listbox item. I just want to do the same thing with a listview. Public Class myListboxItem Public id As String Public rootFolder As String Public name As String Public info() As String Public Text As String Public Overrides Function ToString() As String Return Me.Text End Function End Class I set the

Move to the next item - Android- Horizontallistview

情到浓时终转凉″ 提交于 2019-12-08 03:45:38
问题 The problem is that when I call from my ListView method performItemClick() I did not turn to the method setOnItemClickListener() , and get into a method getView () . I need to call a method setOnItemClickListener() which relate to my ListView , I tried to do this with listview.performItemClick () , but nothing happened . In fact , my problem is that I just have to go to my next item in the list (listview), but there is a problem , because I have a list of looped Integer.MAX_VALUE ; . Because

C# Serialising/deserialising Listview

梦想与她 提交于 2019-12-08 02:53:13
问题 I'm trying to serialise data from a ListView as well as then deserialising it and also consequently fill the ListView with the saved data. public List<ListViewItem> SaveListView(ListView LV) { System.Collections.Generic.List<ListViewItem> lSavedLV = new List<ListViewItem>(); for (int i = 0; (i <= animalList.Count - 1); i++) { lSavedLV.Add(LV.Items[i]); } return lSavedLV; } Is that a plausible solution for the saving part? Is that the way to go, if I plan to fill the ListView with such

How to open Android activities based on role of user?

China☆狼群 提交于 2019-12-08 01:39:22
问题 I am creating an online based Android app in which there is a listview , which shows notifications from different types of users like ' student ', ' teacher '. When I click a list view item, it should check the role of the user, whether the user is registered as ' teacher ' or a ' student ' and it should open the activity screen based on their role. I'll use intents to open different activities. How do I check the role of the user from server? 回答1: Well, I would like to provide my own answer.

How to drag & drop items in the same ListView?

只愿长相守 提交于 2019-12-08 01:16:40
问题 Consider this is a ListView that shows files and folders, I have already wrote code for copy/move/rename/show properties ...etc and I just need one more last thing. how to drag and drop in the same ListView like in Windows Explorer, I have move and copy functions, and I just need to get the items which user drops in some folder or in other way I need to get these two parameters to call copy function void copy(ListViewItem [] droppedItems, string destination path) { // Copy target to

ListViewItem does not get highlighted if the background isn't transparent

ε祈祈猫儿з 提交于 2019-12-08 00:51:46
问题 I have a ListViewItem with a custom gradient background. The default selector no longer highlights these rows anymore. Highlight only works if I set the background to transparent. How can I get the highlight without this change? Here is my ListView: <ListView android:id="@+id/symbolsListView" android:layout_width="fill_parent" android:background="@drawable/transparent_background" android:layout_height="390dp" android:divider="@drawable/ui_divider_line" android:cacheColorHint="#00000000"

Click in a ListView item changes status of elements inside the item?

喜欢而已 提交于 2019-12-07 16:51:32
问题 I don't know exactly how to explain this problem, but I'll try. I have a ListView with several items. Each item has inside a TextView and two ImageView. I want the ImageView change when I click on them, and I want to open a context menu when I press for a long time into the ListView item. For the ImageView, everything works properly. For the whole item, I can show the context menu after a long press, but my problem is that the ImageView changes as well when I am pressing the TextView, for

Custom ListView not highlighting ListViewItem on click

女生的网名这么多〃 提交于 2019-12-07 00:11:21
问题 I have a custom listview made up of an ImageView and a TextView. Clicking works fine however it won't highlight the item like a normal ListView would. How would I add a highlight? I tried to rig it by setting the background color on click and then adding a timer to remove the background color. That worked but I want a better solution. Any ideas? 回答1: I think you can try to use the colorstate. Define the colors for state_pressed, state_selected and any other appropriate states, then set the