listviewitem

android: extending CheckedTextView source code

烈酒焚心 提交于 2019-12-25 01:16:34
问题 I was thinking of adding an icon to the items in a ListView who already has a text and a checkbox: simple_list_item_multiple_choice.xml which is nothing but a < CheckedTextView > tag with some attributes I'm aware of the custom adapter solution, but I really want and more intuitive solution. I know playing with the source code is not intuitive, but what I meant is the easiness of just doing this: SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, // context android.R.layout.simple

Can't access Subitems in ListView while looping

不打扰是莪最后的温柔 提交于 2019-12-24 19:40:05
问题 I am trying to loop over a ListView with a foreach statement, but I can't seem to get the Subitems of item. No success with a For statement either. IntelliSense doesn't propose it on both ways. Code Behind: protected void btnNext_Click(object sender, EventArgs e) { foreach (ListViewItem item in ListView1.Items) { item. *(here a should get the Subitems)* } } ASPX <asp:ListView ID="ListView1" runat="server" DataSourceID="ObjectDataSource1"> <LayoutTemplate> <table> <tr> <th>Customer</th> <th

WPF ListView: Icons view shown in a single column

被刻印的时光 ゝ 提交于 2019-12-24 11:07:03
问题 I'm experiencing a weird problem... What I'm trying to do is quite standard, I guess: aloowing the user to switch between Grid and Icon modes in my ListView. All is going well, but... The Icon view, instead of showing the items in wrapping rows, shows them in a single column, with each item occupying the whole width of the view. And I can't put my finger on what exactly is wrong... :-( (I haven't earned enough XP on this forum yet, and it won't allow me to post images; I'll give the links to

android ListView can't stop at exact pixel position

不想你离开。 提交于 2019-12-24 10:57:52
问题 What i'm trying to achieve is to prevent showing some listView beyond a certain precise position. Let's say i want to stop when reaching pixel 150 relatively to the top of the list (all rows have the same height, 240px at the moment), what i'm doing now is : public abstract class EndlessScrollListener implements AbsListView.OnScrollListener { @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount){ int firstVisibleItemTop = -1; View v =

ASP ListView: How do I access the data that is databound to the rows?

独自空忆成欢 提交于 2019-12-24 07:17:26
问题 I want to access the data that was databound to my list view when handling list view events such as: protected void List_ItemDataBound(object sender, ListViewItemEventArgs e) or protected void List_ItemCommand(object sender, ListViewCommandEventArgs e) Inside the events, I can not access the data via somthing like Eval("ID") Currently we are using a very hacky solution: string id = e.Item.FindControl("lblID").Text; Where lblID is a hidden control that is populated with data in the aspx file

ListView selector problem: Selection does not get removed

流过昼夜 提交于 2019-12-24 06:37:25
问题 I have a ListView. When I click on a ListItem, I set the background of the ListItem (it's view) to another color: listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> a, View v, int position, long id) { setupDetailView(position); setupChartView(position); setupARView(position); emptyView.setVisibility(View.INVISIBLE); quotesAdapter.isSelected = true; //v.setBackgroundResource(R.drawable.stocks_selector); } }); here is my adapter: private

How do I use LINQ to get all the Items that have a particular SubItem?

余生长醉 提交于 2019-12-24 00:55:25
问题 My software is designed to encrypt and decrypt files. The user loads the files to be processed into a ListView control. In the control, each item is the file path with one subitem, the type of process (ENCRYPT or DECRYPT). I need to get a list of all ITEMS (the file paths) that have the "ENCRYPT" subitem, preferably with LINQ. Currently, my code looks like this: Dim enclist As New ArrayList() For i As Int32 = 0 To (lvwLoad.Items.Count - 1) If lvwLoad.Items(i).SubItems(1).Text = "ENCRYPT" Then

ListAdapter to modify the datasource (which is an arraylist)

∥☆過路亽.° 提交于 2019-12-23 23:12:12
问题 here's a problem that i've run into lately: I have a listview with a custom adapter class, the adapter takes in a listview and populates the listview with elements from it. Now, i'd like to have a button on each row of a listview to remove the item from it. How should i approach this problem? Is there a way to remotely trigger a method in the activity class and call notifydatachanged() method on the adapter to refresh the listview? 回答1: I've done something like that: public class MyAdapter

ListViewItem tooltip WPF

荒凉一梦 提交于 2019-12-23 10:07:45
问题 What I need is that when mouse per listviewitem show me all data from each in a tooltip. This is a part of my viewmdel ... ... using GalaSoft.MvvmLight; using GalaSoft.MvvmLight.CommandWpf; ... ... private ObservableCollection<Articulo> _articulos; private Articulo _articuloSeleccionado; public ObservableCollection<Articulo> Articulos { get { return _articulos; } set { _articulos = value; RaisePropertyChanged(); } } public Articulo ArticuloSeleccionado { get { return _articuloSeleccionado; }

ListView separators using a CursorAdapter

喜欢而已 提交于 2019-12-21 04:17:20
问题 I have a ListView which is populated using a CursorAdapter. I'd also like to have some separators in my ListView. I have accomplished this with an ArrayAdapter, but I'm not sure how to accomplish this with a CursorAdapter. Are there any strategies for doing so? Or am I out of luck? 回答1: Here's some examples: http://bartinger.at/listview-with-sectionsseparators/ http://sunil-android.blogspot.com/2013/08/section-header-listview-in-android.html Projects: http://code.google.com/p/android-section