listbox

WPF: Groupstyle not working correctly because of Style and/or modified ListBox

时间秒杀一切 提交于 2019-12-06 03:43:02
I am trying to use a GroupStyle but instead of showing the groupname as a header over the items in the list it only shows the header and not the items. It works fine until I applied a special style to the list. I then decided this style was pretty bogus so I created a UserControl fro this effect. The problem persists. The purpose of the UserControl is to have a expending effect on the selected item where normally it could show some info and then more info when expanded. UserControl: <UserControl x:Class="MyProject.CustomUC.ExpandingList" xmlns="http://schemas.microsoft.com/winfx/2006/xaml

How can I get the last selected value in a ListBox with jQuery?

和自甴很熟 提交于 2019-12-06 03:41:43
I have a listbox and I must limit its selection up to 5 items. If a 6th item is selected, I want to "deselect" it. But, I'm having some problems on finding the last selected item and "deselect" it. And the last item selected it's necessary the $("#mySelect option:last")... How can I get the selected item of a listbox?? Thanks!!! This will do it, although there is a brief "flash" of selection (you might want ot have a <span> show up underneath the <select> to say something like Maximum selection reached). $('#mySelect').click(function(e) { if ($('option:selected',this).length > 5) { $(e.target)

Prevent WPF ListView or ListBox from showing “half” Items

元气小坏坏 提交于 2019-12-06 03:24:57
问题 in our application we have some ListViews and ListBoxes inside grids where you can change the actual height of the control with help of a grid splitter. When doing so you are able to arrange the height of the ListBox so one of the items is not fully visible because the ListView becomes to short to display it. This is a behavior we don't want. From my research so far it seems there is not way the prevent a ListBox or ListView from showing partial items but maybe someone found another way to

Delphi TListBox iOS making new itemstyle/behavior

谁说胖子不能爱 提交于 2019-12-06 03:17:35
I need to show custom data. For example I need to show a contact list with name, description, photo. And ideally I would also like to show custom data there, e.g. a button to launch telephone call. The default styles do not quite do what I want, but fairly close. Thus, as far as I can tell, TListBox could be a decent control for this if I could create custom styles? Is that possible? (Anotther problem of course is setting the values of the custom data controls.) You should take a good look at the FMX CustomListBox example AFAIK even the example alone already seems to have exactly what you need

WPF ListBox Button Selected Item

风格不统一 提交于 2019-12-06 03:06:39
问题 I have a listbox with some textblocks and a button -- in the button's codebehind it calls a method passing the currently selected listbox item, this works great. The issue is that when I select an item and then click the button on another item it doesn't update the "SelectedItem" property -- is there a way Xaml or C# that I can force a button click to select the parent ListBoxItem? Xaml <DataTemplate> <Grid> <Button x:Name="myButton" Click="myButton_Click" Height="30" Width="30"> <Image

How to set multiple items as selected in ListBox?

放肆的年华 提交于 2019-12-06 02:57:35
问题 I have one ListBox with selection mode of multiple. In code behind, I want to set some values as selected. These values are present in a ListItems[] named 'Names' . HTML code: <asp:ListBox ID="lbto" class="chosen" runat="server" Width="450px" Height="20px" SelectionMode="Multiple"> <asp:ListItem>Mandy</asp:ListItem> <asp:ListItem>Amit</asp:ListItem> <asp:ListItem>sundar</asp:ListItem> <asp:ListItem>ragu</asp:ListItem> <asp:ListItem>raju</asp:ListItem> </asp:ListBox> ListItem[] Names contains

How to select all items in a ListBox really fast?

非 Y 不嫁゛ 提交于 2019-12-06 02:36:46
问题 I have an ownerdrawn ListBox on a form (Windows Forms) binding to a datasource (BindingList). I need to provide an option to select all items (up to 500000) really fast. This is what I am currently doing: for (int i = 0; i < listBox.Items.Count; i++) listBox.SetSelected(i, true); This is incredibly slow and not acceptable. Does anybody know a better solution? 回答1: Assuming this is a Windows Forms problem: Windows Forms will draw changes after each selected item. To disable drawing and enable

how to add user controls as listbox items

无人久伴 提交于 2019-12-06 02:19:45
问题 I am using WPF .net 4.5 (c#) and I would like to make a ListBox that contains a series of user controls. (If a listbox is the wrong type of control, please let me know). I want my listbox to have a copy of the user control as the list items, with different contents within each one. How do I add user controls to a listbox? Thanks for your help in advance! 回答1: You can set ItemTemplate for the listbox with your usercontrol in it. <ListBox> <ListBox.ItemTemplate> <DataTemplate> <local

How can make ScrollViewer scroll when mouse is over *any* content

荒凉一梦 提交于 2019-12-06 02:16:40
问题 The reason I stress 'any' is because CanContentScroll is not fully working in my ScollViewer . Let me explain the scenario: I have a ScrollViewer that has three Labels followed by a ListBox each. The reason I have this content inside the ScrollViewer is because I don't want each ListBox to have a ScrollBar , I just want one "global" ScrollBar . The problem is that when the cursor is over the the ListBox the ScrollViewer doesn't scroll. I've tried to set CanContentScroll property to true in

silverlight listbox throwing “value not fall in expected range” even when empty?

梦想的初衷 提交于 2019-12-06 01:32:09
I'm dynamically populating a silverlight listbox, programmatically, with a template control. the listbox is empty, and when i attempt a listBox.Items.Add(myTemplateControl), it throws the "Value does not fall within the expected range" argumentexception. i verified in the debugger that the item collection is indeed emtpy. the only time i've heard of this exception happening is when the list already contains an instance with that name. any thoughts? Stack trace: at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData) at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr,