Hi,
I am using a standard .NET 1.0 Datagrid. Actually, I am using two, bound to
a master-detail relationship. Both DataGrids are bound to a datasource. I
have the MSDN version of the DateTime picker functioning quite well in the
datagrid. I am also tracking a double-click event within another column in
the datagrid. The column is just text. When the double-click event trigger
fires, I load a borderless form, from which a user can pick an item from a
ListBox control. Once the user picks an item, the item text is entered into
the cell the user double-clicked on.
datagrid1.item(datagrid1.currentrowindex, datagrid.currentcell.colnumber) =
frmPopUp.lbControl1.selectedItem()
I then automatically move the user input to the next cell to the right. The
value from the listbox is entered into the cell. However, the datagrid does
not acknowledge that any changes were made to the dataset. It seems that
the datagrid change detection is bound to user input, such a keyboard event.
I have attempted to surround the datagrid.item property with BeginEdit and
EndEdit methods, to no avail. I have attempted to use CurrencyManager. I
tried incrementing and decrementing currentrowindex values, etc. I just
can't get the datagrid to see that a change was made.
Of course, if you any column values in the same row, such as the
datatimepicker value, a change to the row is detected.
Is there anyway I can get the datagrid to recognize that changes were made
besides writing my own ColumnStyle?
TIA
Dmitry 3 3294
Almost everybody in this newsgroup is using VB6 or lower. While
you may get a stray answer to VB.NET (including VB2003 and VB2005
which has dropped .NET from its name) questions here, you should
ask them in newsgroups devoted exclusively to .NET programming
(the languages are different enough to warrant separate newsgroup
support). Look for newsgroups with either the word "dotnet" or
"vsnet" in their name.
For the microsoft news server, try these newsgroups for Visual
Basic .NET related questions...
microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.languages.vb.upgrade
microsoft.public.dotnet.languages.vb.controls
microsoft.public.dotnet.languages.vb.data
And these for more general .NET questions
microsoft.public.dotnet.general
microsoft.public.vsnet.general
Note: There are many other .NET newgroups (use the first three
"fields" from the last two as templates when searching for them),
but the above ones should get you started.
Rick
"Dmitry Akselrod" <dm****@nospam.com> wrote in message
news:st********************@comcast.com... Hi, I am using a standard .NET 1.0 Datagrid. Actually, I am using
two, bound to a master-detail relationship. Both DataGrids are bound to a
datasource. I have the MSDN version of the DateTime picker functioning quite
well in the datagrid. I am also tracking a double-click event within
another column in the datagrid. The column is just text. When the double-click
event trigger fires, I load a borderless form, from which a user can pick an
item from a ListBox control. Once the user picks an item, the item text is
entered into the cell the user double-clicked on. datagrid1.item(datagrid1.currentrowindex,
datagrid.currentcell.colnumber) = frmPopUp.lbControl1.selectedItem() I then automatically move the user input to the next cell to the
right. The value from the listbox is entered into the cell. However, the
datagrid does not acknowledge that any changes were made to the dataset. It
seems that the datagrid change detection is bound to user input, such a
keyboard event.
I have attempted to surround the datagrid.item property with
BeginEdit and EndEdit methods, to no avail. I have attempted to use
CurrencyManager. I tried incrementing and decrementing currentrowindex values, etc.
I just can't get the datagrid to see that a change was made. Of course, if you any column values in the same row, such as the datatimepicker value, a change to the row is detected. Is there anyway I can get the datagrid to recognize that changes
were made besides writing my own ColumnStyle? TIA
Dmitry
I was able to solve my problem. I am posting a reply just in case someone
encounters the same issue.
The answer is that you cannot send an "I am editing this control"
notification to the DataGrid without inheriting a Column style in some way
shape or form. The quickest way I found to do this was to inherit the
DataGridTextBoxColumn style and expose the .ColumnStartedEditing protected
method. You can then call a public version of this method in your code.
This will mark the row you are editing as changed.
dmitry
"Dmitry Akselrod" <dm****@nospam.com> wrote in message
news:st********************@comcast.com... Hi, I am using a standard .NET 1.0 Datagrid. Actually, I am using two, bound to a master-detail relationship. Both DataGrids are bound to a datasource. I have the MSDN version of the DateTime picker functioning quite well in the datagrid. I am also tracking a double-click event within another column in the datagrid. The column is just text. When the double-click event trigger fires, I load a borderless form, from which a user can pick an item from a ListBox control. Once the user picks an item, the item text is entered into the cell the user double-clicked on. datagrid1.item(datagrid1.currentrowindex, datagrid.currentcell.colnumber) = frmPopUp.lbControl1.selectedItem() I then automatically move the user input to the next cell to the right. The value from the listbox is entered into the cell. However, the datagrid does not acknowledge that any changes were made to the dataset. It seems that the datagrid change detection is bound to user input, such a keyboard event. I have attempted to surround the datagrid.item property with BeginEdit and EndEdit methods, to no avail. I have attempted to use CurrencyManager. I tried incrementing and decrementing currentrowindex values, etc. I just can't get the datagrid to see that a change was made. Of course, if you any column values in the same row, such as the datatimepicker value, a change to the row is detected. Is there anyway I can get the datagrid to recognize that changes were made besides writing my own ColumnStyle? TIA
Dmitry
I just noticed you cross-posted to both a VB.NET newsgroup and a
non-VB.NET (that is, classic version of VB) newsgroup. So that it
is clear, my other response to your post was from the
microsoft.public.vb.general.discussion newsgroup. Just so you are
aware, the solution you posted has zero applicability (and
meaning) to the people for whom this newsgroup serves; hence, you
should leave the microsoft.public.vb.general.discussion newsgroup
out of any of your future postings. Thank you.
Rick
"Dmitry Akselrod" <dm****@nospam.com> wrote in message
news:5q******************************@comcast.com. .. I was able to solve my problem. I am posting a reply just in
case someone encounters the same issue.
The answer is that you cannot send an "I am editing this
control" notification to the DataGrid without inheriting a Column style
in some way shape or form. The quickest way I found to do this was to
inherit the DataGridTextBoxColumn style and expose the .ColumnStartedEditing
protected method. You can then call a public version of this method in
your code. This will mark the row you are editing as changed.
dmitry
"Dmitry Akselrod" <dm****@nospam.com> wrote in message news:st********************@comcast.com... Hi, I am using a standard .NET 1.0 Datagrid. Actually, I am using
two, bound to a master-detail relationship. Both DataGrids are bound to
a datasource. I have the MSDN version of the DateTime picker
functioning quite well in the datagrid. I am also tracking a double-click
event within another column in the datagrid. The column is just
text. When the double-click event trigger fires, I load a borderless form,
from which a user can pick an item from a ListBox control. Once the user
picks an item, the item text is entered into the cell the user
double-clicked on.
datagrid1.item(datagrid1.currentrowindex,
datagrid.currentcell.colnumber) = frmPopUp.lbControl1.selectedItem() I then automatically move the user input to the next cell to
the right. The value from the listbox is entered into the cell. However,
the datagrid does not acknowledge that any changes were made to
the dataset. It seems that the datagrid change detection is bound to user
input, such a keyboard event. I have attempted to surround the datagrid.item property with
BeginEdit and EndEdit methods, to no avail. I have attempted to use
CurrencyManager. I tried incrementing and decrementing currentrowindex values,
etc. I just can't get the datagrid to see that a change was made. Of course, if you any column values in the same row, such as
the datatimepicker value, a change to the row is detected. Is there anyway I can get the datagrid to recognize that
changes were made besides writing my own ColumnStyle? TIA
Dmitry
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ashish Shridharan |
last post by:
Hi All
I have been trying to add a control to the header cell of
a datagrid on my ASP.NET page. These controls are defined
in the HTML as ASP.NET web controls.
They are being added into the...
|
by: Bill C. |
last post by:
Hello,
I know this has been discussed a lot already because I've been searching
around for information the last few weeks.
I'm trying to implement a DataGridComboBoxColumn class. I've found...
|
by: BBFrost |
last post by:
Win2000
..Net 1.1 SP1
c# using Visual Studio
Ok, I'm currently in a "knock down - drag out" tussle with the .Net 1.1
datagrid.
I've come to realize that a 'block' of rows highlighted within...
|
by: pei_world |
last post by:
I want to implement a key hit with enter to dropdown a combobox that is in
the datagrid. in this case I need to override its original behaviours. I
found some codes from the web. Does anyone know...
|
by: Rick |
last post by:
Hello all, I hope all is well with you.
I am having a seriously difficult time with this problem. Allow me to
set
up the problem.
I have a System.Web.UI.Page with the following controls...
|
by: CVerma |
last post by:
Hi,
I have an embedded datagrid within a datalist. I am not able to
perfrom paging in the datagrid. Any ideas? Here is my code:
Here is my Simplegrid.cs file:
using System;
using...
|
by: CSL |
last post by:
I am using the DataGrid in a Windows Application, how can
I adjust the widths of each column individually.
|
by: Dave |
last post by:
Are there any add-on products or samples available that can do the following
in an vb.net datagrid
I want to compare 2 rows in a datagrid - one row from one database and
another row for another...
|
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: =?Utf-8?B?Y3JlYXZlczA2MjI=?= |
last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor
information and the details loads the documents for that vendor in a
datagrid. Everything is working fine until I click...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
| |