I have a simple form with a datagridview editable and a filter for
limiting the contents presented in the grid.
The is a "Save" button in the grid with a cell_click event tied to it.
Problem comes when user puts in a filter and then makes an edit on the
grids contents. For each filter they have generated the loop in the
click event increases by 1. WTF?
// Tests for Save button pressed and acts upon it.
void dgPayerLocations_CellClick(object sender,
DataGridViewCellEventArgs e)
{
string wer = ""; // debug point to count how often.
// Ignore clicks that are not on button cells.
if (e.RowIndex < 0 || e.ColumnIndex !=
dgPayerLocations.Columns[11].Index) return;
saveData(e);
}
The filter will do this:
private void btTextSearch_Click(object sender, EventArgs e)
{
String safe =tbTextSearch.Text;
if (safe.Trim() == "") // Reset the list to full
{
this.pl = null;
this.pl = DataAccess.getCarrTab();
dgPayerLocations.AutoGenerateColumns = false;
dgPayerLocations.DataSource = pl;
removeCols();
addColumns(this.payers);
}
else
{
this.pl = null;
this.pl = DataAccess.getCarrTabFiltered(tbTextSearch.Text);
dgPayerLocations.AutoGenerateColumns = false;
dgPayerLocations.DataSource = pl;
removeCols();
addColumns(this.payers);
}
}
The add columns is pretty verbose. Will supply if desired.
Any ideas?
TIA
--
Stephen Russell
Unified Health Services
60 Germantown Court
Suite 220
Cordova, TN 38018
Telephone: 888.510.2667
901.246-0159 cell
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.