I want to add row in my datagrid based on data that i fill in textbox. the display from page is just like this.
How can I possible to add row of datagrid based on data that i fill to textbox dynamically? Thanks
I want to add row in my datagrid based on data that i fill in textbox. the display from page is just like this.
How can I possible to add row of datagrid based on data that i fill to textbox dynamically? Thanks
Try something like this. Using textchanged event. http://www.dotnetperls.com/textchanged
void textBox1_TextChanged(object sender, EventArgs e)
{
PopulateGrid(textBox1.Text);
}
void PopulateGrid(string queryStr)
{
dataGridView1.DataSource = _journal.GetSearchResults(queryStr);
SetStatus(dataGridView1.Rows.Count); // Change status bar (not shown)
}
You can substitute the _journal.GetSearchResults(querystr) to just adding a datarow to a datatable then binding to the datasource. You should get the general concept.