开发者

How to programatically select first row of DataGridView [duplicate]

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

Selecting a row in Datagridview Programatically?

I am developing a ne开发者_StackOverfloww desktop application in C# using Windows Forms. In one of my form i put the DataGridView Control and i am populating this dataGridViewControl Dynamically using my custom functions.

Now after populating the above control, is there any way to programatically select the first row of that DataGridViewview. Note: the Selection mode property of this DataGridView is set to "Full row Select"


Try:

dataGridView1.Rows[0].Selected = true;


To select one row in winform DataGridView TRY THIS:

dataGridView1.MultiSelect = false;
dataGridView1.MultiSelect = true;
dataGridView1.Rows[RowIndex].Selected = true;

It works ..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