Update gridview after formview insert/edit/update with UpdatePanels.

I'm a DBA...newbie to the ASP .NET world, please bear with me on this educational self-learning curve.

I have a formview (FormView_PayoutAmounts) encased in its own updatepanel (UpdatePanel_PayoutAmounts). I have another updatepanel(UpdatePanel_BonusHistory) with a gridview (Gridview_BonusHistory). With both objects independent of one another I would like the gridview to update when a record is updated/inserted/deleted from the formview.

I have tried setting up the UpdatePanel triggers with no luck. How may I accomplish this task?

Thank you so much experts!!!
Levi MartinSenior Data AnalystAsked:
Who is Participating?
 
Levi MartinSenior Data AnalystAuthor Commented:
Answer found at:
http://www.dotnetjohn.com/articles.aspx?articleid=158


In the FormView1_ItemUpdated method of my FormView I added this code:

    With GridView1
        .DataBind()
        .SelectedIndex = -1
    End With
 

This causes the GridView to refresh.
0
 
DanMerkCommented:
If you are using the formview to updated/inserted/deleted  records, then I would use a triggered event from the formview. Maybe the ItemCommand event?
 
Not only do I think the coding will be nicer using the formview, code maintainance should be easier. It is pretty easy to understand that when an item is changed from the formview, the formview will trigger an event to update the gridview.  
0
 
guru_samiCommented:
Upon FV ItemUpdated / ItemInserted try to update the updatepanel programatically like:

    GVUpdatePanel.Update();

(Refreshing an UpdatePanel Programmatically ):
http://www.asp.net/ajax/documentation/live/overview/UpdatePanelOverview.aspx
http://www.asp.net/ajax/documentation/live/ViewSample.aspx?sref=UpdatePanelHowTo6%23SurveyQuestionsExample.aspx
0
 
Levi MartinSenior Data AnalystAuthor Commented:
Thanks to the both of you. I have read the documents and implemented what I believe should work.

I have the UpdatePanel_BonusHistory triggered to post back when an insert, update, or delete is being done on the FormView_BonusPayouts but still no luck. I have also taked out the GV sorting to avoid any potential issues.

I have pasted the code to help see what I see and catch what I am doing wrong in my learning curve.

Many thanks!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Page language="VB" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<script runat="server">

    Protected Sub ListView_PayoutAmounts_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

    End Sub

    Protected Sub FormView_PayoutAmounts_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs)

    End Sub

    Protected Sub DropDownList2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)

    End Sub

    Protected Sub FormView_PayoutAmounts_PageIndexChanging1(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs)

    End Sub

    Protected Sub sqlds_CallCenterEmployees_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs)

    End Sub
      </script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Call Center Bonus Form</title>
    <style type="text/css">
        .style1
        {
            height: 318px;
        }
        .style2
        {
            width: 100%;
        }
        .style3
        {
            font-weight: bold;
            text-decoration: underline;
            text-align: left;
            width: 500px;
        }
        .style4
        {
            text-decoration: underline;
            text-align: left;
        }
        .style5
        {
            height: 46px;
        }
        .style6
        {
            width: 500px;
        }
        </style>
</head>

<body>
    <form id="FormCallCenterBonus" runat="server">
