<p>For a .netcore 3.1 web application I have a grid using grideditmode.inline and the columns are loaded using columns.LoadSettings(Model.columns)</p><p>The width of the editable columns is set in the Model.columns but no matter how I change the size, it always displays the same width. The width is too small in either state (editable or view) that you cannot see a full number if it is longer than 4 characters.</p><p>The columns that are set to not editable seem to follow the column width setting as passed in the columns.LoadSettings(Model.columns). I set the first editable field to a ridiculously large number and it made no difference.</p><p>What am I missing?</p><p> </p><p> </p>
This is a snippet of the columns - only showing a section for brevity since it is over 40 columns total (only half are visible.)
IList<GridColumnSettings> columns = new List<GridColumnSettings>
{
new GridColumnSettings
{
Member = "rowId",
//Member = "rowId",
Title = "Row Id",
Visible = false
//Locked = true
},
new GridColumnSettings
{
Member = "fgid",
Visible = false
},
new GridColumnSettings
{
Member = "PartNumber",
//Member = "PartNumber",
Title = "Part",
Width = "150px",
Filterable = true,
//Visible = true,
Locked = true
},
new GridColumnSettings
{
Member = "currentMon1",
Title = titles[0],
Visible = true,
Width = "500px",
Filterable = false,
Locked = false
},
new GridColumnSettings
{
Member = "currentMon1Id",
Title = "Mon1Id",
Visible = false
},
this is the grid:
@(Html.Kendo().Grid<PartRowView>().Name("grid1")
.Sortable()
.Editable(x => x.Mode(GridEditMode.InLine))
.Scrollable()
.Filterable()
.Resizable(r => r.Columns(true))
.ToolBar(tools => tools.Excel().IconClass("k-icon k-i-download"))
.Excel(excel => excel
.FileName(Model.filename)
.Filterable(true)
.AllPages(true)
.ProxyURL("/forecast/TestPage?handler=Save")
)
.Columns(columns => columns.LoadSettings(Model.columns)
)
.DataSource(ds => ds.Ajax()
.Events(events => events.Error("errors_handler"))
.ServerOperation(false)
.Read(r => r.Url(Url.Action() +"?handler=Read").Data("forgeryToken"))
.Update(u => u.Url(Url.Action() +"?handler=Update").Data("forgeryToken"))
.Model(model =>
{
model.Id(p => p.rowId);
model.Field(p => p.PartNumber).Editable(false);
model.Field(p => p.currentMon1Id).Editable(false);
model.Field(p => p.currentMon2Id).Editable(false);
model.Field(p => p.currentMon3Id).Editable(false);
model.Field(p => p.currentMon4Id).Editable(false);
model.Field(p => p.currentMon5Id).Editable(false);
model.Field(p => p.currentMon6Id).Editable(false);
model.Field(p => p.currentMon7Id).Editable(false);
model.Field(p => p.currentMon8Id).Editable(false);
model.Field(p => p.currentMon9Id).Editable(false);
model.Field(p => p.currentMon10Id).Editable(false);
model.Field(p => p.currentMon11Id).Editable(false);
model.Field(p => p.currentMon12Id).Editable(false);
model.Field(p => p.currentMon13Id).Editable(false);
model.Field(p => p.currentMon14Id).Editable(false);
model.Field(p => p.currentMon15Id).Editable(false);
model.Field(p => p.currentMon16Id).Editable(false);
model.Field(p => p.currentMon17Id).Editable(false);
model.Field(p => p.currentMon18Id).Editable(false);
})
.PageSize(100)
)
.Pageable()
)