kendo grid In asp.net core project
how to Hide column DateResult
i have
columns.ForeignKey(p => p.result, (System.Collections.IEnumerable)ViewData["Result"], "id", "Name").Title("Result");
columns.bound(c =>c.DateResult) in my Grid
and there is three type of result ViewData(agree - disagree -Inprogress)
If the user select disagree I want to hide the DateResult
Note
popup editor
thanks
4 Answers, 1 is accepted

Hi Mohammed,
The columns of the Kendo UI Grid expose an option called Visible. You could utilize it in order to either show or hide a column:
columns.Bound(p => p.ProductName).Visible(bool); pass a boolean value
If the hiding of the column has to happen on the client-side, then, you should use the hideColumn method:
https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/methods/hidecolumn
Regards,
Tsvetomir
Progress Telerik

columns.ForeignKey(p => p.result, (System.Collections.IEnumerable)ViewData["Result"], "id", "Name").Title("Result");
columns.bound(c =>c.DateResult) in my Grid
and there is three type of result ViewData(agree - disagree -Inprogress)
If the user select disagree I want to hide the DateResult
i want it as conditionally
if (result==disagree)
{
hide the DateResult
}
else{}
it's possible or not please
Hi Mohammed,
Since you would like to hide the column depending on the value from the DropDownList that is the foreign key, you should handle the "Change" event of the DropDownList. You should navigate to the ForeignKey.cshtml file and add it there.
Within the handler, access the grid and hide the column with the method that I provided earlier. You could access the currently selected item from the DropDownList via the exposed event arguments:
function onChange(e){
var selectedItem = this.value();
}
I hope you find this helpful.
Regards,
Tsvetomir
Progress Telerik