473,789 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do i set focus to a single cell that i determine

LCH
I have a form with a datagrid. The datagrid contains 5 columns and 5 rows.

the cell of the last column and the last row in the datagrid is set to
editable. When the form loads, I want the current focus to be set to this
particular editable field in the datagrid. The focus should highlight
whatever data is in the datagrid field at that time.

How do I do this? Thank you
Nov 21 '05 #1
2 4318
Hi,

Dim dgc As New DataGridCell(3, 2)

DataGrid1.Curre ntCell = dgc

Ken

---------------------------------

"LCH" <LC*@discussion s.microsoft.com > wrote in message
news:D1******** *************** ***********@mic rosoft.com...
I have a form with a datagrid. The datagrid contains 5 columns and 5 rows.

the cell of the last column and the last row in the datagrid is set to
editable. When the form loads, I want the current focus to be set to this
particular editable field in the datagrid. The focus should highlight
whatever data is in the datagrid field at that time.

How do I do this? Thank you

Nov 21 '05 #2
LCH
Thank you Ken Tucker :) your suggestion works

"Ken Tucker [MVP]" wrote:
Hi,

Dim dgc As New DataGridCell(3, 2)

DataGrid1.Curre ntCell = dgc

Ken

---------------------------------

"LCH" <LC*@discussion s.microsoft.com > wrote in message
news:D1******** *************** ***********@mic rosoft.com...
I have a form with a datagrid. The datagrid contains 5 columns and 5 rows.

the cell of the last column and the last row in the datagrid is set to
editable. When the form loads, I want the current focus to be set to this
particular editable field in the datagrid. The focus should highlight
whatever data is in the datagrid field at that time.

How do I do this? Thank you

Nov 21 '05 #3

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

Similar topics

0
1921
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 Framework 1.1 SP 1 installation. While using the .NET Framework version 1.1.4322.573, the selected cell is not highlighted when the focus from the datagrid is lost. But, while using the .NET Framework version 1.1.4322.2032, even after the focus is...
6
4851
by: MickG | last post by:
Hi, I am trying to validate these values, this seems to work fine for the phone number and name but I am trying to get the program to fail to submit and set the focus on the date when 2006 is selected and submitted. Thanks in advance for any help.
6
2026
by: joe | last post by:
Hi Everyone, could anyone comment on the following problem: I have a textbox being appended to a cell in a table, and am trying to call focus() on like this: <snip> c01.removeChild(answerbox); answerbox=document.createElement('input'); answerbox.addEventListener("change",check_answer,false); answerbox.style.fontSize=FONTSIZE; answerbox.style.backgroundColor=COLOR_ANSWBG;
2
28809
by: Liam McNamara | last post by:
I am having the same problem as the one I found in google below: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=%23LO32NWECHA.1968%40tkmsftngp02&rnum=3&prev=/groups%3Fq%3Dc%2523%2Bwhich%2Bcontrol%2Bhas%2Bfocus%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D%2523LO32NWECHA.1968%2540tkmsftngp02%26rnum%3D3 I need to determine which component has focus. When I select from the main menu File->Save my validation is...
21
9988
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; cell.RowNumber = dv.Count; m_DataGrid.CurrentCell = cell; } But this the last line of this code is putting the focus on the current
8
13640
by: jonny_morrisuk | last post by:
Hi! I have a scrollable css table cell thing going on, and would like to set the initial page focus to that cell in order that scrolling up and down with the cursor keys (or mouse scroll wheel even) will scroll that table cell rather than the html page. The page in question is here: http://test.jonathanmortimer.co.uk/other/ Any help is much appreciated! All I've managed to find so far is focus
2
3419
dlite922
by: dlite922 | last post by:
Before traversing my code, here's what my goal is and what this function does: I have a table of fields that dynamically grows as the user enters information. A minimum of 3 rows must always exist. (read the psedo code and comment if you need to know what it does) disregard the debugging , commented alerts. What i'm trying to do is without passing the ID or field that called this function, set the focus to the next element. what's...
1
1369
by: Lcoggshall | last post by:
Hi everyone, I am on site and have a huge issue I need an answer to ASAP. I have a Touch screen application. This app has a bbrower with 1 cell that is editable. Because it is a touch screen, when the user needs to type in a 2 digit number, once they touch the first pushbutton, I need to grab the contents, and reset the focus to that editable cell so they can punch in the 2nd digit. I am having a problem finding a 'Setfocus' Method for...
4
5864
by: foolmelon | last post by:
Before AJAX, we were able to focus a cell in a gridview during a fullpage postback. After putting the gridview inside an UpdatePanel, we cannot focus a cell in this gridview anymore. Does anybody know if it is possible to make such focus? Thanks! Bill
0
9666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10199
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10139
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3700
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.