|
Rank: Advanced Member Groups: Member
Joined: 7/26/2009 Posts: 36
|
I am trying to toggle to a different page in the SelectedIndexChanged event from an ASP.NET gridview using the following code:
StudentSummaryPages.SelectPageByID("vwSummary")
The event is seen but it does not go to the selected page.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Please try to isolate the issue into a separate test page. We will take a look as soon as we have that.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 7/26/2009 Posts: 36
|
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="StudentSummary.aspx.vb" Inherits="StudentSummary" validateRequest="false" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Student Summary</title> <link href="Default.css" rel="stylesheet" type="text/css" /> <script language="javascript" type="text/javascript"> function onShowSummary() { setTimeout( function() { eo_GetObject('StudentSummaryPages').selectPageById('vwSummary'); } , 25); } </script>
</head> <body> <form id="frmStudentSummary" runat="server"> <div> <asp:ScriptManager ID="StudentReviewScriptManager" runat="server"> </asp:ScriptManager> </div> <div style="margin-left: auto; width: 800px; margin-right: auto"> <asp:Label ID="Label1" runat="server" CssClass="PageContentHeader" Height="30px" Text="Student Summary"></asp:Label> </div> <eo:multipage id="StudentSummaryPages" runat="server" height="180px" width="100%"> <eo:PageView id="vwStudentList_Summary" runat="server" CssClass="EOPageView" Width="800px"><asp:Label style="POSITION: static" id="lblStudentsSummary" runat="server" CssClass="PanelHeader" Height="13px" Text="Students" ForeColor="White"></asp:Label> <eo:CallbackPanel id="cbpStudentSummaryList" runat="server" Height="100%" Width="100%" UpdateMode="Self" CssClass="EOFullPageCallBackPanel"> <div style="margin-left: auto; margin-right: auto; padding: 10px, 10px, 10px, 10px"> <asp:GridView ID="grdStudentSummaryList" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" DataSourceID="dsStudentListSummary" HorizontalAlign="Center" DataKeyNames="StudentID" OnSelectedIndexChanged="grdStudentSummaryList_SelectedIndexChanged" > <Columns> <asp:CommandField ButtonType="Button" SelectText="View" ShowSelectButton="True"> <HeaderStyle HorizontalAlign="Center" BackColor="Gray" BorderColor="Gray" /> <ItemStyle Font-Size="X-Small" HorizontalAlign="Center" Width="50px" /> </asp:CommandField> <asp:BoundField DataField="Student" HeaderText="Student" SortExpression="Student"> <ItemStyle CssClass="ASPGridTextBox" Height="21px" HorizontalAlign="Left" Width="200px" /> <HeaderStyle BackColor="Gray" BorderColor="Gray" ForeColor="White" Height="24px" Width="125px" /> </asp:BoundField> <asp:BoundField DataField="Phone" HeaderText="Phone"> <ItemStyle CssClass="ASPGridTextBox" Height="21px" HorizontalAlign="Left" Width="100px" /> <HeaderStyle BackColor="Gray" BorderColor="Gray" ForeColor="White" Height="24px" /> </asp:BoundField> <asp:BoundField DataField="Job Coach" HeaderText="Job Coach" SortExpression="Job Coach"> <HeaderStyle BackColor="Gray" BorderColor="Gray" ForeColor="White" /> <ItemStyle CssClass="ASPGridTextBox" Width="125px" /> </asp:BoundField> <asp:BoundField DataField="Employer" HeaderText="Employer" SortExpression="Employer"> <ItemStyle CssClass="ASPGridTextBox" Height="21px" HorizontalAlign="Left" Width="180px" /> <HeaderStyle BackColor="Gray" BorderColor="Gray" ForeColor="White" Height="24px" Width="180px" /> </asp:BoundField> <asp:BoundField DataField="StudentID" SortExpression="StudentID" Visible="False"> <HeaderStyle BackColor="Gray" BorderColor="Gray" Width="0px" /> </asp:BoundField> </Columns> <RowStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" /> <SelectedRowStyle BackColor="#FFE0C0" Font-Bold="True" /> <PagerSettings FirstPageText="First" LastPageText="Last" Mode="NextPreviousFirstLast" NextPageText="Next" PreviousPageText="Previous" /> </asp:GridView> <asp:Button ID="Button1" runat="server" Text="Button" /> </div> </eo:CallbackPanel> </eo:PageView> <eo:PageView id="vwSummary" runat="server" CssClass="EOPageView" Width="800px"><asp:Label style="POSITION: static" id="lblSummary" runat="server" CssClass="PanelHeader" Height="13px" Text="Summary" ForeColor="White"></asp:Label> <div style="margin-left: auto; margin-right: auto;"> <table style="vertical-align: top; text-align: center"> <tr> <td style="vertical-align: top; width: 150px; text-align: left"> <eo:CallbackPanel ID="cbpSummaryAssessmentHistory" runat="server" Triggers="{ControlID:grdStudentSummaryList;Parameter:SelectedIndexChanged}" UpdateMode="Conditional" Width="200px"> <div style="overflow: auto; width: 222px"> <asp:Label ID="lblSummaryAssessmentHistory" runat="server" CssClass="LJFormLabel" Text="Assessment History" Visible="False" Width="124px"></asp:Label> <asp:GridView ID="grdSummaryAssessmentHistory" runat="server" AutoGenerateColumns="False" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" DataKeyNames="WorkplaceSkillsAssessmentID" DataSourceID="dsSummaryStudentAssessments" Width="205px"> <RowStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Height="22px" /> <Columns> <asp:CommandField ButtonType="Button" CancelText="" DeleteText="" SelectText="View" ShowSelectButton="True"> <ControlStyle Font-Size="X-Small" /> <ItemStyle Width="38px" /> </asp:CommandField> <asp:BoundField DataField="WeekEnding" DataFormatString="{0:d}" HeaderText="Date" SortExpression="WeekEnding"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle CssClass="ASPGridTextBox" HorizontalAlign="Left" Width="90px" /> </asp:BoundField> <asp:BoundField DataField="Score" HeaderText="Score" SortExpression="Score"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" Width="65px" /> </asp:BoundField> </Columns> <SelectedRowStyle BackColor="#FFE0C0" Font-Bold="True" /> <HeaderStyle BackColor="Gray" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial,SansSerif" Font-Size="Small" ForeColor="White" Height="24px" /> </asp:GridView> </div> </eo:CallbackPanel> </td> <td style="width: 50px"> </td> <td style="vertical-align: top; width: 600px; text-align: left"> <eo:CallbackPanel ID="cbpSummaryCriterias" runat="server" CssClass="EOCallBackPanel" Triggers="{ControlID:grdSummaryAssessmentHistory;Parameter:SelectedIndexChanged},{ControlID:grdStudentSummaryList;Parameter:SelectedIndexChanged}" UpdateMode="Conditional" Width="98%"> <asp:Label ID="lblSummaryAssessmentResults" runat="server" CssClass="LJFormLabel" Text="Assessment Results" Visible="False" Width="260px"></asp:Label> <asp:GridView ID="grdSummaryWorkplaceSkillsCriterias" runat="server" AutoGenerateColumns="False" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" DataSourceID="dsSummaryCriterias" HorizontalAlign="Left"> <RowStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Height="22px" /> <Columns> <asp:BoundField DataField="Criteria" HeaderText="Criteria" SortExpression="Criteria"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle CssClass="ASPGridTextBox" HorizontalAlign="Left" Width="500px" /> </asp:BoundField> <asp:BoundField DataField="Rating" HeaderText="Rating" SortExpression="Rating"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" Width="65px" /> </asp:BoundField> </Columns> <SelectedRowStyle BackColor="#FFE0C0" Font-Bold="True" /> <HeaderStyle BackColor="Gray" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Font-Names="Arial,SansSerif" Font-Size="Small" ForeColor="White" Height="24px" /> </asp:GridView> </eo:CallbackPanel> </td> </tr> <tr> <td style="vertical-align: top; width: 150px; height: 21px; text-align: left"> </td> <td style="width: 50px; height: 21px"> </td> <td style="vertical-align: top; width: 600px; text-align: left"> </td> </tr> <tr> <td style="vertical-align: top; width: 150px; text-align: left"> </td> <td style="width: 50px"> </td> <td style="vertical-align: top; width: 600px; text-align: left"> </td> </tr> </table>
</div> </eo:PageView> </eo:multipage> <asp:SqlDataSource ID="dsStudentListSummary" runat="server" ConnectionString="<%$ ConnectionStrings:SpeeduConnectionString %>" SelectCommand="SELECT Students.LastName + ', ' + Students.FirstName AS Student, Students.PrimaryPhone AS Phone, Job_Coaches.FirstName + ', ' + Job_Coaches.LastName AS [Job Coach], Students.StudentID, Employers.Company AS Employer FROM Students INNER JOIN Job_Coaches ON Students.JobCoachID = Job_Coaches.JobCoachID INNER JOIN Employers ON Students.EmployerID = Employers.EmployerID LEFT OUTER JOIN School_Employees ON Students.JobCoachID = School_Employees.EmployeeID WHERE (Students.Active = 1) AND (Students.DistrictLocationID = @DistrictLocation) ORDER BY Student"> <SelectParameters> <asp:Parameter DefaultValue="1" Name="DistrictLocation" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="dsSummaryStudentAssessments" runat="server" ConnectionString="<%$ ConnectionStrings:SpeeduConnectionString %>" SelectCommand="SELECT Week_Ending_Dates.WeekEnding, Workplace_Skills_Assessments.WorkplaceSkillsAssessmentID, Workplace_Skills_Assessments.Score FROM Workplace_Skills_Assessments INNER JOIN Week_Ending_Dates ON Workplace_Skills_Assessments.WeekEndingID = Week_Ending_Dates.WeekEndingID WHERE (Workplace_Skills_Assessments.StudentID = @StudentID) AND (Workplace_Skills_Assessments.Active = 1)"> <SelectParameters> <asp:ControlParameter ControlID="grdStudentSummaryList" Name="StudentID" PropertyName="SelectedValue" /> </SelectParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="dsSummaryCriterias" runat="server" ConnectionString="<%$ ConnectionStrings:SpeeduConnectionString %>" SelectCommand="SELECT Criterias.CriteriaShort AS Criteria, Assessment_Details.Assessment AS Rating FROM Criterias INNER JOIN Assessment_Details ON Criterias.CriteriaID = Assessment_Details.CriteriaID INNER JOIN Workplace_Skills_Assessments ON Assessment_Details.WorkplaceSkillsAssessmentID = Workplace_Skills_Assessments.WorkplaceSkillsAssessmentID WHERE (Assessment_Details.Active = 1) AND (Workplace_Skills_Assessments.WorkplaceSkillsAssessmentID = @AssessmentID) ORDER BY Assessment_Details.AssessmentNumber"> <SelectParameters> <asp:ControlParameter ControlID="grdSummaryAssessmentHistory" Name="AssessmentID" PropertyName="SelectedValue" /> </SelectParameters> </asp:SqlDataSource> </form> </body> </html>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, We need you to isolate it so that we will be able to run it. Without being able to run it we can not see the problem or verify the solution that we may have for you. Please see here for more details: http://www.essentialobjects.com/forum/postst3013_I-run-into-a-problem-can-I-send-over-my-code-so-that-you-can-take-a-look.aspxThanks
|
|
Rank: Advanced Member Groups: Member
Joined: 7/26/2009 Posts: 36
|
Hi
Here's a page that will work. Its a simple page where the user clicks a button on page 1 of the multi-view in order to display a list on the 2nd page. By default, the list on page 2 is invisible but I set it's visible property to true when the user clicks the button on page 1. Anyway, the button click event is fired and but the pageview DOES NOT change to the 2nd page. Thanks for any help you can give me on this.
Here's the page code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="EOTest.aspx.vb" Inherits="EOTest" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <eo:MultiPage ID="MultiPage1" runat="server" Height="180px" Width="100%"> <eo:PageView ID="PageView1" runat="server" Width="100%"> <asp:Button ID="Button1" runat="server" Text="Button" /></eo:PageView> <eo:PageView ID="PageView2" runat="server" Width="100%"> <table style="vertical-align: top; text-align: center"> <tr> <td style="vertical-align: top; width: 150px; text-align: left"> <eo:CallbackPanel ID="cbpSummaryAssessmentHistory" runat="server" Triggers="{ControlID:Button1;Parameter:OnClick}" UpdateMode="Conditional"> <asp:ListBox ID="ListBox1" runat="server"> <asp:ListItem>Item 1</asp:ListItem> </asp:ListBox></eo:CallbackPanel> </td> <td style="width: 50px"> </td> <td style="vertical-align: top; width: 578px; text-align: left"> </td> </tr> <tr> <td style="vertical-align: top; width: 150px; height: 21px; text-align: left"> </td> <td style="width: 50px; height: 21px"> </td> <td style="vertical-align: top; width: 578px; text-align: left"> </td> </tr> <tr> <td style="vertical-align: top; width: 150px; text-align: left"> </td> <td style="width: 50px"> </td> <td style="vertical-align: top; width: 578px; text-align: left"> </td> </tr> </table> </eo:PageView> </eo:MultiPage> </div> </form> </body> </html>
Here's the code behind:
Partial Class EOTest Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click MultiPage1.SelectedIndex = 1 ListBox1.Visible = True cbpSummaryAssessmentHistory.Update() End Sub End Class
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
That certainly will not work. You are using a CallbackPanel and when it is triggered, only contents inside the CallbackPanel will be updated. Your MultiPage is outside of the CallbackPanel so it is for sure will not be updated no matter what you do. That is precisely what a CallbackPanel does: it updates only contents inside its boundary.
Thanks
|
|