Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datagrid DoItemUpdate and DoItemCancel won't work

Status
Not open for further replies.

threeo

Programmer
Mar 31, 2005
49
US
this is driving me cuckoo......

i have a datagrid which has an "edit", "update" and "cancel" set up like this:

<asp:datagrid id=dgNormTypes runat="server" DataSource="<%# DataSet61 %>" AutoGenerateColumns="False" DataKeyField="NORM_TYPE" Width="60%" OnUpdateCommand="DoItemUpdate" OnEditCommand="DoItemEdit" OnCancelCommand="DoItemCancel">
<ItemStyle Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699" BackColor="#E0E0E0"></ItemStyle>
<HeaderStyle Font-Size="9pt" Font-Names="Tahoma" Font-Bold="True" Wrap="False" ForeColor="White"
BackColor="#006699"></HeaderStyle>
<Columns>
<asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" />
" runat="server">etc.....

then i have the corresponding 3 subroutines "DoItemCancel", "DoItemEdit" and "DoItemUpdate"

for some reason......the DoItemCancel and DoItemUpdate subroutines never execute their code. the DoItemEdit does just fine. i can even just make DoItemUpdate have a single response.write("hello") and it never gets written to the page. i can tell that all three do a postback but no matter what.....the code within DoItemUpdate and DoItemCancel never execute.

here is my doitemedit code (it works fine)

Sub DoItemEdit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
' get a reference to the DataGrid control in this row
Dim oRow As DataListItem = dlOperations.Items(dlOperations.SelectedIndex)
Dim oGrid As DataGrid = CType(oRow.FindControl("dgNormTypes"), DataGrid)

' set the EditItemIndex of the grid to this item's index
oGrid.EditItemIndex = e.Item.ItemIndex
' bind grid to display row in new mode
' get CustomerID from the DataKeys collection of the DataList
oGrid.DataSource = DataSet61
oGrid.DataBind()
End Sub

my doitemupdate and doitemcancel i have currently reduced to a simple response.write("update") and response.write("cancel") - just to see them work but......nothing happens at all.


anyone have any ideas as to why?

threeo
 
would you post all your datagrid's columns code?
 
here's both subroutines:
Sub DoItemEdit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)Handles dgNormTypes.EditCommand
' get a reference to the DataGrid control in this row
Dim oRow As DataListItem = dlOperations.Items(dlOperations.SelectedIndex)
Dim oGrid As DataGrid = CType(oRow.FindControl("dgNormTypes"), DataGrid)

' set the EditItemIndex of the grid to this item's index
oGrid.EditItemIndex = e.Item.ItemIndex
' bind grid to display row in new mode
' get CustomerID from the DataKeys collection of the DataList

oGrid.DataSource = DataSet61
oGrid.DataBind()
lblRecordCount.Visible = True
lblRecordCount.Text = CStr(CInt(lblRecordCount.Text) + 1)

End Sub


