473,386 Members | 1,962 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

datagrid focus

Anyone know how to get the cursor to land inside the first column of a
datagrid after an add.

Me.Datagrid1.CurrentCell = New DataGridCell(Me.dataGrid1.CurrentRowIndex, 0)

will set focus but will not place the cursor inside the textbox in the grid.
If I press keys and hit tab, the value

will turn up, but I cannot see the value as I type.

I have tried everything with the exception of what works:-(

Best Regards

Randy
Nov 20 '05 #1
2 1542
Hi Randy

Try this:

CType(me.Datagrid1.TableStyles(0).GridColumnStyles (me.Datagrid1.CurrentCell.
ColumnNumber), DataGridTextBoxColumn).TextBox.Focus()

I am assuming that the current tablestyle is the first one. If not either
put the number of the style or the mapping name for the table style.

I am also assuming that the gridcolumnstyle is a textbox.

Bob Pfeffer


Nov 20 '05 #2
Thanks Bob

This has worked better because I get focus on the column but the cursor
still does not want
to land (flash) inside the textbox. If I type and press tab, the text will
show up. It just won't show up as I type. There maybe another event that
is interfearing with it. I will try it on a New form.

Thanks for your help.

Randy
<rm*****@attglobal.net> wrote in message
news:u6**************@TK2MSFTNGP10.phx.gbl...
Hi Randy

Try this:

CType(me.Datagrid1.TableStyles(0).GridColumnStyles (me.Datagrid1.CurrentCell. ColumnNumber), DataGridTextBoxColumn).TextBox.Focus()

I am assuming that the current tablestyle is the first one. If not either
put the number of the style or the mapping name for the table style.

I am also assuming that the gridcolumnstyle is a textbox.

Bob Pfeffer

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: raj | last post by:
Hi, The focus in the datagrid is not lost even after leaving the datagrid. The selected cell is highlighted even when the focus from the datagrid is lost. This happens only after the .NET...
0
by: ED M. | last post by:
Hello all...I'm new to the board. I have a problem that I hope someone here might be able to solve for me. I am doing some clientside validation using Javascript. The text I am testing is...
11
by: Junkguy | last post by:
I need some help programmatically causing a row in a DataGrid to "flush" its contents to its bound data (in Visual Studio 6 using Windows Forms with C#). My issue is I want to send an update to...
5
by: Bryan Masephol | last post by:
Hi All I got a datagrid and a ComboBox on a form. I populate the combobox with years for all the data avaiable. When the user chooses a year the datagrid is populated with the specific years...
0
by: Shravan | last post by:
Hi, I have a Windows Forms Custom DataGrid, which is put in a usercontrol, which on setting DataSource is setting focus to grid. The call stack for setting the focus is as follows. This is not...
2
by: Bill C. | last post by:
Hi, I'm trying to implement a ComboBox drop-down column for a DataGrid. When a cell is selected in the ComboBox column I overlay a ComboBox over the cell and call: this.comboBox.Show();...
3
by: bardo | last post by:
I have a Datagrid that is inside a panel. I want to use the keyDown event to reconize the arrow keys. But I have no luck at all. The problem is that the keydown event won't fire at all, unless I...
1
by: jimb | last post by:
I can get the dropdownlist into the datagrid, and I can populate it, but I can't read it. Anybody have a working example of a dropdownlist in an editable grid? Thanks. -- .....
2
by: kenglish_hi | last post by:
hello, I have a form with a datagrid and combo box. When the form loads up, i want the focus to be on the combo box. however, whenever it loads up, the focus is always on the datagrid. in the...
21
by: Sharon | last post by:
I have added an auto scroll feature to my DataGrid control like this: private void DoAutoScroll() { DataView dv = m_DataGrid.DataSource as DataView; DataGridCell cell = m_DataGrid.CurrentCell;...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.