Posted 13 August 2018, 7:51 pm EST
Hi,
You may apply styling for cell by defining style using .wj-cell class and HTML content can be add to the cells using ItemFormatter property. Please refer to the attached sample and following code snippet for the same:
<style>
.custom .wj-cell{
padding: 10px;
}
.custom .wj-cell.wj-header {
color: white;
background: black;
font-family: 'Times New Roman', Times, serif;
}
</style>
<script>
function ItemFormatter(panel, r, c, cell) {
if (panel.cellType == 1 && c==2) {
cell.innerHTML = "<img src='https://images.pexels.com/photos/103567/pexels-photo-103567.jpeg?auto=compress&cs=tinysrgb&h=350' width=25 height=25 /> " + cell.innerText;
}
}
</script>
@(
Html.C1().FlexGrid().Id("grid").CssClass("custom")
.IsReadOnly(true)
.Height(500)
.ItemFormatter("ItemFormatter")
.Bind(m => m.Bind(Model))
)
Hope it helps!
~Manish
FlexGridIntro_Cell_padding_ImageHTML.zip