DataGrid and text box

  • Thread starter Thread starter JRD
  • Start date Start date
J

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
 
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.
 
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.
--------------------------
 
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.
 
Back
Top