.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

Programmatically giving focus to Particular Cell in DataGridView

Posted By: Shivaraj Poojary     Posted Date: March 30, 2011    Points:5   Category :C#
Hi Experts..
I Am developing windows application in c#.net.I want to know how to focus to particular cell in datagridview...Please help me out

Responses
Author: Mahesh             
Posted Date: March 30, 2011     Points: 20   

hi,
you can follow the link below,

http://social.msdn.microsoft.com/forums/en-US/Vsexpressvcs/thread/25c3482b-8f5e-48ca-82a4-9df90c42a6e4/

Thanks & Regards
Mahesh

Author: Maverick             
Posted Date: March 31, 2011     Points: 20   

Hello,

Use on rowdatabound event. There you egt everything for the grid. paste your code please


Thanks,
Maverick

Thanks,
Maverick
Author: Shivaraj Poojary             
Posted Date: March 31, 2011     Points: 20   

HI..
In the cell click event I want to focus on current row cell but the following code focus on new row..


private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == (dataGridView1.Columns.Count - 1))
{

dataGridView1.ReadOnly = false;
int c = dataGridView1.Rows.Count;

for (int i = 0; i < c; i++)
{
dataGridView1.CurrentCell = dataGridView1.Rows[i].Cells[2];

dataGridView1.BeginEdit(true);

}
}
}



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend