如何将序列号放在数据gridview的行标题上 [英] how to put serial numbers on row headers of data gridview

查看:56
本文介绍了如何将序列号放在数据gridview的行标题上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,





i希望将行号作为序列号放在Windows应用程序中每行数据gridview的行标题上我在这个函数中使用了这样的代码



我写的函数



int count = 0;

foreach(来自donorview.Rows的DataGridViewRow行)

{

// //donorview.Rows[row.Index].HeaderCell.Value =(row.Index + 1).ToString();

count ++;

row.HeaderCell.Value = count.ToString();

}



但是这些数字没有显示在gridview的行标题上可能是什么问题?



请重播我



谢谢和问候

Ginnas

解决方案

check这个帖子



如何使DataGridView具有行标题序列号和统计列值 [ ^

Hello,


i wanted to put row numbers as serial numbers on row header of each rows of data gridview in windows application for that i have used the code like this

inside a function i wrote

int count = 0;
foreach (DataGridViewRow row in donorview.Rows)
{
// //donorview.Rows[row.Index].HeaderCell.Value = (row.Index + 1).ToString();
count++;
row.HeaderCell.Value = count.ToString();
}

but the numbers are not displaying on the row headers of the gridview what could be the problem?

please replay me

Thanks&Regards
Ginnas

解决方案

check this thread

How to Make a DataGridView it has Row-Header Serial Number and Statistics Column Value [^]


这篇关于如何将序列号放在数据gridview的行标题上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