<table width="100%" height="895" border="1" bgcolor="#DCE6F0">
  <tr bgcolor="#A6A6A6">
    <td width="86%" class="style5"><h2 align="center">Call Center Bonus Form</h2></td>
  </tr>
  <tr bgcolor="#ADC4DB">
    <td height="46"><h4>Contact Center Operations &amp; FSG Service Active Employees:</h4></td>
  </tr>
  <tr>
    <td class="style1">
        <asp:ScriptManager ID="ScriptManager_CallCenterBonus" runat="server">
        </asp:ScriptManager>
        <br />
        <asp:UpdatePanel ID="UpdatePanel_CallCenterEmployees" runat="server">
            <ContentTemplate>
                <asp:GridView ID="GridView_EmployeeList" runat="server" 
    AutoGenerateColumns="False" CellPadding="4" 
    DataSourceID="sqlds_CallCenterEmployees" ForeColor="#333333" GridLines="None" 
    Width="1195px" DataKeyNames="EmployeeNo" DataMember="DefaultView" AllowSorting="True" 
                    BorderColor="Black" BorderStyle="None">
                    <PagerSettings Mode="NextPrevious" NextPageText="Next" 
                        PreviousPageText="Previous" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <Columns>
                        <asp:CommandField ShowSelectButton="True" />
                        <asp:BoundField DataField="DeptNo" HeaderText="Dept #" 
            SortExpression="DeptNo" />
                        <asp:BoundField DataField="Department" 
            HeaderText="Department" SortExpression="Department" />
                        <asp:BoundField DataField="EmployeeNo" 
            HeaderText="Employee #" SortExpression="EmployeeNo" />
                        <asp:BoundField DataField="LastName" 
            HeaderText="Last Name" SortExpression="LastName" />
                        <asp:BoundField DataField="FirstName" 
            HeaderText="First Name" SortExpression="FirstName" />
                        <asp:BoundField DataField="Title" HeaderText="Title" 
            SortExpression="Title" />
                        <asp:BoundField DataField="Team" HeaderText="Team" SortExpression="Team" />
                        <asp:BoundField DataField="SupervsiorName" 
            HeaderText="Supervisor" ReadOnly="True" SortExpression="SupervsiorName" />
                        <asp:BoundField DataField="SecondLevel_SupervisorName" 
                            HeaderText="Second Level Supervisor" 
                            SortExpression="SecondLevel_SupervisorName" />
                    </Columns>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" 
        ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" 
        HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" 
        ForeColor="#333333" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" 
        ForeColor="White" />
                    <EditRowStyle BackColor="#999999" />
                    <AlternatingRowStyle BackColor="White" 
        ForeColor="#284775" />
                </asp:GridView>
                <asp:SqlDataSource ID="sqlds_CallCenterEmployees" runat="server" 
                    
                    
                    
                    ConnectionString="<%$ ConnectionStrings:CallCenterBonus_hirechainConnectionString %>" SelectCommand="SELECT	lawson_temp.dept_nbr AS DeptNo,
		lawson_temp.dept_name AS Department,
		lawson_temp.employee_nbr AS EmployeeNo,
		lawson_temp.last_name AS LastName,
		lawson_temp.first_name AS FirstName,
		lawson_temp.job_title AS Title,
		LastTeamAssignment.Team,
		Supervisors.first_name + ' ' + Supervisors.last_name AS SupervsiorName,
		SupervisorList.SecondLevel_SupervisorName

FROM	lawson_temp 
		LEFT OUTER JOIN (SELECT	employee_nbr,
								last_name,
								first_name,
								job_title,
								dept_nbr,
								dept_name
						FROM	lawson_temp
						WHERE	(employee_nbr IN (SELECT DISTINCT supervisor_id FROM lawson_temp))) AS Supervisors ON lawson_temp.supervisor_id = Supervisors.employee_nbr
		LEFT OUTER JOIN (SELECT	EmployeeNo,
								Team
						FROM	tblCallCenterBonus_PayoutAmounts
						WHERE	(CallCenterBonusID IN (SELECT	MAX(CallCenterBonusID) AS LastTeamEntry
														FROM	tblCallCenterBonus_PayoutAmounts
														WHERE	(Team IS NOT NULL)
														GROUP BY	EmployeeNo))) AS LastTeamAssignment ON lawson_temp.employee_nbr = LastTeamAssignment.EmployeeNo
		LEFT OUTER JOIN (SELECT	employee_nbr AS EmployeeNo,
								first_name + ' ' + last_name AS EmployeeName,
								supervisor_id FirstLevel_SupervisorNo,
								FirstLevelSupervisors.SupervisorName AS FirstLevel_SupervisorName,
								SecondLevelSupervisors.SupervisorNo AS SecondLevel_SupervisorNo,
								SecondLevelSupervisors.SupervisorName AS SecondLevel_SupervisorName
						FROM	lawson_temp
								LEFT OUTER JOIN (SELECT	employee_nbr AS SupervisorNo,
														first_name + ' ' + last_name AS SupervisorName,
														supervisor_id AS SecondLevelSupervisorID
												FROM	lawson_temp
												WHERE	(employee_nbr IN (SELECT DISTINCT supervisor_id FROM lawson_temp))) AS FirstLevelSupervisors ON lawson_temp.supervisor_id = FirstLevelSupervisors.SupervisorNo
								LEFT OUTER JOIN (SELECT	employee_nbr AS SupervisorNo,
														first_name + ' ' + last_name AS SupervisorName
												FROM	lawson_temp
												WHERE	(employee_nbr IN (SELECT DISTINCT supervisor_id FROM lawson_temp))) AS SecondLevelSupervisors ON FirstLevelSupervisors.SecondLevelSupervisorID = SecondLevelSupervisors.SupervisorNo
						WHERE	(dept_nbr IN (3791, 1228))) AS SupervisorList ON lawson_temp.employee_nbr = SupervisorList.EmployeeNo

