StrataFrame Forum

How do I force a refresh of form controls

http://forum.strataframe.net/Topic19711.aspx

By Marcia G Akins - 9/25/2008

Hi All.

This really should be obvious, but its not. I have a grid on a form and when i change rows, I want the text boxes and other form controls to stay synchronized. Here is the code:

// Synchronize the upper portion in the form when the user

// clicks on a new row in the grid

if (e.RowIndex > -1)

{

boNotes.SeekToPrimaryKey(Convert.ToInt32(grdViewNoteLog.Rows[e.RowIndex].Cells["note_pk"].Value.ToString()));

this.Refresh();

}

The Notes BO is on the corrrect row, because if I click the edit button in the form, the controls all get updated with the correct values.

What do I need to do to handle this programmatically?

Thanks!

By Teddy Jensen - 9/25/2008

Hi Marcia,

I think you shold use navigate instead of seek on your bo. This will update any bound controls.

/Teddy

By Marcia G Akins - 9/25/2008

Teddy Jensen (09/25/2008)
Hi Marcia,

I think you shold use navigate instead of seek on your bo. This will update any bound controls.

That was it - thanks a million. I knew it had to be something simple Smile

By Trent L. Taylor - 9/25/2008

Yup...Teddy is on the job Smile