W
weird0
I am assigning an arrlist to the datasource property of the
datagridview. In short, i want to update the datagridview. But the
moment, i assign it. The application crashes. It does not display the
updated state of the datagridview neither throws any exception. Here
is some of the following code:
public void AddState(string stateName,float Prob) // Add a
new state, to the arrlist
{
StateTable newState = new StateTable();
newState.State = stateName;
newState.Probability = Prob;
statesList.Add(newState);
}
private void button3_Click(object sender, EventArgs e)
{
try
{
int rows = dataGridView1.Rows.Count;
rows--;
n1.AddState("State" + rows.ToString(), 0); // Add a
state to the node
dataGridView1.DataSource = n1.statesList;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Please help
datagridview. In short, i want to update the datagridview. But the
moment, i assign it. The application crashes. It does not display the
updated state of the datagridview neither throws any exception. Here
is some of the following code:
public void AddState(string stateName,float Prob) // Add a
new state, to the arrlist
{
StateTable newState = new StateTable();
newState.State = stateName;
newState.Probability = Prob;
statesList.Add(newState);
}
private void button3_Click(object sender, EventArgs e)
{
try
{
int rows = dataGridView1.Rows.Count;
rows--;
n1.AddState("State" + rows.ToString(), 0); // Add a
state to the node
dataGridView1.DataSource = n1.statesList;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Please help