protected void ProductsListBox_LoadingItems(object sender, ListBoxLoadingItemsEventArgs e) { if (!string.IsNullOrEmpty(e.Text)) { sds3.SelectParameters[0].DefaultValue = e.Text; } }
protected void Detail_LoadingItems(object sender, ListBoxLoadingItemsEventArgs e) { if (!string.IsNullOrEmpty(e.Text)) { int tryout = 0; if (int.TryParse(e.Text, out tryout)) { sds2.SelectParameters[0].DefaultValue = e.Text; } } }
// Handles the "LoadingItems" event of the ListBox protected void ListBox1_LoadingItems(object sender, ListBoxLoadingItemsEventArgs e) { // Getting the items DataTable data = GetItems(e.Text, e.ItemsOffset, 10); ListBox1.DataSource = data; ListBox1.DataBind(); // Calculating the numbr of items loaded so far in the ListBox e.ItemsLoadedCount = e.ItemsOffset + data.Rows.Count; // Getting the total number of items that start with the typed text e.ItemsCount = GetItemsCount(e.Text); }
// Handles the "LoadingItems" event of the ListBox protected void ListBox1_LoadingItems(object sender, ListBoxLoadingItemsEventArgs e) { // Getting the countries DataTable data = GetCountries(e.Text); // Looping through the items and adding them to the "Items" collection of the ListBox for (int i = 0; i < data.Rows.Count; i++) { ListBox1.Items.Add(new ListBoxItem(data.Rows[i]["CountryName"].ToString(), data.Rows[i]["CountryID"].ToString())); } e.ItemsLoadedCount = data.Rows.Count; e.ItemsCount = data.Rows.Count; }
// Handles the "LoadingItems" event of the ListBox protected void ListBox1_LoadingItems(object sender, ListBoxLoadingItemsEventArgs e) { // Getting the countries DataTable data = GetCountries(e.Text, e.ItemsOffset, 25); // Looping through the items and adding them to the "Items" collection of the ListBox for (int i = 0; i < data.Rows.Count; i++) { ListBox1.Items.Add(new ListBoxItem(data.Rows[i]["CountryName"].ToString(), data.Rows[i]["CountryID"].ToString())); } // Calculating the numbr of items loaded so far in the ListBox e.ItemsLoadedCount = e.ItemsOffset + data.Rows.Count; // Getting the total number of items that start with the typed text e.ItemsCount = GetItemsCount(e.Text); }