FormView ordinal value

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
 
S

Stan

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.
 
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

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
 
S

Stan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top