473,396 Members | 1,886 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,396 software developers and data experts.

DataGrid and text box

JRD
Greetings,

I was wondering if anyone has come across a scenario and like this and what
solution did you use.

I have a datagrid that is populated from the database with the list of drugs
and their associated dose and so on.

And then I have a single textbox (multiline) that has information for each
drug in the grid. What I would like to be able to do is that everytime I
remove a drug from the Datagrid, that it removes the associated information
on the drug from the text box.

Was wondering if anyone has any ideas on how I could accomplished this using
vb.net or if there is a component out there that does it then that would be
great. Thanks.

John
Dec 15 '06 #1
5 1528
JRD
And addition to this so that I can better
Datagrid with 3 rows in it

Item1
Item2
Item3

Text box with the following text
Item1: some text that goes for this item and so on
so on son.
Item2: some more text
and more text
Item3: last piece of text

User wants to remove Item2 from the grid, so in the text box the text
associate with Item2 should be removed as well. Where Item2 text is the
following:
Item2: some more text
and more text

I was given a regular expression that may work, but I have not gotten it to
work, since I don't know them very well, but this is what I was given

Replace(textbox contents,"^Key:.*$","")

Where Key is Item1 or Item2 or Item3

Hopefully this clears it up a little better for everyone as to what I am
trying to do.
"JRD" <si*****@smartidworks.comwrote in message
news:ed**************@TK2MSFTNGP03.phx.gbl...
Greetings,

I was wondering if anyone has come across a scenario and like this and
what solution did you use.

I have a datagrid that is populated from the database with the list of
drugs and their associated dose and so on.

And then I have a single textbox (multiline) that has information for each
drug in the grid. What I would like to be able to do is that everytime I
remove a drug from the Datagrid, that it removes the associated
information on the drug from the text box.

Was wondering if anyone has any ideas on how I could accomplished this
using vb.net or if there is a component out there that does it then that
would be great. Thanks.

John

Dec 15 '06 #2
Why don't you use a listbox instead of a textbox?
Then you could remove the line in question without
doing any parsing -- just remove that line from the
listbox.

Robin S.
--------------------------
"JRD" <jd****@dalys.uswrote in message
news:eL**************@TK2MSFTNGP06.phx.gbl...
And addition to this so that I can better
Datagrid with 3 rows in it

Item1
Item2
Item3

Text box with the following text
Item1: some text that goes for this item and so on
so on son.
Item2: some more text
and more text
Item3: last piece of text

User wants to remove Item2 from the grid, so in the text box the text
associate with Item2 should be removed as well. Where Item2 text is
the following:
Item2: some more text
and more text

I was given a regular expression that may work, but I have not gotten
it to work, since I don't know them very well, but this is what I was
given

Replace(textbox contents,"^Key:.*$","")

Where Key is Item1 or Item2 or Item3

Hopefully this clears it up a little better for everyone as to what I
am trying to do.
"JRD" <si*****@smartidworks.comwrote in message
news:ed**************@TK2MSFTNGP03.phx.gbl...
>Greetings,

I was wondering if anyone has come across a scenario and like this
and what solution did you use.

I have a datagrid that is populated from the database with the list
of drugs and their associated dose and so on.

And then I have a single textbox (multiline) that has information for
each drug in the grid. What I would like to be able to do is that
everytime I remove a drug from the Datagrid, that it removes the
associated information on the drug from the text box.

Was wondering if anyone has any ideas on how I could accomplished
this using vb.net or if there is a component out there that does it
then that would be great. Thanks.

John


Dec 16 '06 #3
JRD
I could do that, but I also need to be able to allow the user to add items
to the text box and I don't believe the list box will allow me to do that.

"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:8M******************************@comcast.com. ..
Why don't you use a listbox instead of a textbox?
Then you could remove the line in question without
doing any parsing -- just remove that line from the
listbox.

Robin S.
--------------------------
"JRD" <jd****@dalys.uswrote in message
news:eL**************@TK2MSFTNGP06.phx.gbl...
>And addition to this so that I can better
Datagrid with 3 rows in it

Item1
Item2
Item3

Text box with the following text
Item1: some text that goes for this item and so on
so on son.
Item2: some more text
and more text
Item3: last piece of text

User wants to remove Item2 from the grid, so in the text box the text
associate with Item2 should be removed as well. Where Item2 text is the
following:
Item2: some more text
and more text

I was given a regular expression that may work, but I have not gotten it
to work, since I don't know them very well, but this is what I was given

Replace(textbox contents,"^Key:.*$","")

Where Key is Item1 or Item2 or Item3

Hopefully this clears it up a little better for everyone as to what I am
trying to do.
"JRD" <si*****@smartidworks.comwrote in message
news:ed**************@TK2MSFTNGP03.phx.gbl...
>>Greetings,

I was wondering if anyone has come across a scenario and like this and
what solution did you use.

I have a datagrid that is populated from the database with the list of
drugs and their associated dose and so on.

And then I have a single textbox (multiline) that has information for
each drug in the grid. What I would like to be able to do is that
everytime I remove a drug from the Datagrid, that it removes the
associated information on the drug from the text box.

