K
Kunjal Karamshi
I have a peculiar problem. I have a dataset with two
records in it. When I am positioned at the first record
and try to navigate to the second on a form which uses
data binding, the binding manager position does not
change. Any ideas as to what could be happening? Has
anyone else come across this? I will add that if I bind
the same dataset to a datagrid, both records show up
without any exceptions being thrown.
Here is the code for the event handler that I'm using:
private void btnNext_Click(object sender, System.EventArgs
e)
{
BindingManagerBase bmb;
bmb = (BindingManagerBase) this.BindingContext
[dsPolicies,"Table"];
bmb.Position += 1;
UpdateDisplay();
}
private void UpdateDisplay()
{
BindingManagerBase bmb;
bmb = (BindingManagerBase) this.BindingContext
[dsPolicies,"Table"];
this.txtPosition.Text = (bmb.Position + 1).ToString();
this.txtPosition.Text += " of ";
this.txtPosition.Text += bmb.Count.ToString();
}
The Locals window shows that that the dataset has 2
records, the BindingManagerBase has a count of 2 and a
position of 0 which does not seem to change at all.
I hope someone out there can tell me what is going on!
records in it. When I am positioned at the first record
and try to navigate to the second on a form which uses
data binding, the binding manager position does not
change. Any ideas as to what could be happening? Has
anyone else come across this? I will add that if I bind
the same dataset to a datagrid, both records show up
without any exceptions being thrown.
Here is the code for the event handler that I'm using:
private void btnNext_Click(object sender, System.EventArgs
e)
{
BindingManagerBase bmb;
bmb = (BindingManagerBase) this.BindingContext
[dsPolicies,"Table"];
bmb.Position += 1;
UpdateDisplay();
}
private void UpdateDisplay()
{
BindingManagerBase bmb;
bmb = (BindingManagerBase) this.BindingContext
[dsPolicies,"Table"];
this.txtPosition.Text = (bmb.Position + 1).ToString();
this.txtPosition.Text += " of ";
this.txtPosition.Text += bmb.Count.ToString();
}
The Locals window shows that that the dataset has 2
records, the BindingManagerBase has a count of 2 and a
position of 0 which does not seem to change at all.
I hope someone out there can tell me what is going on!