'MVC HTML RadioButtonFor Control Calender as options
In ASP.Net MVC Razor, I need to provide a radio button control with two options. One option is Static, the second option is a Calendar control that picks up the date. How to achieve this.
Solution 1:[1]
1.Use jquery date picker for pick date from calander.
links:
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
html:
<input type="text" id="datepicker"></p>
2.@html.TextBoxFor(x=>x.DateParameter) for inserting manually.
Format should be like 1990-06-20 08:03
Other wise you can take string format of date & time and later covert it to DateTime format in controller by using DateTime.Parse()
Solution 2:[2]
in K11 put :
=indirect("Sheet1!A"&(row()-11)*2+1)
and drag downwards.
similarly, in L11 put :
=indirect("Sheet1!B"&(row()-11)*2+2)
and drag downwards.
That should do. (Sheet1 <-- chg to ur tab name)
Pls share if it works/not/understandable.
Solution 3:[3]
Just in case, here is the script that copies the values from every second row from 'History' sheet to your first sheet into columns 'K' and 'L':
function copy_from_history_to_first_sheet() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sh_src = ss.getSheetByName('History');
var data = sh_src.getDataRange().getValues().filter((_,i) => i%2 == 0);
var col_A = data.map(x => [x[0]]);
var col_B = data.map(x => [x[1]]);
var sh_dest = ss.getSheetByName('High Low Temp Option');
sh_dest.getRange('K11:K' + (col_A.length+10)).setValues(col_A);
sh_dest.getRange('L11:L' + (col_B.length+10)).setValues(col_B);
}
Solution 4:[4]
I need A1 from "History" to move to K11 on "High Low Temp Option" tab. And just keep repeating like A3 to K12 and A5 to K13 and so on. Then I need to do the same thing to the evens so B2 to L11, B4 to L12 and so on.
I'll assume History is the tab name. You can do this cleanly with a filter too.
In K11:
=filter(History!A:A,mod(row(History!A:A),2)=1)
or
=filter(History!A:A,isodd(row(History!A:A)))
In L11:
=filter(History!B:B,mod(row(History!B:B),2)=0)
or
=filter(History!B:B,iseven(row(History!B:B)))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kunal Samal |
| Solution 2 | p._phidot_ |
| Solution 3 | Yuri Khristich |
| Solution 4 |
