Posted 7 November 2018, 10:28 pm EST
Hi,
The updated view event occurs when the grid finishes creating/updating the elements that make up the current view.
The grid updates the view in response to several actions, including:
1.refreshing the grid or its data source,
2.adding, removing, or changing rows or columns,
3, resizing or scrolling the grid,
4. changing the selection.
use t
The Updatedlayout gets called after grid has updated its internal layout . You can add the handler for Updated layout in the same way .
<script>
var isLoad = true;
function updateLayout(s, e) {
if (isLoad) { // avoid recurrsive calling
isLoad = false;
s.autoSizeColumns();
}
}
function format(panel, r, c, cell) {
if (panel.cellType == 1) {
cell.innerHTML= "<p style='width:500px;'>"+cell.innerText+"</p>"
}
}
</script>
@(Html.C1().FlexGrid()
.Id("gridB")
.AllowSorting(false)
.Filterable()
.Bind(b => b.DisableServerRead(true).Bind(Model))
.AutoGenerateColumns(false)
.IsReadOnly(true)
.Columns(bl =>
{
bl.Add(cb => cb.Binding("Hired").Format("u").Header("Universal Format"));
bl.Add(cb => cb.Binding("Hired").Format("G").Header("General Format"));
bl.Add(cb => cb.Binding("Hired").Format("F").Header("Full Date Time Format"));
bl.Add(cb => cb.Binding("Hired").Format("d").Header("Full Date Time Format"));
})
.ItemFormatter("format")
.OnClientUpdatedLayout("updateLayout")
)