Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Winform cell_click event acts strange

SRussSRuss Member Posts: 1
Form has a filter option at top and an editable grid with a save button.

Standard stuff to test for Did they click the button in the grid?

// Tests for Save button pressed and acts upon it.
void dgPayerLocations_CellClick(object sender, DataGridViewCellEventArgs e)
{
string wer = ""; // test to get cycle count
// Ignore clicks that are not on button cells.
if (e.RowIndex < 0 || e.ColumnIndex !=
dgPayerLocations.Columns[11].Index) return;



Works all the time.

My filter setup is straight forward.

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);
}

}

When I use a filter I will loop through the cell_click event for each time I have changed the filter?

I use no filters, one on time through cell_click event.

Identify first filter and I cycle through the cell_click event twice. ??????

Change filters 5,6,7 times and I will cycle through this a lot! WHY?


Anyone have a heads up on this?



TIA



Sign In or Register to comment.