VS.NET 2005 - lost in translation?

D

Dave

Hi folks - extremely new to this, so I've been hunting up online
example to allow me to create a simple web front end to a SQL DB. I
was doing well with a demo but I'm stuck and I'm not sure of the next
step. This is the example in question:
http://www.wherecanibuyit.co.uk/ASP/advanced_gridview_with_edit_and_insert.html

Under "Adding a new row to the gridview" I seem to have fallen down
making the Multiview work. His example is C# and I'm working in VB, so
either I'm just 100% missing the point, or I've translated something
wrong.

Short version:
Gridview pulling from SQL
Multiview
- view 0 - an "add new entry" button
- view 1 - a detail view that allows adding a new entry, or editing an
existing one; when 'save' is clicked it should return to view "0" - but
does not.

These are the procedures. The first one works - when the button is
clicked, it activates view "1" so you can see a Detail View, allowing
adding a new record. But all the others fails - when I 'save' the new
record it does not come back to view "0", nor does it open view "1"
when I click the edit link on the Gridview. I'm hoping this is enough
to show what I'm missing - any tip appreciated.

'When 'add new' button clicked, display the second view
Protected Sub btnAddNewClient_Click(ByVal sender As Object, ByVal e
As System.EventArgs) Handles btnAddNewClient.Click
MultiView1.ActiveViewIndex = 1
End Sub

'When 'save' button clicked, display the first view
Protected Sub dvAddEditClient_ItemInserted(ByVal sender As Object,
ByVal e As DetailsViewInsertedEventArgs)
gvAddEditClient.DataBind()
MultiView1.ActiveViewIndex = 0
End Sub

'When 'cancel' button clicked, display the first view
Protected Sub dvAddEditClient_ItemCommand(ByVal sender As Object,
ByVal e As DetailsViewCommandEventArgs)
gvAddEditClient.DataBind()
MultiView1.ActiveViewIndex = 0
End Sub

'When 'edit' is chosen in Grid View, open in Detail View
Protected Sub gvAddEditClient_SelectedIndexChanged(ByVal sender As
Object, ByVal e As EventArgs)
If gvAddEditClient.SelectedRow.RowIndex >= 0 Then
dvAddEditClient.DataBind()
MultiView1.ActiveViewIndex = 1
End If
End Sub
 
A

aaron.kempf

yeah sorry.. MS screwed us VB developers by putting all of their
efforts into C# instead of VB.

I guess that the worlds richest software company doesn't have $$ to
provide samples in the worlds most popular language lol

Don't mean to sound negative; but im still pissed off --- daily-- and I
refuse to wear the flag for C#

half a million java dorks _CAN_ be wrong

-Aaron
 

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

Top