Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Odd behavior in upgrade from 1.1 framework to 2.0

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Blasting Cap - 18 Jul 2007 22:25 GMT
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
Blasting Cap - 20 Jul 2007 15:25 GMT
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

> I had a page that was working in Framework 1.1, that functions
> differently/incorrectly in framework 2.0.
[quoted text clipped - 95 lines]
>
> BC

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.