Select checkbox of gridview with keyboard in asp.net - asp.net

I am using GridView on my page, which retrieves data from SQL database.
The first column is named OK and has a Checkbox in each row.
I want to select each check box with the help of keyboard instead of mouse.

The shortcut for toggling a checkbox is the spacebar, so as long as you have the checkbox highlighted, you can use that to check each box.
Next, check out some articles on adding GridView keyboard navigation:
GridView column and row navigation using up/down/right and left arrows
GridView Rows Navigation Using Arrow (Up/Down) Keys
GridView Up and Down Navigation using jQuery

Related

list window does not disapper of Obout ComboBox control

I am developing a web application. I used ajax Update panel & under update panel I used gridview for displaying data. In gridviews edit template I used three Obout ComboBox Control(third party) and bind the data from database.for moving one control to another controls I am using tab key.I used tab key from one combobox its move on second combobox when its move then it is displaying list window of combobox it wont disappear after I go to next control and also when I save the data it well display list of comboxBox.
For example of marked comboBox I attached two images
1)”” when I move one comboBox to another comboBox it is displaying list
2)”” when I save the data it is displaying list window of comboBox.
But when I remove the update panel it won't display such list after focus is moved.
Note:When I use mouse to move one comboBox to another comboBox, list window of ComboBox wont come on screen.
VS:2010
Code-Behind:VB.net
Obout Suite Version:3.5
using obout comboBox property openOnfoucs="false" , solved the problem. It does not display list window when focus moved to another control.

gridview asp.net

I have a grid view to show a listing of domestic sales and international sales. I share the same grid view for both. So if i select 'Domestic' radio button, i have to change the label of first column as 'SalesNo' and also set the sort expression as 'sales_No', if i select 'International' radio button, i have to change the label of first column as 'ExportNo' and also set the sort expression as 'export_No'. How can i do it using C# ?
add gridview command radio buttons after adding radio button create gridview command event.
after all these things now any radio button selected check its value and after checking the value make changes as you want.

Using the Tab key to navigate form inputs

I am having some problems with tabbing within my asp.net pages. This project was developed with Visual Studio 2008.
Case 1
I have two html tables. The first table has two rows; the second table has four rows. Within the cells are of each table are asp.net fields, text boxes and radio button lists. I set focus to the first field of table one. I then press the tab key multiple times. The focus moves through the field of table one and then through the fields in the first row of the table two. Then instead of goes to the second row of the table two it return to the table one.
But if I set focus to the last cell on the first row of table two, it tabs through the remaining cells of table two properly. Can you tell me how to get the tabbing to behave properly and go to the cells in there natural order? Note that I am setting the tab index property in the order that I want.
Case 2
On another page I have an html table with a single row followed by a gridview control. The gridview control is writeable and has the following columns: Check Box, Radio Button List, Text Box, Text Box, Text Box and a Check Box List. If I click on one of Check Box, Radio Button List or Check Box List., then press tab, the cursor pops out of the grid and sets focus on the first field of the table outside the grid. But if I set focus on one of the text boxes and tab; then the tab goes through the fields of the grid left to right one row at a time. This later behavior is what I want in both cases. I don’t know why my cursor pops out of the grid when I start with a field other than a text box.
Please help if you can.
Bob
funny, you explain in details your case but you didn't explain what it needs to be explained in order to someone can understand you :)
first of all, is table1 located in the first tab and table2 in second tab?
what do you used for tabs: asp.net tab control, jquery ui tabs...?
what do you mean by 'press the tab key multiple times'? same tab? do you have postback on tab click? what is the focus in your case, and so on and on...
cheers
Have you checked the order of the input elements in your HTML? Generally the tab order follows the order of controls.
If that all looks right, then make sure nothing is setting the TabIndex property - as this will also mess up the tab order.
I pretty much resolve this and I wanted to add the answer for anyone who viewed this thread. The problem was the autpostback on certain fields. Once I disabled autopostback, the problems went away.
Bob
You need to use Javascript and I referred for your a very good example of navigating through Gridview rows with Up/Down keys.
http://www.codeproject.com/Articles/25675/GridView-Rows-Navigation-Using-Arrow-Up-Down-Keys

How to remove a textbox and put the dropdown box in asp.net

How to remove a textbox and put the dropdown box in asp.net
And the value that is used before in textbox, now it should take from dropdown box
You can use select tag for this. And can get the selected value in C# using the following code
Suppose cmb is the id of your dropdown box, then
cmb.Items[ cmb.SelectedIndex ].Value
can fetch the value selected in your drop down box and
cmb.Items[ cmb.SelectedIndex ].Text
can fetch the text selected
easiest way is to use jquery and jquery.jeditable plugin with it.

how to make an checkboxlist select only one item selected

i am using an checkboslist binding to a datatable.
but here i need to make user select only one item selected from checkbox list
is there way we can aachive this
either JQuery, javascript, c#
thank you
If the user is only allowed to select one item from a list, you should use radio buttons instead of checkboxes.
UPDATE:
If you have to use checkboxes then you can use the following code:
$("#myform :checkbox").click(function(){
$("#myform input:checked").attr("checked","");
$(this).attr("checked","checked");
});

Resources