listbox

Selected listbox item as undefined

流过昼夜 提交于 2019-12-13 06:39:34
问题 <script> $(function () { $("select[name='CusList']").removeAttr('multiple'); $("select[name='CusList']").attr('size', '8'); $("select[name='CusList']").find('option:first').attr('selected', 'selected'); //fx(); }); function fx() { var resid = $("select[name='resourcename']").val(); alert(resid); } </script> @Html.ListBox("CusList", ((List<SelectListItem>)ViewData["Customer"]), new { @class = "k-list"}) I tried to call fx() from the pageload(on controller) and also inside the function(). Both

how to transfer selected item in listbox in form2 to textbox in form1 when i double click on particular item

人走茶凉 提交于 2019-12-13 06:26:28
问题 Requesting to help Soon i have created windows appltn that contains two forms in form one lable and two textbox likelabel,textbox1(item_code), 2nd textbox2(item_discription). when i double click on particular item that item code , item discription goes to form1 textboxs how to transfer code. form2 code: private void listBox_user_SelectedIndexChanged(object sender, EventArgs e) { if (listBox_user.SelectedItem != null && rdr != null) { try { if (rdr.Read()) { textBox1_code.Text = rdr.GetString

Listbox image control binding with SQLite , Image bytes are stored in Database C#

我的梦境 提交于 2019-12-13 06:16:58
问题 I have stored image bytes in SQLite database . when I want to get single image then I got that by id and convert image bytes to bitmap image. But when i want to bind list of data to listBox then I'm not able to bind directly image control to bytes. My Xaml code is here. <ListBox Background="Transparent" Margin="-5,2,-5,10" BorderThickness="0" MaxHeight="680" Grid.Row="1" x:Name="listBoxobj" SelectionChanged="listBoxobj_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <Grid Width="400"

Changing complete lists of content in Combo Boxes

柔情痞子 提交于 2019-12-13 06:07:34
问题 In my program I have a comboBox and a listBox . The listBox is full of different commands. The selectedItem and contents of the comboBox depend on which command is selected. The selectedItem in the comboBox stays selected for that command. For example, when the user has content selected in the comboBox and they switch to a different command, and then switch back, the same item will still be selected in the comboBox . Because the comboBox gets populated with different items depending on which

Nested Listbox with lot of images is jittering and slow in WP7

≡放荡痞女 提交于 2019-12-13 05:22:03
问题 I have been now banging my head two days for getting nested listbox working, where I have like categories vertically and then the images horizontally. Amount of images can be easily 1000-2000. Here is my XAML code for it: <ListBox x:Name="CategoryList" VirtualizingStackPanel.VirtualizationMode="Recycling"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel/> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Grid Height="100" Width=

Listbox - Size to content until Max number of rows is met

旧巷老猫 提交于 2019-12-13 05:15:10
问题 I'd like to have a ListBox that sizes to its content, until some MaxRow property is met. So, if the MaxRow value was 3, it would behave in the following manner. Items.Count == 0 -> SizeToContent Items.Count == 1 -> SizeToContent Items.Count == 2 -> SizeToContent Items.Count == 3 -> SizeToContent Items.Count == 4 -> limit height to 3 rows and enable scrollbar Items.Count == 5 -> limit height to 3 rows and enable scrollbar etc etc I thought the correct way to do this would be to use a custom

Cascading DropDownList and ListBox in ASP.Net MVC

折月煮酒 提交于 2019-12-13 05:14:43
问题 I am trying out a sample of cascading dropdowlist and listbox in Asp.Net MVC. I have seen examples of cascading dropdownlists alone, but that uses JSON to fill the second dropdownlist. So, please don't mark this question as duplicate. I have a dropdownlist for displaying the districts/counties and a listbox that displays the customers in the View page which are pre populated using the model. When I chose an county/district in the dropdownlist, I need to get a filtered list of customers in the

ListBox SelectionChanged not getting called

时光毁灭记忆、已成空白 提交于 2019-12-13 05:06:38
问题 The below is my code for List box with button. I have two issues here: 1) SelectionChanged not firing for me to get the selected item and its value. 2) My list box is for multiple items selection, so when i select one item the background is not set on the button. How to solve these issues ? <ListBox Name="listBox" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" SelectionChanged="TopicListboxSelectionChanged" ScrollViewer.VerticalScrollBarVisibility="Disabled"> <ListBox

List Box items not highlighted when clicking on them

和自甴很熟 提交于 2019-12-13 04:47:10
问题 I have a list box in a form. Clicking on it causes the form to jump to another record. It supposed to highlight an item and jump to the correct record. Instead, it highlights, and then instantly clears the selection, although it still jumps to the record. When I use standard record selection buttons, items are correctly highlighted. I read the index of selected item from .ListIndex property because Selected() does not work in a Single Selection mode when I test which item is selected. However

How to get text from textBlock during SelectionChangeEvent from a ListBox?

耗尽温柔 提交于 2019-12-13 04:46:07
问题 I am try to get a text from my TextBlock during item select from my Listbox. Here is my code for listbox in my xaml file.. <ListBox x:Name="listBox" Height="535" Margin="7,0,12,0" SelectionChanged="selectedItem" ItemsSource="{Binding}"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <toolkit:WrapPanel FlowDirection="LeftToRight" ItemWidth="215" ItemHeight="215" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate x:Uid="info"> <DataTemplate> <StackPanel> <Border> <Image