listviewitem

How to bring into view last added list view item in WPF ListView

倖福魔咒の 提交于 2019-12-06 01:57:02
问题 I am using a view model to bind to the list view. Every time I add an item in the view model internal observable collection, I trigger an LastIndex property with the list.Count-1. The list view is bound to this LastIndex proeprty of VM and the listview correctly selects the last item added to the view. Unfortunately, the view is not able to scroll the last added item into view. I tried setting IsSynchronizedWithCurrentItem = "True" on list view markup, but it did not help. This is the markup

How can I programmatically add a multi-column ListViewItem without any data binding?

青春壹個敷衍的年華 提交于 2019-12-06 00:23:21
问题 I have a ListView with 3 headers, declared in XAML as follows: <ListView Name="myListView"> <ListView.View> <GridView> <GridViewColumn Header="H1"/> <GridViewColumn Header="H2"/> <GridViewColumn Header="H3"/> </GridView> </ListView.View> </ListView> I want to programmatically add a ListViewItem to this ListView, being able to set the content within the ListViewItem that will go under the first, second, and third columns individually. So far, I have only gotten this far: ListViewItem l = new

Xamarin Forms - Binding Listview for lazy loading

孤街醉人 提交于 2019-12-05 22:29:11
Started to dabble in Xamarin Forms. Two things I cant figure out: Binding of my Listview: I have a class with: public class Mainlist { public string Title { get; set; } public string Value { get; set; } } My XAML looks like: <ListView x:Name="mainlist"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <StackLayout Orientation="Horizontal"> <StackLayout Orientation="Vertical"> <Label Text="{Binding Title}" Font="18"></Label> <Label Text="{Binding Value}" TextColor="Gray"></Label> </StackLayout> </StackLayout> </ViewCell> </DataTemplate> </ListView.ItemTemplate> </ListView> What happens now is

get checked items of listview using checkbox windows store app c#

微笑、不失礼 提交于 2019-12-05 07:36:14
问题 I am developing one Windows store application. I have implemented one listview. listview contains image , textblock and checkbox controls. my listview gets the data from internet i have done xml parsing with listview and binded data to listview. i want to get all the data from listview where checkboxes are checked in listview. my xaml code is: <ListView Name="display" ItemsSource="{Binding}" SelectionMode="Single" SelectionChanged="display_SelectionChanged" ScrollViewer.HorizontalScrollMode=

Custom ListView not highlighting ListViewItem on click

情到浓时终转凉″ 提交于 2019-12-05 04:51:23
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? 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 background of your view to the colorstate. Click on your ListView and then in the properties window, set

Listview get item text

孤街醉人 提交于 2019-12-04 16:19:40
I need to grab selected item TEXT (not id). What can I write under onListItemClick to do that? I get: java.lang.ClassCastException: org.eclipse.jdt.internal.debug.core.model.JDIObjectValue cannot be cast to org.eclipse.jdt.debug.core.IJavaArray at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.getCompiledExpression(JavaDetailFormattersManager.java:396) at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.resolveFormatter(JavaDetailFormattersManager.java:167) at org.eclipse.jdt.internal.debug.ui.JavaDetailFormattersManager.access$1(JavaDetailFormattersManager.java:152

WPF ListViewItem lost focus event - How to get at the event?

淺唱寂寞╮ 提交于 2019-12-04 12:09:12
I have a listview that you select a row/item on. This is linked to a datatrigger that displays an image on the row. The image should only be displayed when the row is selected. This part works fine, however when you move the focus to something else, such as a textbox, or a messagebox is displayed, the listviewitem loses focus ie the highlight on the row is no longer displayed. The problem is that my image still remains. It should be hidden/collapsed when the listview loses focus... It works fine if you select a different item/row on the listview. Can anyone help on this please? <Style x:Key=

Problem setting ListView selector color when pressed

こ雲淡風輕ζ 提交于 2019-12-04 09:04:27
I have the following ListView, and have followed the answer from this SO Question w/ no luck: Android ListView Selector Color <ListView android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ARListView" android:background="@drawable/transparent_background" android:cacheColorHint="#00000000" android:listSelector="@drawable/ar_selector" android:drawSelectorOnTop="true"> Here is my ar_selector.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android">

ContextMenu for ListViewItem only

霸气de小男生 提交于 2019-12-04 06:11:34
I have a context menu - problem is I need it to only open when a listviewitem is clicked. Right now it will open if I click anywhere in the listview or in the header. <ListView> <ListView.ContextMenu> <ContextMenu> <MenuItem Header="More Info" Command="{Binding MoreInfo}" /> </ContextMenu> </ListView.ContextMenu> <ListView.View> <GridView> <!-- columns and stuff here --> </GridView> </ListView.View> </ListView> I have tried adding the ContextMenu as a resource and applying it as a style, but this breaks the command (clicking on More Info should open a dialog window, doesnt work this way)

How can I programmatically add a multi-column ListViewItem without any data binding?

你离开我真会死。 提交于 2019-12-04 06:06:17
I have a ListView with 3 headers, declared in XAML as follows: <ListView Name="myListView"> <ListView.View> <GridView> <GridViewColumn Header="H1"/> <GridViewColumn Header="H2"/> <GridViewColumn Header="H3"/> </GridView> </ListView.View> </ListView> I want to programmatically add a ListViewItem to this ListView, being able to set the content within the ListViewItem that will go under the first, second, and third columns individually. So far, I have only gotten this far: ListViewItem l = new ListViewItem(); l.Content = "Content"; myListView.Items.Add(l); This sets each column to the string