TriggerHappyMoron
TriggerHappyMoron

Reputation: 65

How to reflect text from a text box to a datagrid

How can i write a program that reflects a text that is in a text box to a data grid? Ex: You write something in a textbox (textBoxURL.Text) and it automatically reflects the text to a datagrid (row.URL).

Here is a piece of my code:

DsVersions.ASSEMBLY2Row row = dsVersions.ASSEMBLY2.NewASSEMBLY2Row();
row.URL = textBoxURL.Text;

If any question (Not clear, not enough detail, more code, confusing) please comment.

Upvotes: 1

Views: 194

Answers (2)

Baked Potato
Baked Potato

Reputation: 294

private void textBoxURL_TextChanged(object sender, EventArgs e)
    {
        try
        {
            foreach (DsVersions.ASSEMBLY2Row row in dsVersions.ASSEMBLY2.Rows)
            {
                row.URL = textBoxURL.Text;
            }
        }
        catch
        {

        }
    }

Give that a try...

Upvotes: 1

DROP TABLE users
DROP TABLE users

Reputation: 1955

Might be a little simple, but I'll throw this out there.

On the keypress or keydown event for the text box, change the value in the data grid(cell I'm guessing) to the textbox.text.

Upvotes: 0

Related Questions