人妻系列无码专区av在线,国内精品久久久久久婷婷,久草视频在线播放,精品国产线拍大陆久久尤物

當前位置:首頁 > 編程技術 > 正文

c 如何在dgv中查詢行號

c 如何在dgv中查詢行號

在C中,如果你使用的是DataGridView控件,你可以通過幾種方式來獲取當前選中的行的行號。以下是一個簡單的示例,演示了如何在DataGridView中獲取當前選中...

在C中,如果你使用的是DataGridView控件,你可以通過幾種方式來獲取當前選中的行的行號。以下是一個簡單的示例,演示了如何在DataGridView中獲取當前選中行的行號:

```csharp

using System;

using System.Windows.Forms;

public class DataGridViewExample : Form

{

private DataGridView dataGridView;

public DataGridViewExample()

{

dataGridView = new DataGridView();

dataGridView.Dock = DockStyle.Fill;

this.Controls.Add(dataGridView);

// 假設我們填充了一些數(shù)據(jù)

for (int i = 0; i < 10; i++)

{

dataGridView.Rows.Add("Row " + (i + 1));