Sub DoItemUpdate(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Handles dgNormTypes.UpdateCommand
Dim oRow As DataListItem = dlOperations.Items(dlOperations.SelectedIndex)

Dim oGrid As DataGrid = CType(oRow.FindControl("dgNormTypes"), DataGrid)
oGrid.EditItemIndex = e.Item.ItemIndex

' get a reference to the text boxes
Dim oResults As TextBox = CType(e.Item.FindControl("txtResults"), TextBox)
'set EditItemIndex of grid to -1 to switch out of Edit mode
oGrid.EditItemIndex = -1
oGrid.DataSource = DataSet121
oGrid.DataBind()
End Sub


and here's the code that calls each:
<asp:datagrid id=dgNormTypes runat="server"
DataSource="<%# DataSet61 %>"
AutoGenerateColumns="False"
DataKeyField="NORM_TYPE" Width="60%" OnUpdateCommand="DoItemUpdate"
OnEditCommand="DoItemEdit"
OnCancelCommand="DoItemCancel">

<ItemStyle Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699" BackColor="#E0E0E0"></ItemStyle>

<HeaderStyle Font-Size="9pt" Font-Names="Tahoma" Font-Bold="True" Wrap="False" ForeColor="White"
Color="#006699"></HeaderStyle>
<Columns>
<asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" />

<asp:BoundColumn DataField="NORM_TYPE" SortExpression="NORM_TYPE" ReadOnly="True" HeaderText="NormType"></asp:BoundColumn>

<asp:BoundColumn DataField="DESCRIPTION" SortExpression="DESCRIPTION" ReadOnly="True" HeaderText="Description"></asp:BoundColumn>

<asp:TemplateColumn HeaderText="Results" ItemStyle-HorizontalAlign="Right">

<ItemTemplate>
<%# Container.DataItem("TempResults") %>
</ItemTemplate>

<EditItemTemplate>
<asp:TextBox Columns="4" id="txtResults" Font-Name="Tahoma" Font-Size="9pt" ForeColor="#006699" runat="server" Text='<%# Container.DataItem("TempResults") %>' />
</EditItemTemplate>
</asp:TemplateColumn>

</Columns>
</asp:datagrid>
 
bottom line is this:

what in the world would cause the "Update" link to execute the DoItemEdit subroutine???? (the "Edit" link also executes the DoItemEdit subroutine)

the Update link is calling the wrong subroutine yet it is clearly defined in the datagrid:

<asp:datagrid id=dgNormTypes runat="server" DataSource="<%# DataSet61 %>"
AutoGenerateColumns="False"
DataKeyField="NORM_TYPE"
Width="60%"
OnEditCommand="DoItemEdit"
OnUpdateCommand="DoItemUpdate" OnCancelCommand="DoItemCancel">
 
I tried your code, and here's what I did to make it work:
-- notice I removed the "handles...", and I only bind the datagrid when it's not a postback in Page_Load.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not IsPostBack Then
DataGrid1.DataSource = theSource
DataGrid1.DataBind()
End If

End Sub


Sub DoItemEdit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

DataGrid1.EditItemIndex = e.Item.ItemIndex
DataGrid1.DataSource = theSource
DataGrid1.DataBind()

End Sub


Sub DoItemUpdate(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

End Sub

Sub DoItemCancel(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

End Sub
 
this is a bit confusing.....
in every example i have found on the internet...
they rebind the grid in the doitemedit,doitemupdate and doitemcancel

you suggested only doing a bind in the page load when it is not a postback - which means it will only bind during an initial page load when the dataset isn't available yet as the input parameters haven't been inputted by the user.

the user first says "choose such and such data" and then the datagrid is created based on their selections.

also...
you suggested only binding on a page load, non-postback....
but in your code, you are binding in the doitemedit
 
What I meant was, you can bind wherever you want, except in the Page_Load where it should only be done if it's not a postback, because the Page_Load will always get called before your DoItemEdit, DoItemUpdate and DoItemCancel.
 
yes. i do not bind on postbacks. i only bind in the individual onitemedit,onitemupdate and onitemcancel subroutines.

this problem is really driving me crazy. i am on my third day of debugging it and getting nowhere. everything works perfectly....
i can click an item in my list and it opens up the datagrid subitems and each subitem has an "edit" next to it. i can click "edit" and the subitem now has an "update" "cancel" and the data to be edited now appears in a textbox so the user can change it. but the mysterious part is this:

click "update" and the DoItemEdit subroutine runs. not the DoItemUpdate. no matter what i do. and the other mystery is that i have NO CODE in the DoItemCancel subroutine yet when i click "Cancel" - the item closes back up and replaces the "Update" and "Cancel" with the original "Edit", and the textbox is now gone and the value remains unchanged. just what i want it to do (but HOW is it doing that with NO CODE?)

 
I would suggest putting breakpoints in your code to see what happens, and which function gets called by which user action.
 
i think 1 big clue to my problem is:

neither the DoItemUpdate or the the DoItemCancel ever get executed. SOMETHING happens......
in the case of the "Update" being clicked...the DoItemEdit gets executed and the "Edit" and the "Update" are both at position 0 in the control.
in the case of the "Cancel" it acts almost like it is just doing a postback

????

 
well....
i tried putting another datagrid on my page and setting it up to do edits and exactly the same thing happens...

clicking "update" takes me to the "DoItemEdit" subroutine.

i'd like to put breaks in to see what happens when the user clicks "Update" - but not sure how i can put a break on the "Update" text
 
yep.

and when i do a response.write e.commandname inside DoItemEdit i get "edit"

and when i click "Update"

"edit" writes out again!

 
here it is:

<form id="Form1" method="post" runat="server">
<asp:label id="Label1" style="Z-INDEX: 101; LEFT: 16px; POSITION: absolute; TOP: 8px" runat="server"
Height="24px" Width="192px" Font-Bold="True" Font-Size="12pt" Font-Names="Tahoma" ForeColor="#006699">Quality Data Collection</asp:label>
<TABLE id="Table1" style="Z-INDEX: 102; LEFT: 64px; WIDTH: 601px; POSITION: absolute; TOP: 48px; HEIGHT: 495px"
cellSpacing="1" cellPadding="1" border="0">
<TR>
<td style="HEIGHT: 22px">
<table border="0">
<TBODY>
<tr>
<TD style="HEIGHT: 22px" align="right"><asp:label id="lblScanID" runat="server" Width="80px" Font-Bold="True" Font-Size="9pt" Font-Names="Tahoma"
ForeColor="#006699"> Employee ID:</asp:label>&nbsp;
</TD>
<td><asp:textbox id="txtEmployeeID" runat="server" Width="72px" Font-Size="8pt" Font-Names="Tahoma"
ForeColor="#006699" AutoPostBack="True"></asp:textbox>&nbsp;
<asp:label id="lblEmployeeName" runat="server" Width="321px" Font-Bold="True" Font-Size="8pt"
Font-Names="Tahoma" ForeColor="#006699" Visible="False"></asp:label></td>
</td>
</TR>
<TR>
<TD style="HEIGHT: 22px" align="right"><asp:label id="lblScanTote" runat="server" Width="32px" Font-Bold="True" Font-Size="9pt" Font-Names="Tahoma"
ForeColor="#006699" Visible="False">SO/REL:</asp:label>&nbsp;
</TD>
<td><asp:textbox id="txtSOREL" runat="server" Width="72px" Font-Size="8pt" Font-Names="Tahoma" ForeColor="#006699"
AutoPostBack="True" Visible="False"></asp:textbox></td>
</TR>
<TR>
<TD style="HEIGHT: 22px" align="right"><asp:label id="lblToteLabel" runat="server" Width="32px" Font-Bold="True" Font-Size="9pt" Font-Names="Tahoma"
ForeColor="#006699" Visible="False">Tote:</asp:label>&nbsp;
</TD>
<td><asp:textbox id="txtTote" runat="server" Width="72px" Font-Size="8pt" Font-Names="Tahoma" ForeColor="#006699"
AutoPostBack="True" Visible="False"></asp:textbox></td>
</TR>
</TABLE>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</TD></TR>
<TR>
<TD>&nbsp;
</TD>
</TD>
<TR>
<TD align="center"><asp:label id="lblOrderInfoLabel" runat="server" Width="306px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="#006699" Visible="False">Order Info</asp:label></TD>
</TD>
<TR>
<TD align="center">
<TABLE id="Table2" style="WIDTH: 420px; HEIGHT: 91px" cellSpacing="0" cellPadding="0" width="352"
border="0">
<TR>
<TD align="right"><asp:label id="lblCustomerLabel" runat="server" Width="67px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="#006699" Visible="False">Customer:</asp:label></TD>
<TD style="WIDTH: 276px"><asp:label id="lblCustomer" runat="server" Height="5px" Width="272px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="White" Visible="False" BackColor="#006699"></asp:label></TD>
</TR>
<TR>
<TD align="right"><asp:label id="lblCustomerPOLabel" runat="server" Width="97px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="#006699" Visible="False">Customer PO:</asp:label></TD>
<TD style="WIDTH: 276px"><asp:label id="lblCustomerPO" runat="server" Width="272px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="White" Visible="False" BackColor="#006699"></asp:label></TD>
</TR>
<TR>
<TD align="right"><asp:label id="lblCustomerOrderLabel" runat="server" Width="104px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="#006699" Visible="False">Customer Order:</asp:label></TD>
<TD style="WIDTH: 325px"><asp:label id="lblCustomerOrder" runat="server" Width="272px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="White" Visible="False" BackColor="#006699"></asp:label></TD>
</TR>
<TR>
<TD style="HEIGHT: 14px" align="right"><asp:label id="lblPartNumberLabel" runat="server" Font-Bold="True" Font-Size="9pt" Font-Names="Tahoma"
ForeColor="#006699" Visible="False">Part Number:</asp:label></TD>
<TD style="WIDTH: 276px; HEIGHT: 14px"><asp:label id="lblPartNumber" runat="server" Width="272px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="White" Visible="False" BackColor="#006699"></asp:label></TD>
</TR>
<TR>
<TD align="right"><asp:label id="lblDescriptionLabel" runat="server" Font-Bold="True" Font-Size="9pt" Font-Names="Tahoma"
ForeColor="#006699" Visible="False">Part Description:</asp:label></TD>
<TD style="WIDTH: 276px"><asp:label id="lblDescription" runat="server" Width="272px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="White" Visible="False" BackColor="#006699"></asp:label></TD>
</TR>
<TR>
<TD style="HEIGHT: 14px" align="right"><asp:label id="lblQuantityLabel" runat="server" Font-Bold="True" Font-Size="9pt" Font-Names="Tahoma"
ForeColor="#006699" Visible="False">Quantity:</asp:label></TD>
<TD style="WIDTH: 276px; HEIGHT: 14px"><asp:label id="lblQuantity" runat="server" Width="272px" Font-Bold="True" Font-Size="9pt" Font-Names="Tahoma"
ForeColor="White" Visible="False" BackColor="#006699"></asp:label></TD>
</TR>
<TR>
<TD align="right"><asp:label id="lblRevisedDueDateLabel" runat="server" Font-Bold="True" Font-Size="9pt" Font-Names="Tahoma"
ForeColor="#006699" Visible="False">Revised Due Date:</asp:label></TD>
<TD style="WIDTH: 276px"><asp:label id="lblRevisedDueDate" runat="server" Height="10px" Width="272px" Font-Bold="True"
Font-Size="9pt" Font-Names="Tahoma" ForeColor="White" Visible="False" BackColor="#006699"></asp:label></TD>
</TR>
<TR>
<TD align="right"><asp:label id="lblRevisedStartDateLabel" runat="server" Height="5px" Width="140px" Font-Bold="True"
Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699" Visible="False" DESIGNTIMEDRAGDROP="1745">Revised Start Date:</asp:label></TD>
<TD style="WIDTH: 276px"><asp:label id="lblRevisedStartDate" runat="server" Width="272px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="White" Visible="False" BackColor="#006699"></asp:label></TD>
</TR>
</TABLE>
</TD>
</TD>
<TR>
<TD>&nbsp;</TD>
</TD>
<TR>
<TD align="center"><asp:label id="lblMaterialsUsedLabel" runat="server" Width="100px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="#006699" Visible="False">Materials Used</asp:label></TD>
</TR>
<TR>
<TD width="100%"><asp:datagrid id=dgMaterialsUsed runat="server" Width="100%" AutoGenerateColumns="False" DataSource="<%# DataSet41 %>">
<AlternatingItemStyle BackColor="#E0E0E0"></AlternatingItemStyle>
<ItemStyle Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699"></ItemStyle>
<HeaderStyle Font-Size="9pt" Font-Names="Tahoma" Font-Bold="True" ForeColor="White" BackColor="#006699"></HeaderStyle>
<Columns>
<asp:BoundColumn DataField="LINE_SEQUENCE" SortExpression="LINE_SEQUENCE" ReadOnly="True" HeaderText="Item"></asp:BoundColumn>
<asp:BoundColumn DataField="COMPONENT_PART" SortExpression="COMPONENT_PART" ReadOnly="True" HeaderText="COMPONENT PART"></asp:BoundColumn>
<asp:BoundColumn DataField="DESCRIPTION" SortExpression="DESCRIPTION" ReadOnly="True" HeaderText="DESCRIPTION"></asp:BoundColumn>
<asp:BoundColumn DataField="QTY_PER_ASSEMBLY" SortExpression="QTY_PER_ASSEMBLY" ReadOnly="True" HeaderText="QTY REQUIRED"></asp:BoundColumn>
<asp:BoundColumn DataField="PRINT_UNIT" SortExpression="PRINT_UNIT" ReadOnly="True" HeaderText="UNIT MEASURE"></asp:BoundColumn>
</Columns>
</asp:datagrid></TD>
</TR>
<TR>
<TD>&nbsp;</TD>
</TR>
<TR>
<TD align="center"><asp:label id="lblDataCollectionLabel" runat="server" Width="96px" Font-Bold="True" Font-Size="9pt"
Font-Names="Tahoma" ForeColor="#006699" Visible="False">Data Collection</asp:label></TD>
</TR>
<TR>
<TD align="left"><asp:datalist id="dlOperations" runat="server" Height="104px" GridLines="Both" width="100%" OnItemCommand="DoItemSelect"
OnItemDataBound="BindNormTypesGrid" DataKeyField="Operation_No">
<HeaderTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center"><FONT COLOR="#FFFFFF" FACE="Tahoma" SIZE="2"><b>Operation</b></FONT>
</td>
<td align="center"><FONT COLOR="#FFFFFF" FACE="Tahoma" SIZE="2"><b>Work Center</b></FONT>
</td>
</tr>
</table>
</HeaderTemplate>
<AlternatingItemStyle BackColor="#E0E0E0"></AlternatingItemStyle>
<FooterStyle BackColor="#006699"></FooterStyle>
<ItemStyle Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699" BorderStyle="Solid" VerticalAlign="Top"
BackColor="White"></ItemStyle>
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="16px"><FONT COLOR="#006699" FACE="Tahoma" SIZE="2">
<asp:LinkButton CommandName="Select" Width="16" height="15" runat="server" text="View" ID="Linkbutton1"
NAME="Linkbutton1" /></FONT>
</td>
<td width="55px" height="15" align="right"><FONT COLOR="#006699" FACE="Tahoma" SIZE="2">
<%# Container.DataItem("Operation_NO") %>
</FONT>
</td>
<td width="240px" height="15"><FONT COLOR="#006699" FACE="Tahoma" SIZE="2">&nbsp;-
<%# Container.DataItem("Operation_Description") %>
</FONT>
<td>
<td width="85px" height="15" align="right"><FONT COLOR="#006699" FACE="Tahoma" SIZE="2">
<%# Container.DataItem("Work_Center_NO") %>
</FONT>
</td>
<td width="145px" height="15"><FONT COLOR="#006699" FACE="Tahoma" SIZE="2">&nbsp;-
<%# Container.DataItem("Description") %>
</FONT>
</td>
</tr>
</table>
</ItemTemplate>
<SelectedItemTemplate>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="16px"><FONT COLOR="#FFFFFF" FACE="Tahoma" SIZE="2">
<asp:LinkButton CommandName="unSelect" Width="16" height="15" runat="server" text="Close" ID="Linkbutton2"
NAME="Linkbutton2" /></FONT>
</td>
<td width="55px" height="15" align="right" bgcolor="#006699"><FONT COLOR="#FFFFFF" FACE="Tahoma" SIZE="2">
<%# Container.DataItem("Operation_NO") %>
</FONT>
</td>
<td width="240px" height="15" bgcolor="#006699"><FONT COLOR="#FFFFFF" FACE="Tahoma" SIZE="2">&nbsp;-
<%# Container.DataItem("Operation_Description") %>
</FONT>
<td>
<td width="85px" height="15" align="right" bgcolor="#006699"><FONT COLOR="#FFFFFF" FACE="Tahoma" SIZE="2">
<%# Container.DataItem("Work_Center_NO") %>
</FONT>
</td>
<td width="185px" height="15" bgcolor="#006699"><FONT COLOR="#FFFFFF" FACE="Tahoma" SIZE="2">&nbsp;-
<%# Container.DataItem("Description") %>
</FONT>
</td>
</tr>
</table>
<center>
<asp:datagrid id=dgNormTypes runat="server" OnEditCommand="DoItemEdit" OnUpdateCommand="DoItemUpdate" OnCancelCommand="DoItemCancel" DataSource="<%# DataSet61 %>" AutoGenerateColumns="False" DataKeyField="NORM_TYPE" Width="60%">
<ItemStyle Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699" BackColor="#E0E0E0">
</ItemStyle>
<HeaderStyle Font-Size="9pt" Font-Names="Tahoma" Font-Bold="True" Wrap="False" ForeColor="White"
BackColor="#006699">
</HeaderStyle>
<Columns>
<asp:EditCommandColumn EditText="Edit" UpdateText="Update" CancelText="Cancel"/>
<asp:BoundColumn DataField="NORM_TYPE" SortExpression="NORM_TYPE" ReadOnly="True" HeaderText="NormType"></asp:BoundColumn>
<asp:BoundColumn DataField="DESCRIPTION" SortExpression="DESCRIPTION" ReadOnly="True" HeaderText="Description"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Results" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<%# Container.DataItem("TempResults") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox Columns="4" id="txtResults" Font-Name="Tahoma" Font-Size="9pt" ForeColor="#006699" runat="server" Text='<%# Container.DataItem("TempResults") %>' />
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
<asp:datagrid id="dgAttributes" runat="server" DataSource="<%# DataSet81 %>" DataKeyField="RequiredText" AutoGenerateColumns="False" OnEditCommand="DoAttributeEdit" OnUpdateCommand="DoAttributeUpdate" OnCancelCommand="DoAttributeCancel">
<ItemStyle Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699" BackColor="#E0E0E0"></ItemStyle>
<HeaderStyle Font-Size="9pt" Font-Names="Tahoma" Font-Bold="True" Wrap="False" ForeColor="White"
BackColor="#006699"></HeaderStyle>
<Columns>
<asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="Update" />
<asp:BoundColumn DataField="RequiredText" ReadOnly="True" HeaderText="Attribute"></asp:BoundColumn>
<asp:TemplateColumn HeaderText="Value" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<%# Container.DataItem("AttributeValue") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox Columns="20" id="txtAttributeValue" Font-Name="Tahoma" Font-Size="9pt" ForeColor="#006699" runat="server" Text='<%# Container.DataItem("AttributeValue") %>' />
</EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
</center>
</SelectedItemTemplate>
</asp:datalist>
<P></P>
</TD>
</TR>
</TBODY></TABLE><asp:dropdownlist id=lstOpenOrders style="Z-INDEX: 103; LEFT: 360px; POSITION: absolute; TOP: 8px" runat="server" Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699" AutoPostBack="True" Visible="False" DataSource="<%# DataSet11 %>" DataValueField="OPENORDERS" DataTextField="OPENORDERS">
</asp:dropdownlist><asp:label id="lblRecordCount" style="Z-INDEX: 104; LEFT: 264px; POSITION: absolute; TOP: 32px"
runat="server" Width="272px" Font-Size="9pt" Font-Names="Tahoma" ForeColor="#006699" Visible="False">1</asp:label></form>
 
sorry, I wasn't specific enough, would you post the form's server-side code?
 
yes - however....i'm pretty sure the problem happens before i reach any of this...

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not (IsPostBack) Then
OracleDataAdapter1.Fill(DataSet11)
'lstOpenOrders.DataBind()
'lstOpenOrders.Items.Insert(0, "Select Order")
'lblRecordCount.Text = "(There are " & lstOpenOrders.Items.Count - 1 & " Orders Currently Open)"
Else
If txtTote.Text <> "" Then

'when an order is selected, a postback occurs
'using the selected orders info, pull in the details
'reset the dataadpaters select statement
Dim aryOrderInfo() As String
Dim intRoutingRevision As Integer
Dim strOrderID As String
Dim strRelease As String
Dim strPartNumber As String

strOrderID = txtSOREL.Text
strOrderID = Mid(strOrderID, 1, Len(Trim(strOrderID)) - 3)
strRelease = txtSOREL.Text
strRelease = CStr(CInt(Right(strRelease, 3)))

aryOrderInfo = Split(lstOpenOrders.SelectedValue, " ")
DataSet31.Reset()
OracleDataAdapter2.SelectCommand.CommandText = "SELECT pct.DESCRIPTION,cot.CUSTOMER_PO_NO,cit.NAME,dtt.NOTE_TEXT, sot.REVISED_QTY_DUE, sot.REVISED_DUE_DATE, sot.REVISED_START_DATE, sot.ROUTING_REVISION, sot.PART_NO FROM PART_CATALOG_TAB pct, CUSTOMER_ORDER_TAB cot, CUSTOMER_INFO_TAB cit, DOCUMENT_TEXT_TAB dtt, SHOP_ORD_TAB sot WHERE sot.ORDER_NO = '" & strOrderID & "' AND sot.RELEASE_NO = '" & strRelease & "' And dtt.NOTE_ID = sot.NOTE_ID AND dtt.OUTPUT_TYPE = 'SO INFO' AND pct.PART_NO = sot.PART_NO AND cit.CUSTOMER_ID = cot.CUSTOMER_NO AND cot.ORDER_NO IN(SELECT substr(DOCUMENT_TEXT_TAB.NOTE_TEXT,5,(instr(DOCUMENT_TEXT_TAB.NOTE_TEXT,'LINE')-7)) FROM DOCUMENT_TEXT_TAB, SHOP_ORD_TAB WHERE DOCUMENT_TEXT_TAB.NOTE_ID = SHOP_ORD_TAB.NOTE_ID AND UPPER(SHOP_ORD_TAB.ROWSTATE) = 'STARTED' AND SHOP_ORD_TAB.ORDER_NO = '" & strOrderID & "' AND SHOP_ORD_TAB.RELEASE_NO = '" & strRelease & "')"
OracleDataAdapter2.Fill(DataSet31)
'was data found for the order?
If DataSet31.Tables(0).Rows.Count > 0 Then
intRoutingRevision = CInt(DataSet31.Tables(0).Rows(0).Item(7))
strPartNumber = DataSet31.Tables(0).Rows(0).Item(8)
OracleDataAdapter3.SelectCommand.CommandText = "SELECT PS.LINE_SEQUENCE, PS.COMPONENT_PART, PC.DESCRIPTION, PS.QTY_PER_ASSEMBLY, PS.PRINT_UNIT FROM PROD_STRUCTURE PS, PART_CATALOG_TAB PC WHERE PS.COMPONENT_PART = PC.PART_NO AND PS.BOM_TYPE = 'Manufacturing' AND PS.ALTERNATIVE_NO = '*' AND PS.PART_NO = '" & strPartNumber & "' AND PS.ENG_CHG_LEVEL IN (SELECT MAX(eng_chg_level) FROM prod_structure WHERE prod_structure.part_no = '" & strPartNumber & "')"
OracleDataAdapter3.Fill(DataSet41)
OracleDataAdapter4.SelectCommand.CommandText = "SELECT RO.OPERATION_NO, RO.OPERATION_DESCRIPTION, RO.WORK_CENTER_NO, WCT.DESCRIPTION,RO.STD_OPERATION_NAME FROM ROUTING_OPERATION RO, WORK_CENTER_TAB WCT WHERE RO.PART_NO = '" & strPartNumber & "' AND RO.ROUTING_REVISION = " & intRoutingRevision & " AND RO.BOM_TYPE = 'Manufacturing' AND RO.ALTERNATIVE_NO='*' AND RO.WORK_CENTER_NO = WCT.WORK_CENTER_NO ORDER BY OPERATION_NO"
OracleDataAdapter4.Fill(DataSet51)
dgMaterialsUsed.DataBind()
dlOperations.DataSource = DataSet51
dlOperations.DataBind()
'make the display labels visible
lblCustomerLabel.Visible = True
lblCustomerPOLabel.Visible = True
lblCustomerOrderLabel.Visible = True
lblDescriptionLabel.Visible = True
lblPartNumberLabel.Visible = True
lblQuantityLabel.Visible = True
lblRevisedDueDateLabel.Visible = True
lblRevisedStartDateLabel.Visible = True
lblOrderInfoLabel.Text = "Order Info"
lblOrderInfoLabel.Visible = True
lblDataCollectionLabel.Visible = True
'set the display values
lblCustomer.Text = DataSet31.Tables(0).Rows(0).Item(2)
lblCustomerPO.Text = DataSet31.Tables(0).Rows(0).Item(1)
lblCustomerOrder.Text = DataSet31.Tables(0).Rows(0).Item(3)
lblDescription.Text = DataSet31.Tables(0).Rows(0).Item(0)
lblPartNumber.Text = DataSet31.Tables(0).Rows(0).Item(8)
lblQuantity.Text = DataSet31.Tables(0).Rows(0).Item(4)
lblRevisedDueDate.Text = DataSet31.Tables(0).Rows(0).Item(5)
lblRevisedStartDate.Text = DataSet31.Tables(0).Rows(0).Item(6)
'make display values visible
lblCustomer.Visible = True
lblCustomerPO.Visible = True
lblCustomerOrder.Visible = True
lblDescription.Visible = True
lblPartNumber.Visible = True
lblQuantity.Visible = True
lblRevisedDueDate.Visible = True
lblRevisedStartDate.Visible = True
lblMaterialsUsedLabel.Visible = True

'show grids
dgMaterialsUsed.Visible = True
dlOperations.Visible = True

'the quantity field in the materials used grid
'needs to be multiplied by the quantity for this
'order so....
Dim intStepThrough As Integer
For intStepThrough = 0 To dgMaterialsUsed.Items.Count - 1
dgMaterialsUsed.Items(intStepThrough).Cells(3).Text = CStr(CInt(dgMaterialsUsed.Items(intStepThrough).Cells(3).Text) * CInt(lblQuantity.Text))
Next
Else
'a problem has occurred - no data was found for the order
lblOrderInfoLabel.Text = "No Information was found for the Order"
lblOrderInfoLabel.Visible = True
'make labels invisible
lblCustomerLabel.Visible = False
lblCustomerPOLabel.Visible = False
lblCustomerOrderLabel.Visible = False
lblDescriptionLabel.Visible = False
lblPartNumberLabel.Visible = False
lblQuantityLabel.Visible = False
lblRevisedDueDateLabel.Visible = False
lblRevisedStartDateLabel.Visible = False
lblMaterialsUsedLabel.Visible = False
lblDataCollectionLabel.Visible = False

'make display values visible
lblCustomer.Visible = False
lblCustomerPO.Visible = False
lblCustomerOrder.Visible = False
lblDescription.Visible = False
lblPartNumber.Visible = False
lblQuantity.Visible = False
lblRevisedDueDate.Visible = False
lblRevisedStartDate.Visible = False
'reset datasets
DataSet31.Reset()
DataSet41.Reset()
DataSet51.Reset()
DataSet61.Reset()
DataSet71.Reset()
DataSet81.Reset()
'hide grids
dgMaterialsUsed.Visible = False
dlOperations.Visible = False
End If
'Response.Write(OracleDataAdapter2.SelectCommand.CommandText)
'Response.Write(DataSet31.Tables(0).Rows(0).Item(0))
Else
If txtSOREL.Text <> "" Then
If txtTote.Visible = False Then
lblToteLabel.Visible = True
txtTote.Visible = True
End If
End If
End If
End If
End Sub
Sub DoItemSelect(ByVal sender As Object, ByVal e As DataListCommandEventArgs)

' see if it was the Select button that was clicked
If e.CommandName = "Select" Then
' set the SelectedIndex property of the list to this item's index
dlOperations.SelectedIndex = e.Item.ItemIndex
dlOperations.DataSource = DataSet51
dlOperations.DataBind()
End If

' see if it was the Un-Select button that was clicked
If e.CommandName = "unSelect" Then
' set the SelectedIndex property of the list to -1
dlOperations.SelectedIndex = -1
dlOperations.DataSource = DataSet51
dlOperations.DataBind()

End If

End Sub
Sub DoItemEdit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Handles dgNormTypes.EditCommand
' get a reference to the DataGrid control in this row
Dim oRow As DataListItem = dlOperations.Items(dlOperations.SelectedIndex)
Dim oGrid As DataGrid = CType(oRow.FindControl("dgNormTypes"), DataGrid)

' set the EditItemIndex of the grid to this item's index
oGrid.EditItemIndex = e.Item.ItemIndex
' bind grid to display row in new mode
' get CustomerID from the DataKeys collection of the DataList
oGrid.DataSource = DataSet61
oGrid.DataBind()
lblRecordCount.Visible = True
lblRecordCount.Text = CStr(CInt(lblRecordCount.Text) + 1)
Response.Write(e.CommandName)
End Sub
Sub DoItemUpdate(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) Handles dgNormTypes.UpdateCommand
'first, determine if the original data came from IFS or
'from the sql stakqmanscanned table. this will determine
'whether this is an update to IFS, an update to sql,
'or an insertion to sql
'dataset91 has the data from stakqmanscanned
'dataset 121 has the data from IFS
'first, see if there is an entry in stakqmanscanned
'if there is, update it and get out
'otherwise, see if there is an entry in IFS
'if there is, update it and get out
'otherwise, do an insert into stakqmanscanned
Dim intExecuteResult As Integer = 0
' get a reference to the DataGrid control in this row
Dim oRow As DataListItem = dlOperations.Items(dlOperations.SelectedIndex)
Dim oGrid As DataGrid = CType(oRow.FindControl("dgNormTypes"), DataGrid)
If DataSet91.Tables(0).Rows.Count > 0 Then
'we have data in the stakqmanscanned so,
'update it now

' set the EditItemIndex of the grid to this item's index
oGrid.EditItemIndex = e.Item.ItemIndex

' get a reference to the text boxes
Dim oResults As TextBox = CType(e.Item.FindControl("txtResults"), TextBox)
Response.Write(oResults.Text)
ElseIf DataSet121.Tables(0).Rows.Count > 0 Then
'we have data in the IFS so,
'update it now

' set the EditItemIndex of the grid to this item's index
oGrid.EditItemIndex = e.Item.ItemIndex

' get a reference to the text boxes
Dim oResults As TextBox = CType(e.Item.FindControl("txtResults"), TextBox)
Response.Write(oResults.Text)
OracleUpdateAnalysisNormTab.CommandText = ""
OracleUpdateAnalysisNormTab.CommandText = "update analysis_norm_tab set non_conforms = " & oResults.Text & " where analysis_no = " & DataSet121.Tables(0).Rows(0).Item(2)
intExecuteResult = OracleUpdateAnalysisNormTab.ExecuteNonQuery()
Response.Write(intExecuteResult)

Else
'do insert
End If
If intExecuteResult = 1 Then

Else
End If
' set EditItemIndex of grid to -1 to switch out of Edit mode
oGrid.EditItemIndex = -1
oGrid.DataSource = DataSet121
oGrid.DataBind()
Response.Write("<br>" & DataSet121.Tables(0).Rows(0).Item(3))
End Sub
Sub DoItemCancel(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
Response.Write("cancel")
End Sub
Sub DoAttributeEdit(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
' get a reference to the DataGrid control in this row
Dim oRow As DataListItem = dlOperations.Items(dlOperations.SelectedIndex)
Dim oGrid As DataGrid = CType(oRow.FindControl("dgAttributes"), DataGrid)
' set the EditItemIndex of the grid to this item's index
oGrid.EditItemIndex = e.Item.ItemIndex
' bind grid to display row in new mode
' get CustomerID from the DataKeys collection of the DataList
oGrid.DataSource = DataSet81
oGrid.DataBind()
Response.Write("attributeedit")
End Sub
Sub DoAttributeUpdate(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

End Sub
Sub DoAttributeCancel(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)

' get a reference to the DataGrid control in this row
'Dim oGrid As DataGrid = GetDataGridRef()

' set EditItemIndex of grid to -1 to switch out of Edit mode
'oGrid.EditItemIndex = -1

' bind grid to display row in new mode
' get CustomerID from the DataKeys collection of the DataList
'oGrid.DataSource = GetOrders(dtl1.DataKeys(dtl1.SelectedIndex))
'oGrid.DataBind()
Response.Write("attributeupdate")

End Sub

Sub BindNormTypesGrid(ByVal sender As Object, ByVal e As DataListItemEventArgs)

' see what type of row (header, footer, item, etc.) caused the event
Dim oType As ListItemType = CType(e.Item.ItemType, ListItemType)

' only process it if it's the Selected row
If oType = ListItemType.SelectedItem And dlOperations.SelectedIndex <> -1 Then
' get value of operation id for this row from DataKeys collection
Dim strOrderID As String
Dim strRelease As String
Dim strPartNumber As String

strPartNumber = lblPartNumber.Text
strOrderID = txtSOREL.Text
strOrderID = Mid(strOrderID, 1, Len(Trim(strOrderID)) - 3)
strRelease = txtSOREL.Text
strRelease = CStr(CInt(Right(strRelease, 3)))

Dim sKey As String = dlOperations.DataKeys(e.Item.ItemIndex)
'sKey will hold the operation id

' get a reference to the DataGrid control in this row
Dim oGrid As DataGrid = CType(e.Item.FindControl("dgNormTypes"), DataGrid)
'x and y are used as indexes to step through datasets
Dim x As Integer
Dim y As Integer

'set the dataadapter select statement
'(for some reason, the select statement was sometimes
'duplicating itself and producing two identical
'sets of data - that is the reason for the following
'2 lines)
DataSet61.Reset()
OracleDataAdapter5.SelectCommand.CommandText = ""
OracleDataAdapter5.SelectCommand.CommandText = "SELECT QCPLT.NORM_TYPE,QCPLT.CONTROL_PLAN_NO,QCPLT.CTRL_PLAN_REVISION_NO,QCPLT.DATA_POINT,NTT.DESCRIPTION,'0' AS TempResults FROM QMAN_CONTROL_PLAN_LINE_TAB QCPLT, NORM_TYPE_TAB NTT WHERE QCPLT.NORM_TYPE = NTT.NORM_TYPE AND UPPER(SUBSTR(NTT.DESCRIPTION,1,14)) <> 'RESERVED BY QE' AND (QCPLT.CONTROL_PLAN_NO IN (SELECT control_plan_no FROM qman_ctrl_plan_shop_order WHERE order_no = '" & strOrderID & "' AND release_no = " & strRelease & ")) AND (QCPLT.ROUTING_OPERATION_NO = '" & sKey & "') AND (QCPLT.CTRL_PLAN_REVISION_NO IN (SELECT ctrl_plan_revision_no FROM qman_ctrl_plan_shop_order WHERE order_no = '" & strOrderID & "' AND release_no = " & strRelease & "))"
'Response.Write(OracleDataAdapter5.SelectCommand.CommandText)
OracleDataAdapter5.Fill(DataSet61)

'okay...here begins a critical piece of logic.
'we dont want the user to see zeros for
'each norm type everytime they enter this screen.
'otherwise, the user could make some data collection
'entries, close the norm type, reopen it again and
'it would be back to zero. so....we need to query the
'stakqmanscanned table AND the stakqmanscannedlog table
'and if any recent entires exist for these norm types,
'we need to incorporate them here (determine which one
'is most recent)

'first check IFS
DataSet121.Reset()
OracleDataAdapter7.SelectCommand.CommandText = ""
OracleDataAdapter7.SelectCommand.CommandText = "SELECT AN.NORM_TYPE, AN.DATA_POINT,AN.ANALYSIS_NO, AN.NON_CONFORMS FROM ANALYSIS_NORM_TAB AN, ANALYSIS_OPERATION_TAB AO WHERE AN.ANALYSIS_NO = AO.ANALYSIS_NO AND TO_CHAR(AN.DATA_POINT * 10) = AO.TEST_OPERATION_NO AND (AN.DATA_POINT = " & DataSet61.Tables(0).Rows(0).Item(3) & ") AND (AN.NORM_TYPE = " & DataSet61.Tables(0).Rows(0).Item(0) & ") AND (AN.ANALYSIS_NO IN (SELECT analysis_no FROM analysis_tab WHERE part_no = '" & Trim(lblPartNumber.Text) & "' AND order_no = '" & Mid(Trim(txtSOREL.Text), 1, 5) & "' AND release_no = '" & strRelease & "' AND operation_no = " & sKey & " AND control_plan_no = " & DataSet61.Tables(0).Rows(0).Item(1) & " AND ctrl_plan_revision_no = " & DataSet61.Tables(0).Rows(0).Item(2) & " AND work_center_no = " & DataSet51.Tables(0).Rows(dlOperations.SelectedIndex).Item(2) & ")) AND (AN.NOTE_TEXT LIKE '%" & txtTote.Text & "%')"
'Response.Write(OracleDataAdapter7.SelectCommand.CommandText)
OracleDataAdapter7.Fill(DataSet121)


'now check stakqmanscanned
DataSet91.Reset()
SqlDataAdapter3.SelectCommand.CommandText = ""
SqlDataAdapter3.SelectCommand.CommandText = "SELECT * FROM stakQmanScanned WHERE (shop_order = '10228') AND (release_no = 12) AND Attributes like '%TOTE E%'"
SqlDataAdapter3.Fill(DataSet91)


'since stakqmanscanned has more recent data than
'IFS, do IFS first
If DataSet121.Tables(0).Rows.Count > 0 And DataSet61.Tables(0).Rows.Count > 0 Then
'have to iterate through the rows of this dataset
'and compare any entries with the normtypes in
'the normtypes dataset and if there is a match,
'replace the normtypes amount with the number in
'this dataset
For x = 0 To DataSet61.Tables(0).Rows.Count - 1
For y = 0 To DataSet121.Tables(0).Rows.Count - 1
If DataSet61.Tables(0).Rows(x).Item(0) = DataSet121.Tables(0).Rows(y).Item(0) And DataSet61.Tables(0).Rows(x).Item(3) = DataSet121.Tables(0).Rows(y).Item(1) Then
DataSet61.Tables(0).Rows(x).Item(5) = DataSet121.Tables(0).Rows(y).Item(3)
End If
Next y
Next x
End If

'now check stakqmanscannedlog
If DataSet91.Tables(0).Rows.Count > 0 And DataSet61.Tables(0).Rows.Count > 0 Then
'have to iterate through the rows of this dataset
'and compare any entries with the normtypes in
'the normtypes dataset and if there is a match,
'replace the normtypes amount with the number in
'this dataset
For x = 0 To DataSet61.Tables(0).Rows.Count - 1
For y = 0 To DataSet91.Tables(0).Rows.Count - 1
If DataSet61.Tables(0).Rows(x).Item(0) = DataSet91.Tables(0).Rows(y).Item(6) And DataSet61.Tables(0).Rows(x).Item(3) = DataSet91.Tables(0).Rows(y).Item(5) Then
DataSet61.Tables(0).Rows(x).Item(5) = DataSet91.Tables(0).Rows(y).Item(7)
End If
Next y
Next x
End If


' bind nested "norm types" DataGrid to DataReader
'Response.Write(OracleDataAdapter5.SelectCommand.CommandText)
oGrid.DataSource = DataSet61
oGrid.DataBind()
If DataSet61.Tables(0).Rows.Count > 0 Then
oGrid.Visible = True
Else
oGrid.Visible = False
End If
'control plan number:
'Response.Write(DataSet61.Tables(0).Rows(0).Item(2))
'control plan revision:
'Response.Write(DataSet61.Tables(0).Rows(0).Item(3))
Dim oGrid2 As DataGrid = CType(e.Item.FindControl("dgAttributes"), DataGrid)
'grab the standard text data
'SqlDataAdapter2.SelectCommand.CommandText = "SELECT RequiredText, OpPriority FROM dbo.StandardOperationText WHERE (StdOpName = " & DataSet51.Tables(0).Rows(e.Item.ItemIndex).Item(4) & ") AND (UPPER(DisplayLanguage) = 'E') ORDER BY OpPriority"
DataSet81.Reset()
SqlDataAdapter2.SelectCommand.CommandText = "SELECT RequiredText, OpPriority,'' as AttributeValue FROM dbo.StandardOperationText WHERE (StdOpName = " & DataSet51.Tables(0).Rows(e.Item.ItemIndex).Item(4) & ") AND (UPPER(DisplayLanguage) = 'E') ORDER BY OpPriority"
'Response.Write(SqlDataAdapter2.SelectCommand.CommandText)
SqlDataAdapter2.Fill(DataSet81)
'if the required text is Tote, then set it here
If DataSet81.Tables(0).Rows.Count > 0 Then
oGrid2.Visible = True
For x = 0 To DataSet81.Tables(0).Rows.Count - 1
If DataSet81.Tables(0).Rows(x).Item(0) = "Tote" Then
DataSet81.Tables(0).Rows(x).Item(2) = txtTote.Text
End If
Next
Else
oGrid2.Visible = False
End If
oGrid2.DataSource = DataSet81
oGrid2.DataBind()

End If

End Sub

Private Sub lstOpenOrders_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstOpenOrders.SelectedIndexChanged
End Sub

Private Sub txtEmployeeID_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtEmployeeID.TextChanged
'trim the employeeid to only the essential portion
If Len(txtEmployeeID.Text) >= 10 Then
txtEmployeeID.Text = Mid(txtEmployeeID.Text, 6, 5)
txtEmployeeID.Text = txtEmployeeID.Text
End If
If Len(txtEmployeeID.Text) = 7 Then
txtEmployeeID.Text = Mid(txtEmployeeID.Text, 2, 5)
End If
'get the employee's name, status and language
SqlDataAdapter1.SelectCommand.CommandText = "SELECT UserName, Status, DefaultLanguage FROM Employee WHERE (UserId = " & txtEmployeeID.Text & ")"
SqlDataAdapter1.Fill(DataSet71)
'see if the employee was found
lblEmployeeName.Visible = True
If DataSet71.Tables(0).Rows.Count > 0 Then
If UCase(DataSet71.Tables(0).Rows(0).Item(1)) = "ACTIVE" Then
lblEmployeeName.Text = UCase(DataSet71.Tables(0).Rows(0).Item(0))
'make the tote scan area visible
lblScanTote.Visible = True
txtSOREL.Visible = True
'set the focus to the tote textbox:

'Me.SetFocus(Me.txtTote)

Else
lblEmployeeName.Text = UCase(DataSet71.Tables(0).Rows(0).Item(0)) & " is not an Active Employee"
txtEmployeeID.Text = ""

End If
Else
'employee was not found
lblEmployeeName.Text = "Employee " & txtEmployeeID.Text & " was not found"
txtEmployeeID.Text = ""
End If

End Sub
Private Sub txtSOREL_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSOREL.TextChanged
dlOperations.SelectedIndex = -1
DataSet31.Reset()
DataSet41.Reset()
DataSet51.Reset()
DataSet61.Reset()
DataSet71.Reset()
DataSet81.Reset()
End Sub
End Class
 
the question to answer is:

why does a click on "Update" yield a e.commandname = "Edit"?
 
I think it's the itemIndex that's not correct. It's returning the index of an "Edit" button when it should return the index of an "Update" button.

I'm looking at your code to find out where this is happening, but it's a bit long.

 
I noticed that on your Page_Load, you bind dlOperations on every postback. But there's a BindNormTypesGrid that gets called when you do that, and it rebinds dgNormTypes.

That means that whenever there's a postback, your dgNormTypes gets rebind, and that's why the Update is returning an Edit command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top