Column span in gridview Edit mode

 if (e.Row.RowState.ToString().Contains("Edit"))
                {
                    GridView editGrid = sender as GridView;
                    DataRowView drv = (DataRowView)e.Row.DataItem;
                    int colSpan = editGrid.Columns.Count;
                    for (int i = 1; i < colSpan -1; i++)
                    {
                        e.Row.Cells[i].Visible = false;
                        e.Row.Cells[i].Controls.Clear();
                    }
                    e.Row.Cells[0].Attributes["ColSpan"] = (colSpan-1).ToString();
                }

Comments

Popular posts from this blog

WCF interview questions

The term 'Connect-MsolService' is not recognized as the name of a cmdlet, function, script file, or operable program

what is Event Cache table in sharepoint