listview

How to display a message when the list view is empty in android

Hi All, I am a new to Android stuff. I am creating an application that contains a list view that will get dynamically populated. My requirement is when the list is empty, I would like to show a message. I don't want to create additional views just for displaying this message. Is there any nice way to do this? Any suggestions? ...

What am i missing in my code?

Hi, i would like to show my database on a listview in android, but the data is not showing. Arrival.java package one.two; import java.io.IOException; import java.util.ArrayList; import java.util.List; import android.app.ListActivity; import android.database.Cursor; import android.os.Bundle; import android.widget.ArrayAdapter; impo...

Is there a way to get the scrollbar height and width for a ListView control

I'm trying to get the height and width of the scrollbars that are displayed on a ListView. Is there an easy way to do this? I did some google'ing and it looks like it might be a system setting. I'm just not sure where to look. ...

Adding headers to an Android listview

So I have a listview and I want to add different "sections" to it. I understand how addHeaderView works and it's straight forward, but is there a way to add section headers? Like let's say I have an alphabetical list, is there a way to mark the top of each section of letters? The list is dynamic though, so I won't know when/where I'll ne...

android listview viewholder. when to use it, and when not to

I have a ListView with a custom list adapter. In the getView() method, am using the ViewHolder 'pattern' as shown in the API Demos for ListView14.java. When i first render the list it seems to load correctly. However, the issue i'm running into is that when i scroll the list, i'm seeing the data for the list show up in the wrong rows ...

Want to load part of an array into android ListAdapter

My code works like this to list all items in my String array - itemsarray setListAdapter(new ArrayAdapter<String>(this, R.layout.row, R.id.label, itemsarray)); However, I know by this call that I only want to list the first X number of items from itemsarray. How can I load only the first X items form itemsarray into the ListA...

In Android, how can I set a ListView item's height and width?

I want to create an interface that has one or two listviews that ultimately span the entire screen with two rows. How can I change their height so that they take up 50% of the screen, vertically? If it's along the same lines, I'd love to know how to do this regardless of orientation. With regards to width; let us say I have two listvi...

addHeaderView changes behavior on ListView

I got two kind of lists on 4 different views. All lists are clickable and starts an activity to read the clicked record. One is just a listview populated from the DB and works fine. The second is also a listview populated from a DB but has a addHeaderView. This makes the list forget where it was when you return from the listview's inten...

DataTemplate in listview

Hi ! I use a listview to display data like a data matrix (columns and rows). My problem is : my items are typed : MatrixCellVM. I tried everything I found on the net to apply a DataTemplate on this items but nothing worked. Here is the latest technique I'm using foreach (var col in dataMatrix.Columns) { //create th...

Creating a floating, editable and scrollable list in Android

I want to show a list of items when the user clicks an overlay item on a map. The user should be able to select any of these items and edit them. The list can have many items (more than that can fit in one active screen) therefore it needs to be scrollable. Any ideas will be appreciated. Thanks in advance. ...

WPF: Setting the text alignment of a GridViewColumn

By default, text is centered in the headers of a ListView (not in the content cells!), I've been struggling to make it left aligned, here's what I've come up with: <ListView.Resources> <DataTemplate x:Key="Templ"> <TextBlock HorizontalAlignment="Left" Text="{Binding}"/> </DataTemplate> </ListView.Resources> ... <GridVi...

ListView getCheckedItemPositions call issue

Hi, I am having issues with the getCheckedItemPositions call for ListView. The first call works but subsequent calls returned the same results even if the previous checked items were unchecked. eg. first call: positions 0 & 1 are checked, result shows 0 & 1 are checked 2nd call: position 0 & 1 are unchecked, result still shows 0 & ...

Set querystring parameter in Hyperlink from selected.item.text in dropdownlist

I have a HyperLink control in a ListView, and I need to pass a couple of querystring parameters. <asp:HyperLink ID="HyperLink" runat="server" NavigateUrl='<%# string.Format("Page.aspx?Param1={0}", Server.UrlEncode(Container.DataItem.ToString())) %>' Text='<%# Container.DataItem %>' /> The first parameter is based on the current Da...

Removing items from Android ListView/ArrayAdapter doesn't work after text filtering

I have an Android ListView, backed by an ArrayAdapter. When the user clicks on an item in the list, that item is removed. This all appears to work fine, you can click on each item until there are no items left. However, it all goes wrong once text filtering occurs. Once the list has been filtered once, even if that filter is cleared,...

[Win32] Adding items to a ListView?

I'm having trouble adding items onto a ListView control. When I try to add items to my ListView, nothing happens. I was using this code before, and it didn't work. I have 3 columns, with the SubItem values set to 1, 2, and 3. LVITEM item; item.mask = LVIF_TEXT; item.cchTextMax = 6; item.iSubItem = 1; item.pszText = TEXT...

Individual Preferences for each item in a ListView?

Hi everyone, I'm creating my first android app (or attempting to anyway) and i have a question i can't seem to find the answer to. I would like to allow users to enter a separate set of preferences for each item in a list view. I have the PreferenceScreen working, but it maintains the same preferences for every item (i.e. changing 1 i...

listview tiles not showing images (.NET2.0 , VB , winforms)

Im trying to fill a listview(tiles) with posters and titles of a DVD collection but only the titles become vissible. this is my code: Private Sub fillListView(ByVal listView As System.Windows.Forms.ListView, ByVal col As Collection) listView.Items.Clear() myImageList = New ImageList() For Each item As bsDVD In col Try myImageLis...

Selection bug when replacing items of a WPF ListView bound with ObservableCollection property

Hi, I wrote a very simple WPF application which has a listview and 2 buttons. The listview is initiated with 3 items. The button 'Add' when clicked will add new item to the list. The button 'Change' when clicked will change the selected item content. The bug raises when we click this 2nd button. I upload the solution codes here. In the...

Fast Scroll display problem with ListAdapter and SectionIndexer

I have a list of events which are seperated by month and year (Jun 2010, Jul 2010 etc.). I have enabled fast scrolling because the list is really long. I've also implemented SectionIndexer so that people can see what month and year they are currently viewing when scrolling down the list of events at speed. I don't have any problem with ...

Drop items into specific group in a listview

I'm trying to drag an item between two Groups in the same ListView called 'listTasks'. Private Sub listTasks_ItemDrag(ByVal sender As Object, ByVal e As ItemDragEventArgs) Handles listTasks.ItemDrag listTasks.DoDragDrop(listTasks.SelectedItems, DragDropEffects.Move) End Sub Private Sub listTasks_DragEnter(ByVal sender As Object, By...