FormView ordinal value

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

How do I know what the ordinal value is in a FormView? For example, a
GridView is 0,1,2,3, etc based on the left-to-right cells. I want to refer
to them in order for a subroutine like example below:

If Convert.ToString(oldValues(0)) <> Convert.ToString(newValues(0))
Then

'Run function in DBClass module to update or create subfile
folder
txtMsg.Text =
DBClass.MaintainSubfolders(Convert.ToString(newValues(0)),
Convert.ToString(oldValues(0)), Convert.ToString(newValues(1)),
Convert.ToString(oldValues(1)), CLng(txtFileNumber.Text))
txtMsg.Visible = True
End If

Thanks.
-David
 
How do I know what the ordinal value is in a FormView?  For example, a
GridView is 0,1,2,3, etc based on the left-to-right cells.  I want to refer
to them in order for a subroutine like example below:

        If Convert.ToString(oldValues(0)) <> Convert.ToString(newValues(0))
Then

            'Run function in DBClass module to update or create subfile
folder
            txtMsg.Text =
DBClass.MaintainSubfolders(Convert.ToString(newValues(0)),
Convert.ToString(oldValues(0)), Convert.ToString(newValues(1)),
Convert.ToString(oldValues(1)), CLng(txtFileNumber.Text))
            txtMsg.Visible = True
        End If

Thanks.
-David

There is no such thing as 'ordinal value' in a FormView. It displays
one record at a time where each field is attached to a bound control
that can only be accessed by name. There are no cells unless you use a
table to lay them out, but that's down to you as the designer.
 
How do I know what the ordinal value is in a FormView? For example, a
GridView is 0,1,2,3, etc based on the left-to-right cells. I want to refer
to them in order for a subroutine like example below:

If Convert.ToString(oldValues(0)) <> Convert.ToString(newValues(0))
Then

'Run function in DBClass module to update or create subfile
folder
txtMsg.Text =
DBClass.MaintainSubfolders(Convert.ToString(newValues(0)),
Convert.ToString(oldValues(0)), Convert.ToString(newValues(1)),
Convert.ToString(oldValues(1)), CLng(txtFileNumber.Text))
txtMsg.Visible = True
End If

Thanks.
-David

There is no such thing as 'ordinal value' in a FormView. It displays
one record at a time where each field is attached to a bound control
that can only be accessed by name. There are no cells unless you use a
table to lay them out, but that's down to you as the designer.

Stan,
So how do I change what I have to work? I want to look at the values in the
underlying table attached to the FormView and if one of the values in a
single control changes, I want to do something after or during the update.
Thanks.

David
 
Stan,
So how do I change what I have to work?  I want to look at the values in the
underlying table attached to the FormView and if one of the values in a
single control changes, I want to do something after or during the update..
Thanks.

David

Difficult to answer this specifically without more information.

In general FormView updates rows of a data table in Edit mode. Changes
to the content of databound controls will be passed automatically to
the underlying data source which will handle the update when a command
button with CommandName="Update" is clicked. Any supplementary code
has to go in the FormView.ItemUpdated or FormView.ItemUpdating event
handlers.
 
Back
Top