Posted 13 August 2025, 5:58 pm EST
Hello,
I am trying to create a C1FlexGrid instead of a C1-Popup that displays details about the selected row inside the new flex grid. I am able to get the pop-up to appear and the data to be loaded, however, it doesn’t seem to display a scroll bar… My primary grid loads fine with a scroll bar, but this dynamic grid that is loaded when I refresh does not.
My assumption is that just doing a refresh of the grid doesn’t tell C1FlexGrid to recalculate total row height of the grid, because if I load the grid with data from the beginning, it shows a scroll bar. However, I’m not sure what I need to add to do this. Any help you can provide would be helpful.
Here is my code:
<script>
c1.documentReady(function(){
var fgMainGrid = wijmo.Control.getControl("#fgMainGrid");
fgMainGrid.addEventListener(fgMainGrid.hostElement, 'click', function (e) {
var ht = fgMainGrid.hitTest(e);
if (ht.panel.columns[ht.col].binding == 'HasSubGrid' && ht.panel != fgMainGrid.columnHeaders)
{
displaySubGrid();
}
});
});
function displaySubGrid() {
var fgMainGrid = wijmo.Control.getControl('#fgMainGrid');
var popSubGrid= wijmo.Control.getControl('#popSubGrid');
var fgSubGrid= wijmo.Control.getControl('#fgSubGrid');
var cvSubGrid= fgSubGrid.collectionView;
cvSubGrid.refresh();
popSubGrid.show(true, function(e) {
fgMainGrid.focus();
});
}
function getMainGridData() {
var fgMainGrid = wijmo.Control.getControl("#fgMainGrid");
if (e.extraRequestData == null) {
e.extraRequestData = {};
}
if (fgMainGrid) {
var currentItem = fgMainGrid.collectionView.currentItem;
e.extraRequestData["MainGridID"] = currentItem ? currentItem.MainGridID: "";
}
}
</script>
<c1-popup class="modal-content" id="popSubGrid" width="95%" height="90vh" hide-trigger="BlurPopup">
<c1-flex-grid id="fgSubGrid" auto-generate-columns="false" height="50vh" width="100%">
<c1-flex-grid-column header="Employee ID" binding="EmployeeID"></c1-flex-grid-column>
<c1-flex-grid-column header="Name" binding="Name"></c1-flex-grid-column>
<c1-items-source read-action-url="@Url.Action("fgSubGrid_Read")" query-data="getMainGridData" />
</c1-flex-grid>
</c1-popup>