Odd behavior in upgrade from 1.1 framework to 2.0

B

Blasting Cap

I had a page that was working in Framework 1.1, that functions
differently/incorrectly in framework 2.0.

What happens is that in the old system I had some drill-down
functionality that would display 4 lines that had the first cell as a
hyperlink, and when you selected that item, it would collapse the 4
items to 1 item, and then display the items underneath that one item,
sub categories of Item 1.

I've compared the code between the two, and it is identical.

Here's what happens:

if they select an item and keep drilling down, it performs as described
above, until you get to the final drill-down where there are no more
selections.

The same code in Framework 2.0 functions wrong. The code - and it
happens only on 1 datagrid -

it makes a pass thru the data and returns the correct data, but for some
inexplicable reason, it then does this same code AGAIN.

Sub DataGrid5_Select(ByVal Sender As Object, ByVal E As EventArgs)
Handles DataGrid5.SelectedIndexChanged
MyPage.Text = ""
Item = ""
cmbPO.Visible = False
txtPO.Visible = False
btnSubmit.Visible = False
Button1.Visible = False
lblPO.Visible = False
DGPOClass.Visible = False
SoldTo = ""
ShipTo = ""
DC = ""
txtDGCustomer.Text = ""
DGCustomer.SelectedIndex = -1
DGPOList.Visible = False
DGPOClass.SelectedIndex = -1

If txtDG5.Text = "" Then
txtDG5.Text =
CStr(DataGrid5.DataKeys(DataGrid5.SelectedIndex)).Replace("'", "''")
Customer()
DGPOList.Visible = True
DGPOClass.Visible = True
DGCustomer.Visible = True
Else
DGPOList.Visible = False
DGPOClass.Visible = False
DGBOL.Visible = False
txtDG5.Text = ""
txtDG6.Text = ""
DGCustomer.Visible = False
End If
orderval = 0
shipval = 0
SKU()
End Sub


What happens in the SKU() subroutine is that it re-reads the data and
then re-binds the last sku to datagrid5.

It's supposed to return data like this:

First datagrid
Item1
Item2
Item3
Item4

you select Item2 from above, the screen then has:
Item2
Item2.1
Item2.2
Item2.3

you select item2.1 from above and you get:
Item2
Item2.1
Item2.1.1
Item2.1.2

You select Item2.1.2 and you get
Item2
Item2.1
Item2.1.2
Customerdata (no more drill thru)


What it's doing though is everything except the last step. However,
stepping thru the code, I find that it's returning the right data, it's
just this "extra" call to datagrid5_select that I can't figure out where
it's coming from. As I said, the code for the datagrid & the sub itself
are identical.

Any ideas?

BC
 
B

Blasting Cap

I found the problem.

Originally, the sub on this (and another one in the code) was:

Sub DataGrid5_Select(ByVal Sender As Object, ByVal E As EventArgs)


When the code was converted to Visual Studio 2005 & .net framework 2.0,
that same line of code became:

Sub DataGrid5_Select(ByVal Sender As Object, ByVal E As EventArgs)
Handles DataGrid5.SelectedIndexChanged

which was causing the datagrid5_select to execute twice.

Just an FYI in case someone else hits a similar issue in upgrading to VS
2005.

BC
 

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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top