ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Table with Radio buttons
Title:
B
I
{code}
?
Is is possible to have a table with one read only "Serial/Lot Number" field and a dynamic list of radio button options where only one can be selected for the row ? Can the column headers be rotated 90 degrees as well ? Something like a survey form (e.g. Question, Radio buttons ranking for 1-10).
Save Changes
Cancel
Travis Gassmann
asked at 08 Jan 2019
Answers
B
I
{code}
?
you could use the inline edit demo: https://demo.aspnetawesome.com/GridInlineEditDemo but it requires the user to first click on the edit button or on the row. if you want to have radio buttons right from the start you could set the format of the column, example: (you can try this by adding a new view and controller to our main demo) <script> var meals = @Html.Raw(DemoUtils.Encode(Db.Meals.Select(o => new KeyContent(o.Id, o.Name)))); </script> @{ var rblformat = Html.Awe().AjaxRadioList("Meals") .DataFunc("utils.getItems(meals)") .Odropdown() // remove this line if you want actual radiobuttons .Prefix(".(Id)") .Svalue(".(BonusMealId)") .ToString(); } @(Html.Awe().Grid("GridRb") .Mod(o => o.PageInfo()) .Url(Url.Action("GridGetItems", "GridRadioButtons")) .Height(350) .Columns( new Column { Bind = "Id", Width = 100 }, new Column { Bind = "Name"}, new Column { Bind = "BonusMeal.Name", Header = "Bonus Meal", ClientFormat = rblformat })) as for rotating column headers, you could set `Header = "<span class='vert'>Bonus Meal<span>"` and have this css: .vert { transform: rotate(90deg); display: block; width: 50px; }
Save Changes
Cancel
Omu
answered at 09 Jan 2019
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK