gridview asp.net - 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.

Related

How to select all checkboxes using formkit vue3

I would like to know how to implement check all checkbox button and single checkbox work as well like i have four checkboxes and want to check them all on select all check box and when all checkboxes selected all checkbox have to be selected.

Cypress multiple radio button selection with dynamic value

Single radio can be selected using
cy.get('[type="radio"]').first().check()
If there is multiple radio buttons code on page with dynamic values for buttons.
How to select multi radio buttons in cypress automation testing?
There is a documentation about it : https://docs.cypress.io/api/commands/check.html#No-Args
its mentioned you should use 'cy.get('[type="radio"]').check()' in order to select all radio buttons.
hope this helps.see the image also

How to peoplecode with radio button

Anyone of you who knows how to peoplecode with the value choosen with radio button?
I have this page with radio button of academic programs and when a user select from one of the programs, I want to print a report basing on that program chosen in the radio button.
Any idea where to start and how to do this?
Thanks so much for the help.
Open the page in Application Designer and check the properties of the radio button fields.
They will look something like this:
All the related radio buttons will have the same record and field, but a different value.
To execute code, based on the selected radio button, you would evaluate the value:
Evaluate RECORD.FIELD.Value
When "VAL1"
RunReport1();
When "VAL2"
RunReport2();
When-Other
/* Error */
End-Evaluate;
Note: Fields used for radio buttons have to have XLAT validation IIRC

Select checkbox of gridview with keyboard in 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

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

Resources