本文介绍了C#.NET使最后一行冻结为真的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我正在C#Windows应用程序中工作.

我有一个将数据表分配为数据源的网格.

我想将最后一行冻结并给定

HiI 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

dgvReport.Rows[dgvReport.Rows.Count - 1].Frozen = true;


但是在这种情况下,滚动条被禁用.并且此frozin在设置数据源的表单加载中不起作用,但仅当在另一个按钮单击中执行了相同的代码时才起作用.

任何人都有解决办法
在此先感谢


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

推荐答案

private void dgvReport_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) 
{                 
   dgvReport.Rows[dgvReport.Rows.Count - 1].Frozen = true;
}


这篇关于C#.NET使最后一行冻结为真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 06:08