WHERE	(lawson_temp.dept_nbr IN (3791, 1228)) AND
		((lawson_temp.term_date IS NULL) OR (DATEDIFF(dd, lawson_temp.term_date, GETDATE()) &lt;= 31))

ORDER BY	lawson_temp.dept_nbr DESC,
			lawson_temp.last_name,
			lawson_temp.first_name"></asp:SqlDataSource>
                <br />
                <br />
                <table class="style2">
                    <tr>
                        <td class="style3">
                            Previous Month Bonus Payout Management:</td>
                        <td class="style4">
                            <b>Current Bonus Payout History:</b></td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:UpdatePanel ID="UpdatePanel_PayoutAmounts" runat="server">
                                <ContentTemplate>
                                    <asp:FormView ID="FormView_PayoutAmounts" runat="server" AllowPaging="True" 
                                        CellPadding="4" DataKeyNames="CallCenterBonusID" 
                                        DataSourceID="SqlDataSource_PayoutAmounts" ForeColor="#333333" 
                                        style="font-family: 'Times New Roman', Times, serif" Width="457px">
                                        <PagerSettings Mode="NumericFirstLast" />
                                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                        <EditItemTemplate>
                                            <b>Bonus Payout ID:</b>&nbsp;&nbsp;
                                            <asp:Label ID="CallCenterBonusID_UpdateLabel" runat="server" 
                                                style="color: #003366" Text='<%# Eval("CallCenterBonusID") %>' />
                                            <br />
                                            <b>Employee #:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Label ID="EmployeeNo_UpdateLabel" runat="server" style="color: #003366" 
                                                Text='<%# Bind("EmployeeNo") %>'></asp:Label>
                                            <br />
                                            <b>Team:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:DropDownList ID="Team_UpdateDropDownList" runat="server" 
                                                DataSourceID="SqlDataSource_Teams" DataTextField="Team" DataValueField="Team" 
                                                SelectedValue='<%# Bind("Team") %>' Width="175px">
                                            </asp:DropDownList>
                                            <br />
                                            Ranking:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:DropDownList ID="Ranking_UpdateDropDownList" runat="server" 
                                                SelectedValue='<%# Bind("Ranking") %>' Width="125px">
                                                <asp:ListItem>N/A</asp:ListItem>
                                                <asp:ListItem>Meets</asp:ListItem>
                                                <asp:ListItem>Exceeds</asp:ListItem>
                                            </asp:DropDownList>
                                            <b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>
                                            <br />
                                            <b>Entry User:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Label ID="UserEntered_UpdateLabel" runat="server" style="color: #003366" 
                                                Text='<%# Bind("UserEntered") %>'></asp:Label>
                                            <br />
                                            <b>Entry Date:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Label ID="DateEntered_UpdateLabel" runat="server" style="color: #003366" 
                                                Text='<%# Bind("UserEntered") %>'></asp:Label>
                                            <br />
                                            <b>Payout Amount:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:TextBox ID="PayoutAmount_UpdateTextBox" 
                                                runat="server" Text='<%# Bind("PayoutAmount", "{0:C}") %>' Width="100px" />
                                            <br />
                                            <b>Comments:<br />
                                            </b>
                                            <asp:TextBox ID="Comments_UpdateTextBox" runat="server" Height="50px" 
                                                Text='<%# Bind("Comments") %>' TextMode="MultiLine" Width="425px" 
                                                style="font-family: Arial, Helvetica, sans-serif; font-size: small;"></asp:TextBox>
                                            <br />
                                            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                                CommandName="Update" Text="Update" />
                                            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                        </EditItemTemplate>
                                        <InsertItemTemplate>
                                            <b>Team:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:DropDownList ID="Team_InsertDropDownList" runat="server" 
                                                DataSourceID="SqlDataSource_Teams" DataTextField="Team" DataValueField="Team" 
                                                SelectedValue='<%# Bind("Team") %>' Width="175px">
                                            </asp:DropDownList>
                                            <br />
                                            <b>Ranking:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:DropDownList ID="Ranking_InsertDropDownList" runat="server" 
                                                SelectedValue='<%# Bind("Ranking") %>' Width="175px">
                                                <asp:ListItem Selected="True">N/A</asp:ListItem>
                                                <asp:ListItem>Meets</asp:ListItem>
                                                <asp:ListItem>Exceeds</asp:ListItem>
                                            </asp:DropDownList>
                                            <br />
                                            <b>Payout Amount:</b>&nbsp;&nbsp;
                                            <asp:TextBox ID="PayoutAmount_InsertTextbox" runat="server" 
                                                Text='<%# Bind("PayoutAmount", "{0:C}") %>' Width="100px"></asp:TextBox>
                                            <br />
                                            <b>Comments:</b><br />
                                            <asp:TextBox ID="Comments_InsertextBox" runat="server" Height="50px" 
                                                Text='<%# Bind("Comments") %>' TextMode="MultiLine" Width="425px" 
                                                style="font-family: Arial, Helvetica, sans-serif; font-size: small;"></asp:TextBox>
                                            <br />
                                            <asp:Label ID="EmployeeNo_InsertLabel" runat="server" 
                                                Enabled='<%# Eval("EmployeeNo") %>' Text='<%# Bind("EmployeeNo") %>'></asp:Label>
                                            <br />
                                            <asp:Label ID="UserEntered_InsertLabel" runat="server" 
                                                Text='<%# Bind("UserEntered") %>' Visible="False"></asp:Label>
                                            <br />
                                            <asp:Label ID="DateEntered_InsertLabel" runat="server" 
                                                Text='<%# Bind("DateEntered") %>' Visible="False"></asp:Label>
                                            <br />
                                            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                                CommandName="Insert" Text="Insert" />
                                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                        </InsertItemTemplate>
                                        <ItemTemplate>
                                            <b>Bonus Payout ID:</b>&nbsp;&nbsp;
                                            <asp:Label ID="CallCenterBonusIDLabel" runat="server" style="color: #003366" 
                                                Text='<%# Eval("CallCenterBonusID") %>' />
                                            <br />
                                            <b>Employee #:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Label ID="EmployeeNoLabel" runat="server" style="color: #003366" 
                                                Text='<%# Bind("EmployeeNo") %>' />
                                            <br />
                                            <b>Team:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>
                                            <asp:Label ID="TeamLabel" runat="server" style="color: #003366" 
                                                Text='<%# Eval("Team") %>'></asp:Label>
                                            <br />
                                            <b>Ranking:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Label ID="RankingLabel" runat="server" 
                                                style="color: #003366; font-weight: 700" Text='<%# Bind("Ranking") %>' />
                                            <br />
                                            <b>Entry User:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Label ID="UserEnteredLabel" runat="server" style="color: #003366" 
                                                Text='<%# Bind("UserEntered") %>' />
                                            <br />
                                            <b>Entry Date:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Label ID="DateEnteredLabel" runat="server" style="color: #003366" 
                                                Text='<%# Bind("DateEntered") %>' />
                                            <br />
                                            <b>Payout Amount:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="PayoutAmountLabel" runat="server" 
                                                style="color: #003366; font-weight: 700" 
                                                Text='<%# Bind("PayoutAmount", "{0:C}") %>' />
                                            <br />
                                            <b>Comments:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>
                                            <asp:Label ID="CommentLabel" runat="server" style="color: #003366" 
                                                Text='<%# Eval("Comments") %>'></asp:Label>
                                            <br />
                                            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                                                CommandName="Edit" Text="Edit" />
                                            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                                                CommandName="Delete" Text="Delete" />
                                            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                                                CommandName="New" Text="New" />
                                        </ItemTemplate>
                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                        <EmptyDataTemplate>
                                            <asp:UpdatePanel ID="UpdatePanel_FirstPayoutEntry" runat="server">
                                                <ContentTemplate>
                                                    <asp:FormView ID="FormView_CreateFirstPayout" runat="server" 
                                                        DataKeyNames="CallCenterBonusID" DataSourceID="SqlDataSource_CreateFirstPayout" 
                                                        DefaultMode="Insert" Width="411px" 
                                                        style="font-family: 'Times New Roman', Times, serif">
                                                        <EditItemTemplate>
                                                            CallCenterBonusID:
                                                            <asp:Label ID="CallCenterBonusIDLabel1" runat="server" 
                                                                Text='<%# Eval("CallCenterBonusID") %>' />
                                                            <br />
                                                            EmployeeNo:
                                                            <asp:TextBox ID="EmployeeNoTextBox" runat="server" 
                                                                Text='<%# Bind("EmployeeNo") %>' />
                                                            <br />
                                                            Ranking:
                                                            <asp:TextBox ID="RankingTextBox" runat="server" Text='<%# Bind("Ranking") %>' />
                                                            <br />
                                                            UserEntered:
                                                            <asp:TextBox ID="UserEnteredTextBox" runat="server" 
                                                                Text='<%# Bind("UserEntered") %>' />
                                                            <br />
                                                            PayoutAmount:
                                                            <asp:TextBox ID="PayoutAmountTextBox" runat="server" 
                                                                Text='<%# Bind("PayoutAmount") %>' />
                                                            <br />
                                                            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                                                                CommandName="Update" Text="Update" />
                                                            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                                                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                                        </EditItemTemplate>
                                                        <InsertItemTemplate>
                                                            <b>Team:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:DropDownList ID="Team_NewDropDownList" runat="server" 
                                                                DataSourceID="SqlDataSource_Teams" DataTextField="Team" DataValueField="Team" 
                                                                SelectedValue='<%# Bind("Team") %>' Width="175px">
                                                            </asp:DropDownList>
                                                            <br />
                                                            <b>Ranking:</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:DropDownList ID="Ranking_NewDropDownList" runat="server" 
                                                                SelectedValue='<%# Bind("Ranking") %>' Width="125px">
                                                                <asp:ListItem>N/A</asp:ListItem>
                                                                <asp:ListItem>Meets</asp:ListItem>
                                                                <asp:ListItem>Exceeds</asp:ListItem>
                                                            </asp:DropDownList>
                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <br />
                                                            <b>Payout Amount:</b>&nbsp;&nbsp;&nbsp;<asp:TextBox ID="PayoutAmountTextBox" runat="server" 
                                                                Text='<%# Bind("PayoutAmount", "{0:C}") %>' Width="100px" />
                                                            <br />
                                                            <b>Comments:</b><br />
                                                            <asp:TextBox ID="Comments_NewTextBox" runat="server" Height="50px" 
                                                                Text='<%# Bind("Comments") %>' TextMode="MultiLine" Width="425px" 
                                                                style="font-family: Arial, Helvetica, sans-serif; font-size: small;"></asp:TextBox>
                                                            <br />
                                                            <asp:Label ID="EmployeeNo_NewLabel" runat="server" style="color: #003366" 
                                                                Text='<%# Bind("EmployeeNo") %>'></asp:Label>
                                                            <br />
                                                            <asp:Label ID="UserEntered_NewLabel" runat="server" style="color: #003366" 
                                                                Text='<%# Bind("UserEntered") %>'></asp:Label>
                                                            <br />
                                                            <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                                                                CommandName="Insert" Text="Insert" />
                                                            &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                                                                CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                                                        </InsertItemTemplate>
                                                        <ItemTemplate>
                                                            CallCenterBonusID:
                                                            <asp:Label ID="CallCenterBonusIDLabel" runat="server" 
                                                                Text='<%# Eval("CallCenterBonusID") %>' />
                                                            <br />
                                                            EmployeeNo:
                                                            <asp:Label ID="EmployeeNoLabel" runat="server" 
                                                                Text='<%# Bind("EmployeeNo") %>' />
                                                            <br />
                                                            Ranking:
                                                            <asp:Label ID="RankingLabel" runat="server" Text='<%# Bind("Ranking") %>' />
                                                            <br />
                                                            UserEntered:
                                                            <asp:Label ID="UserEnteredLabel" runat="server" 
                                                                Text='<%# Bind("UserEntered") %>' />
                                                            <br />
                                                            PayoutAmount:
                                                            <asp:Label ID="PayoutAmountLabel" runat="server" 
                                                                Text='<%# Bind("PayoutAmount") %>' />
                                                            <br />
                                                            <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" 
                                                                CommandName="Edit" Text="Edit" />
                                                            &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" 
                                                                CommandName="Delete" Text="Delete" />
                                                            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                                                                CommandName="New" Text="New" />
                                                        </ItemTemplate>
                                                    </asp:FormView>
                                                </ContentTemplate>
                                            </asp:UpdatePanel>
                                            <asp:SqlDataSource ID="SqlDataSource_CreateFirstPayout" runat="server" 
                                                ConnectionString="<%$ ConnectionStrings:CallCenterBonus_hirechainConnectionString %>" 
                                                DeleteCommand="DELETE FROM [tblCallCenterBonus_PayoutAmounts] WHERE [CallCenterBonusID] = @original_CallCenterBonusID" 
                                                InsertCommand="INSERT INTO [tblCallCenterBonus_PayoutAmounts] ([EmployeeNo], [Team], [Ranking], [UserEntered], [DateEntered], [PayoutAmount], [Comments]) VALUES (@EmployeeNo, @Team, @Ranking, @UserEntered, @DateEntered, @PayoutAmount, @Comments)" 
                                                SelectCommand="SELECT [CallCenterBonusID], [EmployeeNo], [Team], [Ranking], [UserEntered], [DateEntered], [PayoutAmount], [Comments] FROM [tblCallCenterBonus_PayoutAmounts] WHERE ([EmployeeNo] = @EmployeeNo)" 
                                                
                                                UpdateCommand="UPDATE [tblCallCenterBonus_PayoutAmounts] SET [EmployeeNo] = @EmployeeNo, [Team] = @Team, [Ranking] = @Ranking, [UserEntered] = @UserEntered, [DateEntered] = @DateEntered, [PayoutAmount] = @PayoutAmount, [Comments] = @Comments WHERE [CallCenterBonusID] = @original_CallCenterBonusID" 
                                                OldValuesParameterFormatString="original_{0}">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="GridView_EmployeeList" Name="EmployeeNo" 
                                                        PropertyName="SelectedValue" Type="Int32" />
                                                </SelectParameters>
                                                <DeleteParameters>
                                                    <asp:Parameter Name="original_CallCenterBonusID" Type="Int32" />
                                                </DeleteParameters>
                                                <UpdateParameters>
                                                    <asp:Parameter Name="EmployeeNo" Type="Int32" />
                                                    <asp:Parameter Name="Team" Type="String" />
                                                    <asp:Parameter Name="Ranking" Type="String" />
                                                    <asp:Parameter Name="UserEntered" Type="String" />
                                                    <asp:Parameter Name="DateEntered" Type="DateTime" />
                                                    <asp:Parameter Name="PayoutAmount" Type="Decimal" />
                                                    <asp:Parameter Name="Comments" Type="String" />
                                                    <asp:Parameter Name="original_CallCenterBonusID" Type="Int32" />
                                                </UpdateParameters>
                                                <InsertParameters>
                                                    <asp:ControlParameter ControlID="GridView_EmployeeList" Name="EmployeeNo" 
                                                        PropertyName="SelectedValue" Type="Int32" />
                                                    <asp:Parameter Name="Team" Type="String" />
                                                    <asp:Parameter Name="Ranking" Type="String" />
                                                    <asp:Parameter Name="UserEntered" Type="String" />
                                                    <asp:Parameter Name="DateEntered" Type="DateTime" />
                                                    <asp:Parameter Name="PayoutAmount" Type="Decimal" />
                                                    <asp:Parameter Name="Comments" Type="String" />
                                                </InsertParameters>
                                            </asp:SqlDataSource>
                                        </EmptyDataTemplate>
                                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <EditRowStyle BackColor="#999999" />
                                    </asp:FormView>
                                    <br />
                                </ContentTemplate>
                                <Triggers>
                                </Triggers>
                            </asp:UpdatePanel>
                            <asp:SqlDataSource ID="SqlDataSource_PayoutAmounts" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:CallCenterBonus_hirechainConnectionString %>" 
                                DeleteCommand="DELETE FROM [tblCallCenterBonus_PayoutAmounts] WHERE [CallCenterBonusID] = @original_CallCenterBonusID" 
                                InsertCommand="INSERT INTO [tblCallCenterBonus_PayoutAmounts] ([EmployeeNo], [Team], [Ranking], [UserEntered], [DateEntered], [PayoutAmount], [Comments]) VALUES (@EmployeeNo, @Team, @Ranking, @UserEntered, @DateEntered, @PayoutAmount, @Comments)" 
                                OldValuesParameterFormatString="original_{0}" 
                                SelectCommand="SELECT CallCenterBonusID, EmployeeNo, Team, Ranking, UserEntered, DateEntered, PayoutAmount, Comments 
