By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,417 Members | 1,192 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,417 IT Pros & Developers. It's quick & easy.

VS.NET 2005 - lost in translation?

P: n/a
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/...nd_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

Oct 31 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Dave wrote:
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/...nd_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
Oct 31 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.