473,413 Members | 1,705 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,413 software developers and data experts.

SetFocus in grid view

Hi,

in my Asp.Net project, i have one task like bill generation in gridview, like when ever i used barcode reader, have to get the values in particular row and second row itself the cursore will be in setfocus on particular column. i got the result upto the records fatching in a row, but i coudn't make it for set focus on next row.

Please help me.

Thanks in advance.
J Suresh
Sep 9 '08 #1
3 1880
Frinavale
9,735 Expert Mod 8TB
You are going to have to set the focus on the control you want using JavaScript.
You'll need to store the ClientID of the control you want to focus on in a hidden field then during the (client side) page load event call the JavaScript function that sets the focus to this control.

Eg of the JavaScript
Expand|Select|Wrap|Line Numbers
  1. function SetFocus()
  2. {
  3.   var idOfCtrl = document.getElementById('nameOfHiddenField').value;
  4.   var control = document.getElementById(idOfCtrl);
  5.   if(control != null)
  6.   {
  7.     control.focus();
  8.   }
  9. }
  10.  
-Frinny
Sep 9 '08 #2
I tryed its not working please let me any other way to do.

You are going to have to set the focus on the control you want using JavaScript.
You'll need to store the ClientID of the control you want to focus on in a hidden field then during the (client side) page load event call the JavaScript function that sets the focus to this control.

Eg of the JavaScript
Expand|Select|Wrap|Line Numbers
  1. function SetFocus()
  2. {
  3.   var idOfCtrl = document.getElementById('nameOfHiddenField').value;
  4.   var control = document.getElementById(idOfCtrl);
  5.   if(control != null)
  6.   {
  7.     control.focus();
  8.   }
  9. }
  10.  
-Frinny
Sep 10 '08 #3
Frinavale
9,735 Expert Mod 8TB
I tryed its not working please let me any other way to do.
What did you try?

-Frinny
Sep 10 '08 #4

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

Similar topics

5
by: pmud | last post by:
Hi, I need to display columns in a data grid based on 7 different queries. Now I have 32 questions: 1. Is it possble to have 1 single data adapter with 7 queries & 1 data set or do I need to...
12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
2
by: Jan Mueller | last post by:
Hi all, I don't know whether this is the right group, let me know :-). I tried to open this XML file (with internal DTD) with XMLSpy 2005. I guess some of you also use this tool. ...
2
by: Rhonda | last post by:
Using AccessXP I have lost snap to grid on my system. New or existing databases do not snap to grid for forms and reports in design view. Anyone have an idea on how to get it back?? Thanks. ...
4
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1....
0
by: ¿ Mahesh Kumar | last post by:
I have created a XML file as datasource which i 'm binding to a grid view control. During runtime I'm capturing items in XML file and displaying in a GRID VIEW control. but i want to remove or...
1
by: Ed | last post by:
hi everyone, maybe someone can give me a hand here. I am working with vb 2005 and i have a gridview that i am loading data from a recordset. I have the recordset returned from the query and i am...
2
by: Umeshnath | last post by:
Hi, I have placed a grid view inside Atlas panel. On click of a button event, data is populated in the grid view, I want to add scroll bar instead of increasing the size of grid view. I have...
0
by: zafar | last post by:
I don't know what property should be used for hiding colums in Data Grid, whereas in Data Grid View we have DataGridView1.Colums(index).Visible = False , But how can I hide Colums in Data Grid.....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.