navigation bar does not pass to added rows

  • Thread starter Thread starter Yoramo
  • Start date Start date
Y

Yoramo

Hello



I have created a simple application that has a form that displays one
row each time.



I have used the wizard to generate the code.



my problem is that I can not navigate to added rows, I see the count of rows
increasing but the navigation controls refuse to point on them.



Can any one advice?



Yoramo
 
Sure



I have SQL server database with 2 tables that has a FK (foreign key) and I
have created a DataForm on my main table without the secondary table.



Compiled and run.

I can update rows that are in the table but if I press "Add" I see the
counter of rows increases but I can not navigate to it.



Yoramo
 
here is the code VS.Net generated for the next row event
private void btnNavNext_Click(object sender, System.EventArgs e)
{
this.BindingContext[objds1,"Tasks"].Position =
(this.BindingContext[objds1,"Tasks"].Position + 1);
this.objds1_PositionChanged();
}

the Position does not get increment beyond the initial rows, even if i try
to change it in the watch window it goes back immediately.
I can not debug into it, does any one have any suggestions on how to debug
into the "BindingContext" ?

yoramo
 
Hi,

What is your grid bound to?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

yoramo said:
here is the code VS.Net generated for the next row event
private void btnNavNext_Click(object sender, System.EventArgs e)
{
this.BindingContext[objds1,"Tasks"].Position =
(this.BindingContext[objds1,"Tasks"].Position + 1);
this.objds1_PositionChanged();
}

the Position does not get increment beyond the initial rows, even if i try
to change it in the watch window it goes back immediately.
I can not debug into it, does any one have any suggestions on how to debug
into the "BindingContext" ?

yoramo
Yoramo said:
Sure



I have SQL server database with 2 tables that has a FK (foreign key) and I
have created a DataForm on my main table without the secondary table.



Compiled and run.

I can update rows that are in the table but if I press "Add" I see the
counter of rows increases but I can not navigate to it.



Yoramo





displays
one
 
I do not have a grid, I have only a DataForm.


Miha Markic said:
Hi,

What is your grid bound to?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

yoramo said:
here is the code VS.Net generated for the next row event
private void btnNavNext_Click(object sender, System.EventArgs e)
{
this.BindingContext[objds1,"Tasks"].Position =
(this.BindingContext[objds1,"Tasks"].Position + 1);
this.objds1_PositionChanged();
}

the Position does not get increment beyond the initial rows, even if i try
to change it in the watch window it goes back immediately.
I can not debug into it, does any one have any suggestions on how to debug
into the "BindingContext" ?

yoramo
Yoramo said:
Sure



I have SQL server database with 2 tables that has a FK (foreign key)
and
I count
of
 
I found out that the newly added rows are with NULL values and this causes
exception.

how/where do I initialize the fields?

Yoramo


yoramo said:
I do not have a grid, I have only a DataForm.


Miha Markic said:
Hi,

What is your grid bound to?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

yoramo said:
here is the code VS.Net generated for the next row event
private void btnNavNext_Click(object sender, System.EventArgs e)
{
this.BindingContext[objds1,"Tasks"].Position =
(this.BindingContext[objds1,"Tasks"].Position + 1);
this.objds1_PositionChanged();
}

the Position does not get increment beyond the initial rows, even if i try
to change it in the watch window it goes back immediately.
I can not debug into it, does any one have any suggestions on how to debug
into the "BindingContext" ?

yoramo
Sure



I have SQL server database with 2 tables that has a FK (foreign key)
and
I
have created a DataForm on my main table without the secondary table.



Compiled and run.

I can update rows that are in the table but if I press "Add" I see the
counter of rows increases but I can not navigate to it.



Yoramo





"Miha Markic" <miha at rthand com> wrote in message
Ha, care to share a bit more info/sources?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

Hello



I have created a simple application that has a form that displays
one
row each time.



I have used the wizard to generate the code.



my problem is that I can not navigate to added rows, I see the count
of
rows
increasing but the navigation controls refuse to point on them.



Can any one advice?



Yoramo
 
OK, I think I know where the problem is.
But before, tell me two things:
- what is code behin Add new row?
- what is the code that binds a control to dataset?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

yoramo said:
I do not have a grid, I have only a DataForm.


Miha Markic said:
Hi,

What is your grid bound to?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

yoramo said:
here is the code VS.Net generated for the next row event
private void btnNavNext_Click(object sender, System.EventArgs e)
{
this.BindingContext[objds1,"Tasks"].Position =
(this.BindingContext[objds1,"Tasks"].Position + 1);
this.objds1_PositionChanged();
}

the Position does not get increment beyond the initial rows, even if i try
to change it in the watch window it goes back immediately.
I can not debug into it, does any one have any suggestions on how to debug
into the "BindingContext" ?

yoramo
Sure



I have SQL server database with 2 tables that has a FK (foreign key)
and
I
have created a DataForm on my main table without the secondary table.



Compiled and run.

I can update rows that are in the table but if I press "Add" I see the
counter of rows increases but I can not navigate to it.



Yoramo





"Miha Markic" <miha at rthand com> wrote in message
Ha, care to share a bit more info/sources?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

Hello



I have created a simple application that has a form that displays
one
row each time.



I have used the wizard to generate the code.



my problem is that I can not navigate to added rows, I see the count
of
rows
increasing but the navigation controls refuse to point on them.



Can any one advice?



Yoramo
 
private void btnAdd_Click(object sender, System.EventArgs e)

{

try

{

// Clear out the current edits

this.BindingContext[objds1,"Tasks"].EndCurrentEdit();

this.BindingContext[objds1,"Tasks"].AddNew();

}

catch (System.Exception eEndEdit)

{

System.Windows.Forms.MessageBox.Show(eEndEdit.Message);

}

this.objds1_PositionChanged();

}




Miha Markic said:
OK, I think I know where the problem is.
But before, tell me two things:
- what is code behin Add new row?
- what is the code that binds a control to dataset?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

yoramo said:
I do not have a grid, I have only a DataForm.


Miha Markic said:
Hi,

What is your grid bound to?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

here is the code VS.Net generated for the next row event
private void btnNavNext_Click(object sender, System.EventArgs e)
{
this.BindingContext[objds1,"Tasks"].Position =
(this.BindingContext[objds1,"Tasks"].Position + 1);
this.objds1_PositionChanged();
}

the Position does not get increment beyond the initial rows, even if
i
try
to change it in the watch window it goes back immediately.
I can not debug into it, does any one have any suggestions on how to debug
into the "BindingContext" ?

yoramo
Sure



I have SQL server database with 2 tables that has a FK (foreign
key)
and
I
have created a DataForm on my main table without the secondary table.



Compiled and run.

I can update rows that are in the table but if I press "Add" I see the
counter of rows increases but I can not navigate to it.



Yoramo





"Miha Markic" <miha at rthand com> wrote in message
Ha, care to share a bit more info/sources?

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

Hello



I have created a simple application that has a form that
displays
one
row each time.



I have used the wizard to generate the code.



my problem is that I can not navigate to added rows, I see the count
of
rows
increasing but the navigation controls refuse to point on them.



Can any one advice?



Yoramo
 
Back
Top