datarow changing in a detailsview

I have a details view that gets populated when an item is selected in a gridview. I don't know how to minipulate the data I am looking for something along these lines but I know the code is wrong.
Sub CustomersDatailsView_RowDataBound(ByVal sender As Object, ByVal e As DetailsViewRow) Handles evtInfo.ItemCreated
       If e.Cells(15).Text <> "" Then
            e.Cells(9).Text = "(Act) " & e.Cells(15).Text
           e.Cells(9).Text = "(Pln) " & e.Cells(9).Text
        End If
    End Sub

Open in new window

NickMalloySystems LeadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi NickMalloy,

The thing is that DetailsView controls doesn't have RowDataBound event. It has a DataBound event instead and it is similar to RowDataBound.

When you add an event handler for DataBound then you can cast the "sender" object to DetailsView and then find the control in DetailsView that you want to access.

Here is an example:

Private Sub DetailsView1_DataBound(ByVal sender As Object, ByVal e As EventArgs)
        If (CType(sender,DetailsView).CurrentMode = DetailsViewMode.Edit) Then
            Dim ddl As DropDownList = CType(CType(sender,DetailsView).FindContro,DropDownList)
            If (Not (ddl1) Is Nothing) Then
                'execute statements to add the desired data to it
            End If
        End If
    End Sub


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NickMalloySystems LeadAuthor Commented:
What if your not using controls, just basically databound rows or cells. How can you access those to grab the values.
I'm not sure. Maybe you can check the source of your page when it gets rendered and see what will be rendered in place of DetailsView.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.