Fill Method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My question, is there a way to get a data field after moving to the next
record? I need the key field???

private void Next_Click(object sender, System.EventArgs e)
{
this.BindingContext[dsAnimal1, "animal-info"].Position += 1;

If possible please help.
 
this.BindingContext[dsAnimal1, "animal-info"].Current will give you current
DataRowView.
 
Miha, thanks so much for your help. I tried your example and it will not
compile. The message basiclly is I can only "add, increment, decrement and
new". I cannot find a place to read about how to code this. can you point me
in the right direction.

this.BindingContext[dsAnimal1, "animal-info"].Current;

--
Norm Bohana


Miha Markic said:
this.BindingContext[dsAnimal1, "animal-info"].Current will give you current
DataRowView.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/


nbohana said:
My question, is there a way to get a data field after moving to the next
record? I need the key field???

private void Next_Click(object sender, System.EventArgs e)
{
this.BindingContext[dsAnimal1, "animal-info"].Position += 1;

If possible please help.
 
Hi there,

DataRowView rv = (DataRowView)this.BindingContext[dsAnimal1,
"animal-info"].Current;
DataRow r = rv.Row;

This will give you the source row.
OK?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

nbohana said:
Miha, thanks so much for your help. I tried your example and it will not
compile. The message basiclly is I can only "add, increment, decrement
and
new". I cannot find a place to read about how to code this. can you point
me
in the right direction.

this.BindingContext[dsAnimal1, "animal-info"].Current;

--
Norm Bohana


Miha Markic said:
this.BindingContext[dsAnimal1, "animal-info"].Current will give you
current
DataRowView.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/


nbohana said:
My question, is there a way to get a data field after moving to the
next
record? I need the key field???

private void Next_Click(object sender, System.EventArgs e)
{
this.BindingContext[dsAnimal1, "animal-info"].Position += 1;

If possible please help.
 
Thanks!!
--
Norm Bohana


Miha Markic said:
Hi there,

DataRowView rv = (DataRowView)this.BindingContext[dsAnimal1,
"animal-info"].Current;
DataRow r = rv.Row;

This will give you the source row.
OK?

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

nbohana said:
Miha, thanks so much for your help. I tried your example and it will not
compile. The message basiclly is I can only "add, increment, decrement
and
new". I cannot find a place to read about how to code this. can you point
me
in the right direction.

this.BindingContext[dsAnimal1, "animal-info"].Current;

--
Norm Bohana


Miha Markic said:
this.BindingContext[dsAnimal1, "animal-info"].Current will give you
current
DataRowView.

--
Miha Markic [MVP C#]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/


My question, is there a way to get a data field after moving to the
next
record? I need the key field???

private void Next_Click(object sender, System.EventArgs e)
{
this.BindingContext[dsAnimal1, "animal-info"].Position += 1;

If possible please help.
 
Back
Top