Hello
I am struggling to find any documentation/examples of Razor grid syntax beyond just a basic way to get the page working. For example I have code that makes the basic grid, and it seems like there are a lot of features but I dont know how to use them. My specific questions are:
1. How do I control which fields show as editable when I click to edit? Currently they just all show and that is not what I want. I see I can add .Editable() to the columns but I dont see any documentation as to what value Im supposed to pass into there (besides the method signature) because it doesnt accept true/false?
2. In the fields that show, how do I control which fields are required? They are currently all by default required and that is not what I want.
3. I am looking to make the Boolean values show as Yes/No rather than true false. I see possibly this as a solution but it just tells me #MyBool is not defined.:
col.Bound(c => c.isProse).Title("ProSe").Width(55).ClientTemplate("#= MyBool ? 'Yes' : 'No' #");
Grid Code:
<div id="parties-scheduling" style="margin-right:8px;border:none;padding:0;color:black;"><div id="PartiesTopRowInfo">
@Html.Kendo().Grid(Model.MiscellaneousInfo.PartyInfoList).Name("PartyGrid").ToolBar(x =>
x.Create()).Size(ComponentSize.Small).Editable(GridEditMode.PopUp).Resizable(r => r.Columns(true)).Columns(col =>
{
// col.Select().Width(50).HtmlAttributes(new { @class = "checkbox-align" }).HeaderHtmlAttributes(new { @class = "checkbox-align" });
col.Bound(c => c.Name.BuiltName).Title("Name").Width(175);
col.Bound(c => c.PartyRole).Title("Role").Width(150);
col.Bound(c => c.PartyRoleOverride).Title("Role Override").Width(150);
col.Bound(c => c.AppearanceType).Title("Appear Type").Width(100);
col.Bound(c => c.Timely).Width(60);
col.Bound(c => c.ServiceType).Width(150);
col.Bound(c => c.DateServed).Width(100);
col.Bound(c => c.isProse).Title("ProSe").Width(55);
col.Command(c =>
{
c.Edit();
c.Destroy();
}).Width(170);
}).Sortable().DataSource(dataSource =>dataSource
.Ajax()
.Read(r => r.Url("/Appearances/MiscellaneousInformation?handler=Read").Data("forgeryToken"))
.Update(r => r.Url("/Appearances/MiscellaneousInformation?handler=Update").Data("forgeryToken"))
.Create(r => r.Url("/Appearances/MiscellaneousInformation?handler=Create").Data("forgeryToken"))
.Destroy(r => r.Url("/Appearances/MiscellaneousInformation?handler=Destroy").Data("forgeryToken"))
.Model(m => m.Id(id => id.PartyAppearanceID)))
</div>
</div>