Was wondering if anyone has any ideas on how I could accomplished this
using vb.net or if there is a component out there that does it then that
would be great. Thanks.

John



Dec 20 '06 #4
Sure you can. Here's the info about using a ListBox.

http://msdn2.microsoft.com/en-us/library/3bz1s4ky.aspx

Robin S.
-----------------------------
"JRD" <jd****@dalys.uswrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I could do that, but I also need to be able to allow the user to add
items to the text box and I don't believe the list box will allow me to
do that.

"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:8M******************************@comcast.com. ..
>Why don't you use a listbox instead of a textbox?
Then you could remove the line in question without
doing any parsing -- just remove that line from the
listbox.

Robin S.
--------------------------
"JRD" <jd****@dalys.uswrote in message
news:eL**************@TK2MSFTNGP06.phx.gbl...
>>And addition to this so that I can better
Datagrid with 3 rows in it

Item1
Item2
Item3

Text box with the following text
Item1: some text that goes for this item and so on
so on son.
Item2: some more text
and more text
Item3: last piece of text

User wants to remove Item2 from the grid, so in the text box the
text associate with Item2 should be removed as well. Where Item2
text is the following:
Item2: some more text
and more text

I was given a regular expression that may work, but I have not
gotten it to work, since I don't know them very well, but this is
what I was given

Replace(textbox contents,"^Key:.*$","")

Where Key is Item1 or Item2 or Item3

Hopefully this clears it up a little better for everyone as to what
I am trying to do.
"JRD" <si*****@smartidworks.comwrote in message
news:ed**************@TK2MSFTNGP03.phx.gbl...
Greetings,

I was wondering if anyone has come across a scenario and like this
and what solution did you use.

I have a datagrid that is populated from the database with the list
of drugs and their associated dose and so on.

And then I have a single textbox (multiline) that has information
for each drug in the grid. What I would like to be able to do is
that everytime I remove a drug from the Datagrid, that it removes
the associated information on the drug from the text box.

Was wondering if anyone has any ideas on how I could accomplished
this using vb.net or if there is a component out there that does it
then that would be great. Thanks.

John



Dec 20 '06 #5
Ooops; sorry. That was the ListView. Here's the Listbox.

http://msdn2.microsoft.com/en-us/library/61sk9hfb.aspx

Robin S.
-----------------------------
"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:gO******************************@comcast.com. ..
Sure you can. Here's the info about using a ListBox.

http://msdn2.microsoft.com/en-us/library/3bz1s4ky.aspx

Robin S.
-----------------------------
"JRD" <jd****@dalys.uswrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>I could do that, but I also need to be able to allow the user to add
items to the text box and I don't believe the list box will allow me
to do that.

"RobinS" <Ro****@NoSpam.yah.nonewrote in message
news:8M******************************@comcast.com ...
>>Why don't you use a listbox instead of a textbox?
Then you could remove the line in question without
doing any parsing -- just remove that line from the
listbox.

Robin S.
--------------------------
"JRD" <jd****@dalys.uswrote in message
news:eL**************@TK2MSFTNGP06.phx.gbl...
And addition to this so that I can better
Datagrid with 3 rows in it

Item1
Item2
Item3

Text box with the following text
Item1: some text that goes for this item and so on
so on son.
Item2: some more text
and more text
Item3: last piece of text

User wants to remove Item2 from the grid, so in the text box the
text associate with Item2 should be removed as well. Where Item2
text is the following:
Item2: some more text
and more text

I was given a regular expression that may work, but I have not
gotten it to work, since I don't know them very well, but this is
what I was given

Replace(textbox contents,"^Key:.*$","")

Where Key is Item1 or Item2 or Item3

Hopefully this clears it up a little better for everyone as to what
I am trying to do.
"JRD" <si*****@smartidworks.comwrote in message
news:ed**************@TK2MSFTNGP03.phx.gbl...
Greetings,
>
I was wondering if anyone has come across a scenario and like this
and what solution did you use.
>
I have a datagrid that is populated from the database with the
list of drugs and their associated dose and so on.
>
And then I have a single textbox (multiline) that has information
for each drug in the grid. What I would like to be able to do is
that everytime I remove a drug from the Datagrid, that it removes
the associated information on the drug from the text box.
>
Was wondering if anyone has any ideas on how I could accomplished
this using vb.net or if there is a component out there that does
it then that would be great. Thanks.
>
John
>




Dec 20 '06 #6

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

Similar topics

3
by: Stephen | last post by:
I've got a datagrid with a remove button and I would like to add some code in the code behind page so as whenthe button is clicked the corresponding row in the datagrid is removed. The Datagrid is...
3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
1
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...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
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. -- .....
4
by: Jan Nielsen | last post by:
Hi all I'm a former Access developer who would like to implement a many-to-many relation in about the same way you do in Access: With a subform and a combo box. Is it possible to use a...
13
by: pmcguire | last post by:
I have a DataGrid control for which I have also created several new extended DataGridColumnStyles. They behave pretty nicely, but I can't figure out how to implement Selected Item formatting for...
9
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...
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: 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: 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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...

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.