Anybody please help me in this ..it is an urgent for me.
Actually i have a DataGridview in my window which should be with one fixed row and 2 fixed columns.
Fixedrow is done in Datagridview with the headercolumn property. Now i need to add 2 columns as fixed..
I tried with cell.frozen property, then the column is frozen, but still the tab control goes into this cells.and also it is not appearing same as column header.
Is there a way to make this 2 columns as rowheader?
In VB6 Flexgrid we have the option Fixedcols=2 ....is there any equivalent in DataGrideview windows C#?
Anyone please help me, asap...
Thanks in advance.
Hi wy not try this
If u need fixed rows in the datagrid, u can declare a datatable
System.Data.DataTable temp = new System.Data.DataTable();
col = new DataColumn("Source");
col = new DataColumn("Destination");
Later import the datatable in datagrid (assuming that u have created a form which have datagridview control in it)
Details frm1 = new Details(oDataTable);
then populating in the datagridview using
public partial class Details : Form
DataTable pDataTable = new DataTable();
public Details(DataTable oDataTable)
if (pDataTable != null)
pDataTable = oDataTable;
private void Details_Load(object sender, EventArgs e)
frm1.DataSource = pDataTable;
Later using following code to freeze additional columns
Actually i tried Frozen early
(dataGridView1.Columns.Frozen = true; ), but the column is not behaving as similar as the column header, for example...here
1, the frozen column cell can be selected individually, the data inside the cell (i.e control enters into the frozen cell)....
2,The colour and appearence is not same as in column headers....etc...
For me i need the first 2 columns of the datagridview to be fixed and act / look similar to column header for each row in the grid.
I realise this is out of date, but just in case anyone else comes across this thread like I did: frozen columns (like you get in Excel) can be achieved by using the .Frozen property.
However, if you wanted these columns to have a similar appearance to the column header cells, you are looking for RowHeaders, accessed by dataGridView1.Rows.HeaderCell.Value