We have a client server application where we would like to not show Save and
Cancel buttons on a winform until the user has actually entered something
into a textbox or combobox etc., and there is something to actually save.
This logic is fundamental to the way we would like to do things in general
so it is worth our while to get this figured out correctly once and for all.
To my mind, what needs to be done is to be able to detect when the user has
entered edit mode. We have discovered a way that works, but it's kind of
kludge. We have discovered that we can make use of onKeyPress and detect
when a key is entered. When a key is pressed this effectively means the
user is in edit mode but there are catches. What if the user selects
something from a combobox instead of using the keyboard? we would then have
to trap for keyboard changes, listbox selections and one and on. I think
there is a better way but am not sure what it is.
There are two different issues - one with fields on a winform and another
with regard to grids on a winform. I have a question about grids posted
elsewhere.
Does anyone else have a better way for us to be able to detect if the user
has entered edit mode? I am aware that you can trap for column changing but
this only fires after the user has entered something and is getting ready to
leave the column. This is not what we want. We are hoping that something
fires as soon as the user makes a change to any cell so we can trap for it
and thereby make the buttons visible when they should be.
Anyone? 3 2009
Woody,
I've dealth with this problem many times. It is less painful to simply trap
the TextChanged event of a textbox, combobox, or datagrid cell. This event
triggers when the control's text changes with keyboard input, item
selections, etc...
-Fabricio fg*************@yahoo.com
"Woody Splawn" wrote: We have a client server application where we would like to not show Save and Cancel buttons on a winform until the user has actually entered something into a textbox or combobox etc., and there is something to actually save. This logic is fundamental to the way we would like to do things in general so it is worth our while to get this figured out correctly once and for all.
To my mind, what needs to be done is to be able to detect when the user has entered edit mode. We have discovered a way that works, but it's kind of kludge. We have discovered that we can make use of onKeyPress and detect when a key is entered. When a key is pressed this effectively means the user is in edit mode but there are catches. What if the user selects something from a combobox instead of using the keyboard? we would then have to trap for keyboard changes, listbox selections and one and on. I think there is a better way but am not sure what it is.
There are two different issues - one with fields on a winform and another with regard to grids on a winform. I have a question about grids posted elsewhere.
Does anyone else have a better way for us to be able to detect if the user has entered edit mode? I am aware that you can trap for column changing but this only fires after the user has entered something and is getting ready to leave the column. This is not what we want. We are hoping that something fires as soon as the user makes a change to any cell so we can trap for it and thereby make the buttons visible when they should be.
Anyone?
Are you suggesting that I trap the texchanged event of every textbox or
combobox etc., on the form? This seems rather onerous.
I have been told elsewhere that what I am really trying to do is to check to
see if the row is dirty.
"Fabricio" <Fa******@discussions.microsoft.com> wrote in message
news:5E**********************************@microsof t.com... Woody,
I've dealth with this problem many times. It is less painful to simply
trap the TextChanged event of a textbox, combobox, or datagrid cell. This
event triggers when the control's text changes with keyboard input, item selections, etc...
-Fabricio fg*************@yahoo.com
"Woody Splawn" wrote:
We have a client server application where we would like to not show Save
and Cancel buttons on a winform until the user has actually entered
something into a textbox or combobox etc., and there is something to actually
save. This logic is fundamental to the way we would like to do things in
general so it is worth our while to get this figured out correctly once and for
all. To my mind, what needs to be done is to be able to detect when the user
has entered edit mode. We have discovered a way that works, but it's kind
of kludge. We have discovered that we can make use of onKeyPress and
detect when a key is entered. When a key is pressed this effectively means the user is in edit mode but there are catches. What if the user selects something from a combobox instead of using the keyboard? we would then
have to trap for keyboard changes, listbox selections and one and on. I
think there is a better way but am not sure what it is.
There are two different issues - one with fields on a winform and
another with regard to grids on a winform. I have a question about grids posted elsewhere.
Does anyone else have a better way for us to be able to detect if the
user has entered edit mode? I am aware that you can trap for column changing
but this only fires after the user has entered something and is getting
ready to leave the column. This is not what we want. We are hoping that
something fires as soon as the user makes a change to any cell so we can trap for
it and thereby make the buttons visible when they should be.
Anyone?
Yes, precisely what I suggested... trap the textchanged event. VB.NET allows
you to attach multiple delegates from different controls to a single event
handler (i.e. you only need one function to handle all the textchanged
events).
-Fabricio
"Woody Splawn" wrote: Are you suggesting that I trap the texchanged event of every textbox or combobox etc., on the form? This seems rather onerous. I have been told elsewhere that what I am really trying to do is to check to see if the row is dirty.
"Fabricio" <Fa******@discussions.microsoft.com> wrote in message news:5E**********************************@microsof t.com... Woody,
I've dealth with this problem many times. It is less painful to simply trap the TextChanged event of a textbox, combobox, or datagrid cell. This event triggers when the control's text changes with keyboard input, item selections, etc...
-Fabricio fg*************@yahoo.com
"Woody Splawn" wrote:
We have a client server application where we would like to not show Save and Cancel buttons on a winform until the user has actually entered something into a textbox or combobox etc., and there is something to actually save. This logic is fundamental to the way we would like to do things in general so it is worth our while to get this figured out correctly once and for all. To my mind, what needs to be done is to be able to detect when the user has entered edit mode. We have discovered a way that works, but it's kind of kludge. We have discovered that we can make use of onKeyPress and detect when a key is entered. When a key is pressed this effectively means the user is in edit mode but there are catches. What if the user selects something from a combobox instead of using the keyboard? we would then have to trap for keyboard changes, listbox selections and one and on. I think there is a better way but am not sure what it is.
There are two different issues - one with fields on a winform and another with regard to grids on a winform. I have a question about grids posted elsewhere.
Does anyone else have a better way for us to be able to detect if the user has entered edit mode? I am aware that you can trap for column changing but this only fires after the user has entered something and is getting ready to leave the column. This is not what we want. We are hoping that something fires as soon as the user makes a change to any cell so we can trap for it and thereby make the buttons visible when they should be.
Anyone? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: NewToDotNet |
last post by:
Hi,
I am very new to ASP.NET and web programming in general. I have one issue. I have a Datagrid object with Edit template. In one Datagrid row, I have 1 DropdownList, 1 textbox and 1 readonly...
|
by: sck10 |
last post by:
Hello,
I am trying to change a value when a user goes into edit mode on a
DetailsView control. I am trying to use the following, but can not figure
out how to get to the bound field...
|
by: Dean Slindee |
last post by:
In my application there is a main form with a tabcontrol. On each page in
the tabcontrol is a panel upon which is painted a "sub" form. The main form
acts as the "application host", while the...
|
by: wandii |
last post by:
Hi,
I have a datagrid attached to a dataset. It displays the records
fine however, when I edit one
of the cells it does not change the edit icon to the pencil icon on the
left of the row I just...
|
by: phamer |
last post by:
Hello. My switchbaord contains 2 options: add a record and edit a
record. So, of course, if I click add a record, the first form opens
in add mode; if I click edit, the first form opens in edit...
|
by: rn5a |
last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB
table. Users can modify the records using this DataGrid for which I am
using EditCommandColumn in the DataGrid. This is the...
|
by: savajx1 |
last post by:
I need to dynamically create a set of bound fields contained in a
GridView control. I also have a single static CommandField that I can
declare in the Columns <tagof the GridView control. I have...
|
by: =?Utf-8?B?bWlrZWc=?= |
last post by:
Hi,
I am building a small Help Desk application for my company and need to be
able to edit "open" help desk issues. I use a simple datagrid to display
each issue (6 per page) , with an Edit...
|
by: Ryan Liu |
last post by:
I have this problem: "cannot continue edit while debug in VS2005".
I see the same tread after I search this topic in google, but none solutions
works for me. So again, I ask here. Can someone...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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...
|
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...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |