Open Deevan opened 5 years ago
I found answer to this by my self.
This code
MVCGrid.setColumnVisibility('ColumnVisibilityGrid', jsonData);
is supposed to call on click event of a button.
I was trying to call it on document ready. because i wanted to set few columns to be visible automatically without asking user to choose columns.
I, also, tried to call jquery trigger click function on document ready but NO LUCK :( see my not working code below
@section scripts{
<script type="text/javascript">
$(function () {
var jsonData = {};
jsonData["Col_3"] = true;
jsonData["Col_4"] = true;
jsonData["Col_5"] = true;
MVCGrid.setColumnVisibility('MyGrid', jsonData);
});
</script>
}
There has to be a way to call this functionality on page load/ document.ready
ANY SUGGESTIONS??
Try this:
I have tried to set Column Visibility from client side. as directed HERE
On Line 78 On this code MVCGrid.setColumnVisibility('ColumnVisibilityGrid', jsonData); I am getting below error
Any Help is highly appreciated..