Whats it for ?

J

Jim

On a Windows form in C# I add a query to a TableAdapter. A toolStrip a added
to the form. What can I do with the toolStrip ? What are some common usages
? Is there some documantation about QueryToolStrips ?
Thanks in advance for your help,
Jim
 
T

tDog

Hey Jim

It's there to help users of your form search through data.

What I usually do is hide the the toolstrip, attach it to a combo box event
and use it to update a datagrid whenever the combo box is used to select a
record: snippet code below (just substitute the names).

private void comboBox1_SelectedIndexChanged(object sender, EventArgs
e)
{
try
{
dataGridView1.DataSource =
vwTSARTransactionBindingSource;
thisTSARIDToolStripTextBox.Text = comboBox1.Text;
fillByToolStripButton1.PerformClick();
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}

}
//=========================
private void fillByToolStripButton1_Click(object sender, EventArgs
e)
{
try
{
this.vwTSARTransactionTableAdapter.FillBy(this.dataSet1.vwTSARTransaction,
thisTSARIDToolStripTextBox.Text);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}

//=========================


-tDog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top