listviewitem

How can I achieve a dashed or dotted border in WPF?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 18:26:57
I have a ListViewItem that I am applying a Style to and I would like to put a dotted grey line as the bottom Border . How can I do this in WPF? I can only see solid color brushes. This worked great in our application, allowing us to use a real Border and not mess around with Rectangles: <Border BorderThickness="1,0,1,1"> <Border.BorderBrush> <DrawingBrush Viewport="0,0,8,8" ViewportUnits="Absolute" TileMode="Tile"> <DrawingBrush.Drawing> <DrawingGroup> <GeometryDrawing Brush="Black"> <GeometryDrawing.Geometry> <GeometryGroup> <RectangleGeometry Rect="0,0,50,50" /> <RectangleGeometry Rect="50

Android:To set an item as selected when the ListView opens?

百般思念 提交于 2019-11-27 15:56:39
问题 An activity has a Button and a ListView. Initially, only the Button is visible. When the button is pressed, the ListView is displayed. When displayed, is it possible for me to show one particular item as selected/focussed? A use case could be that suppose it is a list of language settings and when the list opens, the currently selected language must be shown as highlighted. If I know the index of the item, how to set it as focused on display? 回答1: In short, ListView::setSelection(int position

Create a customized Item Appearance for ListView Delphi XE7

梦想的初衷 提交于 2019-11-27 14:55:02
Im having a lot of trouble trying to create a customized item appearance for the TListView firemonkey control for Delphi XE7. What I want is to define my own "design" for what an item should be and use that item. For example : I would like to have an item with a Title(on top) - A Description(Middle) - A Date (Bottom) - Button(Right). I could not find any good documentation about this but i got some samples of how to create an TListView with muti details, but the problem is : that sample is not documented so is very hard to understand whats going on there. I would like to have a link or some

C# Change ListView Item's/Row's height

纵饮孤独 提交于 2019-11-27 13:43:27
问题 I want to change the Item's/Row's height in listview. I searched every where and I figured that in order to change the height I need to use LBS_OWNERDRAWFIXED or MeasureItem or something like that. The problem is that I dont know exactly what to do and how to use it.. Can anyone help me with it? Edit: I cant use the ImageList hack because I am using the SmallImageList for real and I need different line height from the ImageList images size. Thanks! 回答1: It can be done using the SmallImageList

How to define ColorStateList for TextView?

本秂侑毒 提交于 2019-11-27 09:32:46
问题 When my ListViewItem is highlighted, I want the text to turn white. How can I define this? <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:color="@color/testcolor1"/> <item android:state_pressed="true" android:state_enabled="false" android:color="@color/testcolor2" /> <item android:state_enabled="false" android:color="@color/testcolor3" /> <item android:color="@color/testcolor5"/> </selector> 回答1: Create file res/drawable/text

Listview error: “Your content must have a ListView whose id attribute is 'android.R.id.list'”

允我心安 提交于 2019-11-27 09:31:30
I am getting an error in my logcat saying "Your content must have a ListView whose id attribute is 'android.R.id.list'". My code compiles and runs but force closes when I start my listview activity. I've checked on many similar questions, it seems to be a common problem but I am still unable to fix my code. The Declaration: private ListView lv; Context mContext; List mList; String[] testcontacts; MessageView aa = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.firstlist); testcontacts = getResources() .getStringArray

Get single listView SelectedItem

独自空忆成欢 提交于 2019-11-27 09:04:58
I have the MultiSelect property of the listView set to false and I'm trying to get a single listViewItem. But the available property is SelectedItems . I've been using the following code... foreach (ListViewItem item in listView1.SelectedItems) { //do something with item.text or whatever } Because I know there will only be one item selected. What is the correct way of doing this? Vogel612 Usually SelectedItems returns either a collection, an array or an IQueryable . Either way you can access items via the index as with an array: String text = listView1.SelectedItems[0].Text; By the way, you

Buggy ListView makes me sad

风流意气都作罢 提交于 2019-11-27 06:53:39
I have a ListView where I've defined the layout of each item in a separate XML file. In this file I've included a RatingBar and an EditText . I've programmatically created 7-8 items in this ListView . When I scroll through them, it seems to be quite buggy. Here are some examples: If I set focus to the EditText in the first row and then scroll down the ListView , random EditTexts from other rows will have focus. It seems to be that the next EditText after the focused one disappears receives focus. Perhaps this is intentional, but, as a user, it seems very weird. If I set focus to an EditText ,

Android ListView with RadioButton/CheckBox in singleChoice mode and a custom row layout

时光毁灭记忆、已成空白 提交于 2019-11-27 04:35:39
问题 I have a ListView, which is in singleChoice mode. All I want is to display a RadioButton to the side, that when clicked highlights to say it is selected, and when a different one is clicked that one hides and the new one becomes selected. I looked in Mark's book, Chapter 8, "Getting Fancy With Lists" and his RateList example But it doesn't solve my problem. Please help me . 回答1: EDIT Worth mentioning is that I had a custom layout on my list items: There is an icon, a title, a description and

WPF ListView - how to add items programmatically?

倖福魔咒の 提交于 2019-11-27 03:05:25
问题 Even if I know it's not ideal - I need to programmatically populate a listView (for whatever reason). I am declaring my columns in the markup: <ListView.View> <GridView> <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}"/> <GridViewColumn Header="Value" DisplayMemberBinding="{Binding Path=Value}"/> </GridView> </ListView.View> I am adding the items like this in code (it's obviously in a loop): MyData data = getDataItem(index); //< -- whatever ListViewItem item = new