Skip to content

DataGridView CurrentCell Issue? #1506

Description

@itg-assistant

consystems asked 2018-04-25 09:38:45 UTC

Hello IceTeaGroup

I'm working with a DataGridView with different CellTypes. I added the CellClickEvent to handle wich Cell was clicked.

I placed a DataGridView to a Panel, set up the columns in the property window / columneditor to use every type of possible ColumnType (DataGridViewButtonColumn, DataGridViewCheckBoxColumn and so on).

In codebehind I just used

DataGridViewRow row = new DataGridViewRow();
dataGridView.Rows.Add(row);

to add a DataGridViewRow to the DataGridView.

My ClickEvent looks like this:

 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
DataGridView mainSender = (DataGridView)sender;
MessageBox.Show(mainSender.CurrentCell.GetType().FullName);

}

The issue what I got is, the CurrentCell property isn't updated propabbly. So I click on an ImageCell and get the message output: "Wisej.Web.DataGridViewCell", next I click on a ButtonCell and get the previous clicked: "Wisej.Web.DataGridViewImageCell"

Am I doing something wrong or is it a real issue?

Best regards

Marcel

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is broken or behaving unexpectedly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions