473,320 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Scrolling a list box with up and down arrow

375 256MB
Hello
I am using ASP.net 2.0 with VC# 2005.
I have populated a listbox as below and when I click on the value on the list box I display out the related values. All works fine. But I have one problem. Now i "CLICK" on a particular value on a listbox and display the results. What i need
is to scroll down using up and down arrow(because there are many items in the list box). But my up and down arrow does not move in the list box.I am using DataList control and not html select Can anyone let me know the reason why I cannot move the arrow keys.

Expand|Select|Wrap|Line Numbers
  1. protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.         if (!Page.IsPostBack)
  4.         {
  5.  
  6. MyCon.Open();
  7.               SqlDataAdapter MyDa = new SqlDataAdapter("select registrationno,gps_datetime from gpsdata ", MyCon);
  8.         DataSet MyDs = new DataSet();
  9.         MyDa.Fill(MyDs, "IpAddress");
  10.         MyCon.Close();
  11.         int CheckCount = (MyDs.Tables["IpAddress"].Rows.Count);
  12.         for (int i = 0; i < CheckCount; i++)
  13.         {           
  14.                             lstRegno.Items.Add(MyDs.Tables["IpAddress"].Rows[i][0].ToString());
  15.         }
  16.  
  17.     }
  18.     }
  19.  
  20.  
  21. protected void lstRegno_SelectedIndexChanged(object sender, EventArgs e)
  22.     {
  23.         MyCon.Open();
  24.         string SelectedRegno = lstRegno.SelectedValue.ToString();
  25.         SqlDataAdapter MyDa1 = new SqlDataAdapter("select unit_no,latitude,longitude,speed,gps_datetime,logic_state,ignition,location from gpsdata where registrationno='" + SelectedRegno + "'", MyCon);
  26.         DataTable MyDt1 = new DataTable();
  27.         MyDa1.Fill(MyDt1);
  28.         MyCon.Close();
  29.         txtRegNo.Text = SelectedRegno.ToString();
  30.         txtUnitNo.Text = MyDt1.Rows[0][0].ToString();
  31.         txtLat.Text = MyDt1.Rows[0][1].ToString();
  32.         txtLong.Text = MyDt1.Rows[0][2].ToString();
  33.         txtSpeed.Text = MyDt1.Rows[0][3].ToString();
  34.         string dat = MyDt1.Rows[0][4].ToString();
  35.         txtGpsDateTime.Text = (Convert.ToDateTime(dat)).ToString("MM/dd/yyyy HH:mm:ss");
  36.         txtIpAddress.Text = MyDt1.Rows[0][5].ToString();
  37.         txtIgnition.Text = MyDt1.Rows[0][6].ToString();
  38.         txtLocation.Text = MyDt1.Rows[0][7].ToString();
  39.     }
Thanks and regards
cmrhema
Sep 17 '07 #1
0 1750

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: johkar | last post by:
I only have IE 6 and dial-up. Can you help me determine which browsers support this code? Thanks, John <html> <head> <title>Fixed Table Headers</title> <script language="JavaScript"...
14
by: Dave | last post by:
My web site is not particularly theme-based, but it contains an Art Gallery I'd like to display in a different perspective. I would like to horizontally scroll it, rather than vertically - as if...
1
by: dschectman | last post by:
I have an interesting issue. I need to implement a dynamic table to mimic a select list. Each time you double click from the master list, a row is added to the list of selected items. The list...
1
by: Tom | last post by:
I have tried all the solutions I have found on the web, including the syncfusion solutions I can get the combobox on the grid ok, but it does not behave like a regular combobox Example On a form,...
2
by: gv | last post by:
Hi all, Using VB 2005 Express When pressing the down key in a listbox and getting to the last item I want to move right back to the top and vise versa so it never stops when pressing the...
0
by: Tom | last post by:
In the old VS 2003 Menu bar, it would scroll the list if it extended beyond the end of the screen (i.e. you had 60 reports in a menu and it displayed the little down-arrow at the end of the...
3
by: bhuvragu | last post by:
Hi , I am new to html_ajax which is part of PEAR package. I have created a demo on html_ajax. Demo is when the user types text in a text field, it would display the relevant matching words and...
13
by: andypb123 | last post by:
Hello, The onchange event fires in IE6 in a SELECT element when scrolling through the list with the up and down arrows on the keyboard. In Firefox it only fires after you hit the enter key, which...
8
by: rmurgia | last post by:
Has anyone noticed that scrolling through objects i.e. forms, reports, tables, etc with Access 2007 is not as easy as Access 2003? I have a database with a large number of objects. When scrolling...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.