The 'CurrentCell' property should do the trick (as I have already mentioned).
datagridview1.CurrentCell = datagridview1[colindex, rowindex]; Have you tried the above statement? And ofcourse it also depends on how and where you are executing. Please also mention the Platform I mean .net Framework version (but I think this is NOT an issue) For more information you can check the followings: http://msdn.microsoft.com/en-us/library/yc4fsbf5(VS.80).aspx http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcell(VS.80).aspx On Dec 2, 11:16 pm, "yashodabest v" <[EMAIL PROTECTED]> wrote: > Thanks a lot > but still I don't get the cursor focus. That is the line border like one > which points to the cell. > When it is there the things u type are written there. I want to get that > focus to the cell. > Anyway thanks a lot > > > > On Mon, Dec 1, 2008 at 5:19 PM, sallushan <[EMAIL PROTECTED]> wrote: > > > also, > > > dataGridView1[colindex, rowindex].Selected = true; > > > above statement will only select i.e. don't set the focus to > > particular cell. > > > On Dec 1, 4:17 pm, sallushan <[EMAIL PROTECTED]> wrote: > > > datagridview1.CurrentCell = datagridview1[colindex, rowindex]; > > > > Above will set focus on the particular cell. And what do you mean by > > > "cursor"? if it means the "dotted focus rectangle" then use the same > > > statement. If it means that Cell should be in edit mode then execute > > > the following line after the above line, > > > > datagridview1.BeginEdit(true); > > > > where, > > > > true = Select All the previously written text > > > false = don't select > > > > On Nov 30, 4:40 pm, "yashodabest v" <[EMAIL PROTECTED]> wrote: > > > > > Hi everybody, > > > > > Do u know a way for the following. > > > > How to give focus to a particular cell in a datagridview in C#? > > > > How to display the cursor in a particular cell in a datagridview in C#? > > > > > Thanks- Hide quoted text - > > > > - Show quoted text -- Hide quoted text - > > - Show quoted text -