FROM tblCallCenterBonus_PayoutAmounts 
WHERE (EmployeeNo = @EmployeeNo) AND ((MONTH(DateEntered) = MONTH(GETDATE())) AND (YEAR(DateEntered) = YEAR(GETDATE())))
ORDER BY CallCenterBonusID" 
                                
                                
                                
                                
                                
                                UpdateCommand="UPDATE [tblCallCenterBonus_PayoutAmounts] SET [EmployeeNo] = @EmployeeNo, [Team] = @Team, [Ranking] = @Ranking, [UserEntered] = @UserEntered, [DateEntered] = @DateEntered, [PayoutAmount] = @PayoutAmount, [Comments] = @Comments WHERE [CallCenterBonusID] = @original_CallCenterBonusID">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="GridView_EmployeeList" Name="EmployeeNo" 
                                        PropertyName="SelectedValue" Type="Int32" />
                                </SelectParameters>
                                <DeleteParameters>
                                    <asp:Parameter Name="original_CallCenterBonusID" Type="Int32" />
                                </DeleteParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="EmployeeNo" Type="Int32" />
                                    <asp:Parameter Name="Team" Type="String" />
                                    <asp:Parameter Name="Ranking" Type="String" />
                                    <asp:Parameter Name="UserEntered" Type="String" />
                                    <asp:Parameter Name="DateEntered" Type="DateTime" />
                                    <asp:Parameter Name="PayoutAmount" Type="Decimal" />
                                    <asp:Parameter Name="Comments" Type="String" />
                                    <asp:Parameter Name="original_CallCenterBonusID" Type="Int32" />
                                </UpdateParameters>
                                <InsertParameters>
                                    <asp:ControlParameter ControlID="GridView_EmployeeList" Name="EmployeeNo" 
                                        PropertyName="SelectedValue" Type="Int32" />
                                    <asp:Parameter Name="Team" Type="String" />
                                    <asp:Parameter Name="Ranking" Type="String" />
                                    <asp:Parameter Name="UserEntered" Type="String" />
                                    <asp:Parameter Name="DateEntered" Type="DateTime" />
                                    <asp:Parameter Name="PayoutAmount" Type="Decimal" />
                                    <asp:Parameter Name="Comments" Type="String" />
                                </InsertParameters>
                            </asp:SqlDataSource>
                            <asp:SqlDataSource ID="SqlDataSource_Teams" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:CallCenterBonus_hirechainConnectionString %>" SelectCommand="SELECT 0 AS CallCenterTeamID, '' AS Team
