Click here to Skip to main content
16,013,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am working in C# windows application.

I have a grid to which datatable is assigned as data source.

I want to make last row as frozen and given
C#
dgvReport.Rows[dgvReport.Rows.Count - 1].Frozen = true;

But the scroll bar is disabled in this case. and also this frozin not working in form load where I set the data source but work only if the same code is execute in an other button click.

Anyone have solution
Thanks in advance
Posted
Updated 28-Nov-11 23:25pm
v2

1 solution

frozen your row in dgvReport_DataBindingComplete event.

C#
private void dgvReport_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) 
{                 
   dgvReport.Rows[dgvReport.Rows.Count - 1].Frozen = true;
}
 
Share this answer
 
Comments
sumana shabeeb 29-Nov-11 5:43am    
Its ok ..but scroll bar disappearing in this case.. but its working fine if i make first row as frozen
sumana shabeeb 30-Nov-11 0:41am    
when we making a particular row frozen all rows above this row becoming as frozen. Actually i need to freeze last row only

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900