public GridFormatData Gridformat()
        {
            var table = getTable();

            if (System.Web.HttpContext.Current.Request.Cookies["MissingTrans"] != null)
            {
                DataTable dtNewtable = new DataTable();
                if (System.Web.HttpContext.Current.Session["SelectedColumns"] != null)
                {
                    string[] selectedColumns = (string[])System.Web.HttpContext.Current.Session["SelectedColumns"];
                    foreach (var column in selectedColumns)
                    {
                        for (int i = table.Rows.Count - 1; i >= 0; i--)
                        {
                            // whatever your criteria is

                            if (table.Rows[i][column].ToString() != "" && System.Web.HttpContext.Current.Request.Cookies["MissingTrans"].Value == "true")
                            {
                                table.Rows[i].Delete();
                            }
                        }
                        var a = table.Rows.Count;
                    }
                }
            }
            var tableList = table.AsEnumerable().AsQueryable();

            tableList.ToArray().AsQueryable();
            List <string[]> gridDataList = new List <string[]>();

            string[] columnNames = table.Columns.Cast <DataColumn>()
                                   .Select(x => x.ColumnName)
                                   .ToArray();

            gridDataList.Add(columnNames);
            foreach (var listData in tableList)
            {
                gridDataList.Add(listData.ItemArray.Select(x => x.ToString()).Cast <string>().ToArray());
            }

            var columns = new List <Column>();

            columns.Add(new Column {
                Header = "TextId", ClientFormat = ".TextId"
            });

            for (var i = 1; i < gridDataList[0].Length; i++)
            {
                columns.Add(new Column {
                    Header = gridDataList[0][i], ClientFormatFunc = "getVal(" + i + ", '" + gridDataList[0][i] + "')"
                });
            }

            columns.Add(new Column {
                ClientFormat = GridUtils.DeleteFormatForGrid("OriginalTextGrid", "TextId"), Width = 50
            });

            var gridItems = new List <GridArrayRow>();

            for (var i = 1; i < gridDataList.Count; i++)
            {
                gridItems.Add(new GridArrayRow {
                    TextId = gridDataList[i][0], Values = gridDataList[i]
                });
            }

            GridFormatData data = new GridFormatData();

            data.GridRows   = gridItems;
            data.GridColumn = columns;

            return(data);
        }