UNION
SELECT CallCenterTeamID, Team FROM tblCallCenter_Teams"></asp:SqlDataSource>
                            <br />
                        </td>
                        <td>
                            <asp:UpdatePanel ID="UpdatePanel_BonusHistory" runat="server" 
                                UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:GridView ID="GridView_BonusHistory" runat="server" 
                                        AutoGenerateColumns="False" CellPadding="4" 
                                        DataKeyNames="CallCenterBonusID" DataSourceID="SqlDataSource_BonusHistory" 
                                        ForeColor="#333333" GridLines="None" Width="681px">
                                        <PagerSettings Mode="NextPrevious" NextPageText="Next" 
                                            PreviousPageText="Prev" />
                                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                        <Columns>
                                            <asp:BoundField DataField="CallCenterBonusID" HeaderText="Payout Bonus ID" 
                                                InsertVisible="False" ReadOnly="True" SortExpression="CallCenterBonusID" />
                                            <asp:BoundField DataField="Ranking" HeaderText="Ranking" 
                                                SortExpression="Ranking" />
                                            <asp:BoundField DataField="DateEntered" HeaderText="Entry Date" 
                                                SortExpression="DateEntered" />
                                            <asp:BoundField DataField="PayoutAmount" HeaderText="Payout Amount" 
                                                ReadOnly="True" SortExpression="PayoutAmount" />
                                        </Columns>
                                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                        <EditRowStyle BackColor="#999999" />
                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                    </asp:GridView>
                                    <asp:SqlDataSource ID="SqlDataSource_BonusHistory" runat="server" 
                                        
                                        ConnectionString="<%$ ConnectionStrings:CallCenterBonus_hirechainConnectionString %>" SelectCommand="SELECT	CallCenterBonusID,
		Ranking,
		DateEntered,
		'$ ' + CONVERT(VARCHAR(10), PayoutAmount) AS PayoutAmount
