I have a DropDownList shows the company names and a ListBox shows the products of the company I selected in the DropDownList and I can select many products from ListBox:
i am making use of two listboxes. the data from one listbox is transfered to other listbox on button click, bt teh the data which is selected must be added to the table in the sql server. but it is not storing values it is throwing execption...
private void InsertRecords(StringCollection sc) { SqlConnection conn = new SqlConnection("Data Source=ABCD;Integrated Security=True"); StringBuilder sb = new StringBuilder(string.Empty);
below is the code I have but I want to change the ddl.Deal(dropdownlist) to cbl.Deal(checkboxlist).. How can I loop throught each items if checked. and if all items are checked. to filter my data and show in gridview..
protected void btn_Click(object sender, EventArgs e) { myAPI.myWeb myAPI = new myAPI.myWeb(); myAPI.SearchParameters sSearchParameters = new myAPI.SearchParameters();
I'm moving itmes from one ASP.NET ListBox control to another ListBox control from client-side. It works on the client-side but when I tried to count items in destination ListBox on the server-side, it's always nothing. Below, is the jQuery code used to add/remove items from ListBox control.
[Code].....
I know that we can add/remove items from ListBox from server-side. But I'd like to get it done from client-side. Why there isn't anything in the destination ListBox when counting the items from the code-behind, eventhough the items are added from the client-side already.
This has got to be more simple than I'm making it. I want to generate a listbox with years for the values. It needs to be dynamic. It needs to list from 17 years ago to 25 years ago. This is what I have so far, I get the correct number of items in the listbox, but I don't get the correct value. They are all "1985".
<% Dim y As Integer Dim NextTime As Date = Now Dim bday_yr As New ListItem() y = 0 For y = 17 To 25 NextTime = DateAdd(DateInterval.Year, -y, System.DateTime.Now) bday_yr.Value = NextTime.Year bday_yr.Text = NextTime.Year BirthYear.Items.Add(bday_yr) Next %> <asp:DropDownList ID="BirthYear" runat="server"> </asp:DropDownList>
I am moving an app from Silverlight back to ASP.NET. (Don't ask!) I really liked the ability to highlight ListBox items as the user moved the mouse over the items. I have been Bing'ing all morning and cannot seem to find any way to do this in ASP.NET with an ASP:ListBox. I tried setting the onmouseover event for the list items themselves. But that did nothing.
[Code]....
I then tried setting onmouseover event for the list itself. I can get the event, but I don't know how to determine which item I am over. I only seem to have the selectedIndex. If I am just moving the mouse, I have no selectedIndex.
When I have multiple entries with the same id in a list box the selected index is always the first instance of the item. How do I get around this without modifying the id of the items in my list box so they are unique?
I'm trying to populate 1000 ListItems in a ListBox.
how to do it. Currently only 100 items are being displayed even though I set the capacity of the ListBox to 1000.
Below is sort of how my code looks like. :)
listBox.Items.Capacity = 1000; foreach(entity ent in enitityCollection) { ListItem listItem = new ListItem(); listItem.Value = ent.Id.ToString(); listItem.Text = ent.Name; listBox.Items.Add(listItem); } entityCollection has 989 records in it.
Code does not generate any error. only that at the end of the loop I only get 100 items mapped to my ListBox.
I have a list box which is populated using a dictioanry. When I iterate throught the selected items using the following code, it always show only the first items as selected - even if the first item is not selected. Have you ever encountered this scenario? This problem occurs when I use dictionary for binding. On the other hand a generic list works fine.
I've been trying to figure out for a long time now how to create an interface that can allows users to input several rows of data and pass those entries into an SQL server database all in one shot. I could not get any better ideas so I came up with this (see picture below).
What I envisioned is that the user enters values in the textboxes and hits the "add to list" button. The values are then populated in the list box below with the heading "exhibits lists" and when the add exhibit button is pressed, all values from the list box are passed into the database.
Well, I'm left wondering again if it would be possible to tie these values from the textboxes to the list box and whether I'd be able to pass them into the database.
how to go about it otherwise I'd be glad if you could recommend a better way for me to handle the situation otherwise I'd have to resolve to data entry one at a time.