title: How to hide Column for dynamic data in Devextreme DataGrid
body: <p>i have a problem for column hidding.</p>
  
  <p>In DataGrid don't have model type(Employee,Customer etc..). When data is coming, i parsing to json array and send to DataSource for DataGrid.</p>
  
  <p>Sorry my bad english.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@{
      JObject root = JObject.Parse(ViewBag.X.ToString());
      string _root = root.Value&lt;string&gt;("Message");
      JArray obj = JArray.Parse(_root) as JArray;
  }
  
      @(Html.DevExtreme().DataGrid()
                  .ID("DevDataGrid")
                  .DataSource(obj)
                  .Columns(c =&gt;
                  {
                      if (_anyPermission)
                      {
                          c.Add().DataField(BelbimADK.Web.Resource.txt_Action).CellTemplate(@&lt;text&gt;
                              @if (_allowUpdate)
                              {
                                  @(Html.DevExtreme().Button().ID("btnEdit").Text("").Icon("edit").Type(ButtonType.Default).OnClick("function(e) { onEdit(e, data, rowIndex) }"))
                              }
                              @if (_allowDelete)
                              {
                                  @(Html.DevExtreme().Button().ID("btnDelete").Text("").Icon("remove").Type(ButtonType.Danger).OnClick("function(e) { onDelete(e, data,rowIndex) }"))
                              }
                          &lt;/text&gt;
                          ).AllowFiltering(false).FormItem(f =&gt; f.Visible(false));
  
                      }
  
                  }).ColumnChooser(cc =&gt; cc
      .Enabled(true)
      .EmptyPanelText("Daha fazla sütün yoktur.")
      .Mode(GridColumnChooserMode.Select)
      )
  .Pager(a =&gt; a.Visible(true)
  .ShowPageSizeSelector(true)
  .ShowInfo(true))
  .Paging(p =&gt; p.PageSize(Convert.ToInt16(Resource.PageSize)))
  .FilterRow(f =&gt; f.Visible(true))
  .HeaderFilter(f =&gt; f.Visible(false))
  .OnRowUpdated("UpdateWithMessage")
  .OnRowInserted("InsertWithMessage")
  .AllowColumnResizing(true)
  .AllowColumnReordering(true)
  .RemoteOperations(true)
  .NoDataText("Kayıt Bulunamadı!")
  .ShowBorders(true)
  .Scrolling(Scrolling =&gt; Scrolling.ShowScrollbar(ShowScrollbarMode.Always))
  .ColumnAutoWidth(true)
  .Selection(s =&gt; s.Mode(SelectionMode.Multiple).AllowSelectAll(true))
  .Export(f =&gt; f.Enabled(true).FileName(_title).AllowExportSelectedData(true))
  .OnExported("ExportGrid")
  .Editing(e =&gt; e.AllowAdding(_allowInsert ? true : false).Mode(GridEditMode.Popup)
  .Popup(p =&gt; p
  .Title(_title)
  .ShowTitle(true)
  .Width(700)
  .Height(345)
  .Position(pos =&gt; pos
  .My(HorizontalAlignment.Center, VerticalAlignment.Center)
  .At(HorizontalAlignment.Center, VerticalAlignment.Center)
  .Of(new JS("window"))
  )))
  .RemoteOperations(true)
  .Grouping(g =&gt; g.AutoExpandAll(false))
  .OnRowRemoved("DeleteWithMessage")
  
                  )
  </code></pre>
  
  <p>I can see all column but i wanna hide some column. How can i hide spesific column? </p>
  
  <p>I tried this codes:</p>
  
  <pre><code>&lt;script&gt;
      $("#DevDataGrid").dxDataGrid({
                  "columnOption": {
                      "id":0,
                      "visible": false
                  }
              });
      ----------------------------------------
      $("#DevDataGrid").dxDataGrid("columnOption", 0, "visible", false);
      ----------------------------------------
      $("#DevDataGrid").dxDataGrid("columnOption", 0, "showInColumnChooser", false);
  &lt;/script&gt;
  </code></pre>
  
  <p>EDIT2----</p>
  
  <pre><code>@{
      JObject root = JObject.Parse(ViewBag.X.ToString());
      string _root = root.Value&lt;string&gt;("Message");
      JArray obj = JArray.Parse(_root) as JArray;
  }
  
      @(Html.DevExtreme().DataGrid()
                  .ID("DevDataGrid")
                  .DataSource(obj)
                  .Columns(c =&gt;
                  {
  
                  }).ColumnChooser(cc =&gt; cc
      .Enabled(true)
      .EmptyPanelText("Daha fazla sütün yoktur.")
      .Mode(GridColumnChooserMode.Select)
      )
  .Pager(a =&gt; a.Visible(true)
  .ShowPageSizeSelector(true)
  .ShowInfo(true))
  .Paging(p =&gt; p.PageSize(Convert.ToInt16(Resource.PageSize)))
  .FilterRow(f =&gt; f.Visible(true))
  .HeaderFilter(f =&gt; f.Visible(false))
  .OnRowUpdated("UpdateWithMessage")
  .OnRowInserted("InsertWithMessage")
  .AllowColumnResizing(true)
  .AllowColumnReordering(true)
  .RemoteOperations(true)
  .NoDataText("Kayıt Bulunamadı!")
  .ShowBorders(true)
  .Scrolling(Scrolling =&gt; Scrolling.ShowScrollbar(ShowScrollbarMode.Always))
  .ColumnAutoWidth(true)
  .Selection(s =&gt; s.Mode(SelectionMode.Multiple).AllowSelectAll(true))
  .Export(f =&gt; f.Enabled(true).FileName(_title).AllowExportSelectedData(true))
  .OnExported("ExportGrid")
  .Editing(e =&gt; e.AllowAdding(_allowInsert ? true : false).Mode(GridEditMode.Popup)
  .Popup(p =&gt; p
  .Title(_title)
  .ShowTitle(true)
  .Width(700)
  .Height(345)
  .Position(pos =&gt; pos
  .My(HorizontalAlignment.Center, VerticalAlignment.Center)
  .At(HorizontalAlignment.Center, VerticalAlignment.Center)
  .Of(new JS("window"))
  )))
  .RemoteOperations(true)
  .Grouping(g =&gt; g.AutoExpandAll(false))
  .OnRowRemoved("DeleteWithMessage")
  
                  )
  
  &lt;script&gt;
      $("#DevDataGrid").dxDataGrid({
                  "columnOption": {
                      "id":0,
                      "visible": false
                  }
              });
      ----------------------------------------
      $("#DevDataGrid").dxDataGrid("columnOption", 0, "visible", false);
      ----------------------------------------
      $("#DevDataGrid").dxDataGrid("columnOption", 0, "showInColumnChooser", false);
  &lt;/script&gt;
  </code></pre>