FROM	tblCallCenterBonus_PayoutAmounts 
WHERE	(EmployeeNo = @EmployeeNo) AND ((MONTH(DateEntered) = MONTH(GETDATE())) AND (YEAR(DateEntered) = YEAR(GETDATE())))
ORDER BY	CallCenterBonusID">
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="GridView_EmployeeList" Name="EmployeeNo" 
                                                PropertyName="SelectedValue" />
                                        </SelectParameters>
                                    </asp:SqlDataSource>
                                </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="FormView_PayoutAmounts" 
                                        EventName="ItemInserted" />
                                    <asp:AsyncPostBackTrigger ControlID="FormView_PayoutAmounts" 
                                        EventName="ItemUpdated" />
                                    <asp:AsyncPostBackTrigger ControlID="FormView_PayoutAmounts" 
                                        EventName="ItemDeleted" />
                                </Triggers>
                            </asp:UpdatePanel>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
            <Triggers>
            </Triggers>
        </asp:UpdatePanel>
        <br />
      </td>
  </tr>
    <tr>
    <td height="46" style="background-color: #ADC4DB"><h4>Overall Bonus Payout 
        Reporting:</h4><tr>
    <td class="style1">
    <rsweb:ReportViewer ID="ReportViewer_CallCenterBonus" runat="server" Font-Names="Verdana" 
              Font-Size="8pt" Height="400px" ProcessingMode="Remote" Width="1195px" 
              ZoomPercent="75">
              <ServerReport ReportPath="/Application Based Reports/Call Center Bonus Report" 
                  ReportServerUrl="http://12.156.1.163/ReportServer" />
          </rsweb:ReportViewer>
      </td>
  </tr>
    </table>
    </form>
</body>
</html>

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.