CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
web_forms
getting_started
data_presentation_controls
dotnetnuke
data_access-sql_server_sql_server_express_and_sqldatasource_control
security
client_side_web_development
novell-support-groupwise-6x-clients
data_access-data_access_and_objectdatasource_control
asp-net_ajax-asp-net_ajax_control_toolkit
novell-support-netware-6x-install-upgrade
asp-net_ajax-asp-net_ajax_discussion_and_suggestions
novell-support-netware-6x-administration-tools
master_pages_themes_and_navigation_controls
configuration_and_deployment
novell-support-netware-client-winnt-2x-xp
novell-support-groupwise-7x-clients
asp-net_ajax-asp-net_ajax_ui
novell-support-edirectory-netware
community-free_for_all
visual_studio_2005
novell-support-groupwise-6x-install-setup
data_access-xml_and_xmldatasource_control
control-cancel
novell-support-iprint
advanced_asp-net-crystal_reports
data_access-xml_web_services
microsoft-public-access
novell-community-chat
state_management
novell-support-netware-6x-abends-hangs
dotnetnuke-getting_started
novell-support-groupwise-6x-gwia
-net_languages-c
novell-support-identity-manager-engine-drivers
novell-support-groupwise-discontinued
advanced_asp-net-architecture
opensuse-org-suse-linux-support-install-configure-administration
dotnetnuke-custom_modules
novell-support-groupwise-7x-install-setup-admin
novell-support-netware-6x-storage-media
novell-support-groupwise-6x-agents
installation_and_setup
data_access-access_databases_and_accessdatasource_control
windows-hosting_open_forum
visual_web_developer_2005_express
novell-support-groupwise-6x-web-access
novell-support-netware-6x-server-backup
macromedia-dreamweaver
novell-support-netware-5x-administration-tools
novell-support-ifolder
novell-support-bordermanager-install-setup
novell-support-imanager
microsoft-public-dotnet-framework-aspnet
novell-support-netware-5x-install-upgrade
novell-support-cluster-services
novell-support-bordermanager-proxies
novell-support-newsflash
advanced_asp-net-sql_server_reporting_services
microsoft-public-dotnet-languages-csharp
web_parts_and_personalization
about_this_site-feedback_on_this_website
ibm-software-websphere-portal-server
novell-support-netware-dns-dhcp
novell-support-zenworks-desktops-4x-app-launcher
-net_languages-visual_basic_-net
advanced_asp-net-custom_server_controls
novell-support-bordermanager-vpn
novell-support-ndps-neps
microsoft-public-sqlserver-programming
novell-support-netware-webserver
community-jobs
novell-support-netware-4x
advanced_asp-net-mobile_and_handheld_devices
internet_explorer_web_controls
novell-support-zenworks-desktops-4x-install-setup
novell-support-edirectory-linux
novell-support-groupwise-7x-gwia
development_tools-web_matrix_general_discussions
microsoft-public-access-formscoding
macromedia-flash
community-announcements
portal_starter_kit
novell-support-zenworks-desktops-4x-management-agent
novell-support-zenworks-patch-management
novell-support-native-file-access
microsoft-public-access-queries
microsoft-public-access-forms
novell-support-groupwise-7x-web-access
novell-support-netware-small-business-6x
data_access-active_directory_and_ldap
novell-support-edirectory-windows
novell-support-groupwise-7x-agents
novell-support-ichain
data_access-oracle
novell-support-zenworks-desktop-management-6x-imaging
novell-support-groupwise-7x-wireless
novell-support-netware-5x-abends-hangs
advanced_asp-net-localization
novell-support-zenworks-desktop-management-7x-imaging-server-nw-win




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: Date Entered: 6/9/2007 6:29:08 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 41 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
"aspnet686" <>
NewsGroup User
Selectable GridView within Content Page not working6/9/2007 6:29:08 PM

0

Hello,

I have been looking at this problem for a couple of days with no luck. I had a selectable gridview in an ordinary web form that was working, but when I converted my solution to use a master page, this one with the selectable gridview stopped working. By stopped working, I mean, when I select a row in the GridView, a postback occurs, but the row isn't selected. Other controls on the form work, such as the command buttons and login control. There are two gridviews on the page, each bound to its own accessdatasource, whose select statements are dynamically generated in the page_load event. Please help!

 
CONTENT PAGE:

 <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" EnableEventValidation="false" AutoEventWireup="true" %>

<script runat="server">
        
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
                        
        ' The first year of use of this application, I noticed a lot of
        ' people were logging out, and then using the back button of
        ' their browser to complete forms. So, data was being submitted
        ' without a login ID. This part prevents that.
        If (Session("ID") Is Nothing) Then
            Session.Clear()
            Response.Redirect("../Default.aspx")
        End If
        
        ' Dynamically set the access-data-source database, based on the year.
        adsStaffProfiles.DataFile = "F:\Databases\McNair\" & Session("year") & " mcnair conference.mdb"
        adsStudentProfiles.DataFile = "F:\Databases\McNair\" & Session("year") & " mcnair conference.mdb"
        
        ' This happens after this group has completed the payment page.
        If Session("payment_info") = "Yes" Then
            lblPayment.Text = "<h3>(Complete)</h3>"
            lblPayment.ForeColor = Drawing.Color.Green
        End If
        
        ' Use this to count the staff in the group, whether they have
        ' cancelled or not.
        adsStaffProfiles.SelectCommand = _
        "SELECT * FROM staff WHERE ID='" & Session("ID") & "'"
                
        grdStaff.DataSourceID = "adsStaffProfiles"
        
        ' Use this to count the students in the group, whether they have
        ' cancelled or not.
        adsStudentProfiles.SelectCommand = _
        "SELECT * FROM student WHERE ID='" & Session("ID") & "'"
        
        grdStudents.DataSourceID = "adsStudentProfiles"
             
        ' We will use this session value in case a new member needs to
        ' be inserted. The member's MemberKey will be set to this.
        Session("group_members") = CType(grdStaff.Rows.Count + grdStudents.Rows.Count, String)
        
        ' Get only the non-cancelled staff.
        adsStaffProfiles.SelectCommand = _
        "SELECT * FROM staff WHERE ID='" & Session("ID") & "' AND cancel='No';"
        
        grdStaff.DataBind()
        
        ' Get only the non-cancelled students.
        adsStudentProfiles.SelectCommand = _
        "SELECT * FROM student WHERE ID='" & Session("ID") & "' AND cancel='No';"
        
        grdStudents.DataBind()
        
        ' Display the right options, depending on whether the group size
        ' limit has been reached.
        If grdStaff.Rows.Count + grdStudents.Rows.Count < CType(Session("group_size"), Integer) Or _
           Session("Exception") = "True" Then
            btnAddStaff.Enabled = True
            btnAddStudent.Enabled = True
            lblAddStaff.Text = ""
            lblAddStudent.Text = ""
        Else
            btnAddStaff.Enabled = False
            btnAddStudent.Enabled = False
            lblAddStaff.Text = "(Group size limit is " & Session("group_size") & ")"
            lblAddStudent.Text = "(Group size limit is " & Session("group_size") & ")"
        End If
                
        ' Retrieve the number of oral and poster presenters from the
        ' database.
        If Session("Exception") = "False" Then
            Session("Orals") = CType(Orals(), String)
            Session("Posters") = CType(Posters(), String)
        End If
                           
    End Sub
    
    ' This sub set the correct options for the staff depending on which
    ' row of the gridview is selected.
    Protected Sub staff_changed(ByVal sender As Object, ByVal e As System.EventArgs)
        
        If grdStaff.SelectedIndex >= 0 Then
            btnUpdateStaff.Enabled = True
        Else
            btnUpdateStaff.Enabled = False
        End If
        
        If staff_done(grdStaff.SelectedIndex()) Then
            btnRemoveStaff.Enabled = True
            lblRemoveStaff.Visible = False
        ElseIf grdStaff.SelectedIndex < 0 Then
            lblRemoveStaff.Visible = False
        Else
            btnRemoveStaff.Enabled = False
            lblRemoveStaff.Visible = True
        End If
        
    End Sub
    
    ' This sub set the correct options for the student depending on which
    ' row of the gridview is selected.
    Protected Sub student_changed(ByVal sender As Object, ByVal e As System.EventArgs)
        
        If grdStudents.SelectedIndex >= 0 Then
            btnUpdateStudent.Enabled = True
        Else
            btnUpdateStudent.Enabled = False
        End If
        
        If student_done(grdStudents.SelectedIndex()) Then
            btnRemoveStudent.Enabled = True
            lblRemoveStudent.Visible = False
        ElseIf grdStudents.SelectedIndex < 0 Then
            lblRemoveStudent.Visible = False
        Else
            btnRemoveStudent.Enabled = False
            lblRemoveStudent.Visible = True
        End If
        
    End Sub
    
    ' Used on logout.
    Protected Sub AbandonSession(ByVal sender As Object, ByVal e As System.EventArgs)
        Session.Abandon()
    End Sub
    
    ' Retrieves the number of poster presenters from the database.
    Protected Function Posters() As Integer
        Dim i As Integer
        Dim sum As Integer
        For i = 0 To grdStudents.Rows.Count - 1
            If grdStudents.Rows(i).Cells(25).Text = "Poster" Then
                sum = sum + 1
            End If
        Next
        Posters = sum
    End Function
    
    ' Retrieves the number of oral presenters from the database.
    Protected Function Orals() As Integer
        Dim i As Integer
        Dim sum As Integer
        For i = 0 To grdStudents.Rows.Count - 1
            If grdStudents.Rows(i).Cells(25).Text = "Oral" Then
                sum = sum + 1
            End If
        Next
        Orals = sum
    End Function
    
    ' This function is used to determine if a staff member has completed
    ' both the contact and lodging forms.
    Protected Function staff_done(ByVal i As Integer) As Boolean

        If (i < 0) Then
            staff_done = False
            Exit Function
        End If
        
        Dim datStaff As System.Data.DataRowView
        datStaff = CType(adsStaffProfiles.Select(DataSourceSelectArguments.Empty), System.Data.DataView).Item(i)
        
        If (datStaff.Item(35).ToString = "Done" And _
            datStaff.Item(36).ToString = "Done") Then
            
            staff_done = True
        Else
            staff_done = False
        End If
    End Function
    
    ' This function is used to determine if a student member has completed
    ' both the contact and lodging forms.
    Protected Function student_done(ByVal i As Integer) As Boolean

        If (i < 0) Then
            student_done = False
            Exit Function
        End If
        
        Dim datStudent As System.Data.DataRowView
        datStudent = CType(adsStudentProfiles.Select(DataSourceSelectArguments.Empty), System.Data.DataView).Item(i)
        
        If (datStudent.Item(45).ToString = "Done" And _
            datStudent.Item(47).ToString = "Done") Then
            
            student_done = True
        Else
            student_done = False
        End If
    End Function
    
    ' This sub makes sure each row has the appropriate fields displayed
    ' for a person. We only want the most important ones displayed, since
    ' there are so many. It also put a select cell at the end of each
    ' row and a label stating whether the member for the row has completed
    ' the required forms.
    Protected Sub format_row(ByVal sender As Object, _
        ByVal e As GridViewRowEventArgs)
        
        Dim SelectCell As New TableCell
        Dim LabelCell As New TableCell
        
        If CType(sender, GridView).ID = "grdStaff" Then
            
            SelectCell.Text = "<a href=javascript:__doPostBack('grdStaff','Select$" & _
                             e.Row.RowIndex & "') class='UpdateLink'>Select</a>"
                        
            If e.Row.Cells(35).Text = "Done" And e.Row.Cells(36).Text = "Done" Then
                LabelCell.Text = "(Complete)"
            Else
                LabelCell.Text = "(Incomplete)"
            End If
        Else
            SelectCell.Text = "<a href=javascript:__doPostBack('grdStudents','Select$" & _
                              e.Row.RowIndex & "') class='UpdateLink'>Select</a>"
            
            If e.Row.Cells(45).Text = "Done" And e.Row.Cells(47).Text = "Done" Then
                LabelCell.Text = "(Complete)"
            Else
                LabelCell.Text = "(Incomplete)"
            End If
        End If
        
        e.Row.Cells(0).Visible = False
        e.Row.Cells(1).Visible = False
        
        If e.Row.Cells(2).Text = "&nbsp;" Then
            e.Row.Cells(2).Text = "(blank)"
            e.Row.Cells(3).Text = "(blank)"
            e.Row.Cells(4).Text = "(blank)"
            e.Row.Cells(5).Text = "(blank)"
            e.Row.Cells(6).Text = "(blank)"
        End If
        
        Dim k As Integer
            
        For k = 7 To e.Row.Cells.Count - 1
            e.Row.Cells(k).Visible = False
        Next
        
        e.Row.Cells.Add(SelectCell)
        e.Row.Cells.Add(LabelCell)
        
    End Sub
    
    ' Executed when the update staff button is clicked. Loads the staff
    ' member's data and goes to the next page.
    Protected Sub UpdateStaff(ByVal sender As Object, ByVal e As System.EventArgs)
        CreateStaffSession(grdStaff.SelectedIndex)
        Response.Redirect("Staff/Default.aspx")
    End Sub

    ' Executed when the remove staff button is clicked. We first load the
    ' appropriate values and then navigate to the cancel page.
    Protected Sub RemoveStaff(ByVal sender As Object, ByVal e As System.EventArgs)
        Session("Key") = grdStaff.Rows(grdStaff.SelectedIndex).Cells(1).Text
        Session("txtFirstName") = grdStaff.Rows(grdStaff.SelectedIndex).Cells(2).Text
        Session("txtLastName") = grdStaff.Rows(grdStaff.SelectedIndex).Cells(4).Text
        Session("Amount") = grdStaff.Rows(grdStaff.SelectedIndex).Cells(28).Text
        Session("StaffORStudent") = "Staff"
        Response.Redirect("Cancel.aspx")
    End Sub
    
    ' Executed when the update student button is clicked. Loads the student
    ' member's data and goes to the next page.
    Protected Sub UpdateStudent(ByVal sender As Object, ByVal e As System.EventArgs)
        CreateStudentSession(grdStudents.SelectedIndex)
        Response.Redirect("Student/Default.aspx")
    End Sub
    
    ' Executed when the remove student button is clicked. We first load the
    ' appropriate values and then navigate to the cancel page.
    Protected Sub RemoveStudent(ByVal sender As Object, ByVal e As System.EventArgs)
        Session("Key") = grdStudents.Rows(grdStudents.SelectedIndex).Cells(1).Text
        Session("txtFirstName") = grdStudents.Rows(grdStudents.SelectedIndex).Cells(2).Text
        Session("txtLastName") = grdStudents.Rows(grdStudents.SelectedIndex).Cells(4).Text
        Session("Amount") = grdStudents.Rows(grdStudents.SelectedIndex).Cells(38).Text
        Session("StaffORStudent") = "Student"
        Response.Redirect("Cancel.aspx")
    End Sub
    
    ' Used when we need to update a staff member. Loads all of the
    ' staff member's data into the appropriate session variables.
    Protected Sub CreateStaffSession(ByVal i As Integer)

        Dim datStaff As System.Data.DataRowView
        datStaff = CType(adsStaffProfiles.Select(DataSourceSelectArguments.Empty), System.Data.DataView).Item(i)
        
        Session("Key") = datStaff.Item(1).ToString
        
        Session("AtCapacity") = datStaff.Item(34).ToString
        Session("contact_info") = datStaff.Item(35).ToString
        Session("lodging_plans") = datStaff.Item(36).ToString
        
        If Session("contact_info") = "Done" Then
            Session("txtAddress") = datStaff.Item(21).ToString
            Session("txtCity") = datStaff.Item(22).ToString
            Session("ddlStates") = datStaff.Item(23).ToString
            Session("txtZip") = datStaff.Item(24).ToString
            Session("txtAreaCode") = Mid(datStaff.Item(25).ToString, 2, 3)
            Session("txtPhone1") = Mid(datStaff.Item(25).ToString, 7, 3)
            Session("txtPhone2") = Right(datStaff.Item(25).ToString, 4)
            Session("txtFaxArea") = Mid(datStaff.Item(26).ToString, 2, 3)
            Session("txtFax1") = Mid(datStaff.Item(26).ToString, 7, 3)
            Session("txtFax2") = Right(datStaff.Item(26).ToString, 4)
            Session("txtEmail") = datStaff.Item(27).ToString
        End If
        
        If Session("lodging_plans") = "Done" Then
            Session("txtFirstName") = datStaff.Item(2).ToString
            Session("txtMiddleName") = datStaff.Item(3).ToString
            Session("txtLastName") = datStaff.Item(4).ToString
            Session("txtTitle") = datStaff.Item(5).ToString
            Session("txtInstitution") = datStaff.Item(6).ToString
            Session("rblModerator") = datStaff.Item(7).ToString
            Session("rblRoom") = datStaff.Item(8).ToString
            Session("rblExhibitor") = datStaff.Item(9).ToString
            
            If (Session("rblExhibitor") = "Yes") Then
                Session("txtCollege") = datStaff.Item(10).ToString
                Session("txtDescription") = datStaff.Item(11).ToString
            End If
            
            Session("txtRoommate1First") = datStaff.Item(12).ToString
            Session("txtRoommate1Middle") = datStaff.Item(13).ToString
            Session("txtRoommate1Last") = datStaff.Item(14).ToString
            Session("txtRoommate2First") = datStaff.Item(15).ToString
            Session("txtRoommate2Middle") = datStaff.Item(16).ToString
            Session("txtRoommate2Last") = datStaff.Item(17).ToString
            Session("txtRoommate3First") = datStaff.Item(18).ToString
            Session("txtRoommate3Middle") = datStaff.Item(19).ToString
            Session("txtRoommate3Last") = datStaff.Item(20).ToString
            
            Session("Amount") = datStaff.Item(28).ToString
            Response.Write(Session("Amount"))
        End If
                
        Session("date_submitted") = datStaff.Item(29).ToString
        Session("Update") = "True"
    End Sub
    
    ' Used when we need to update a student member. Loads all of the
    ' student member's data into the appropriate session variables.
    Protected Sub CreateStudentSession(ByVal i As Integer)
        
        Dim datStudent As System.Data.DataRowView
        datStudent = CType(adsStudentProfiles.Select(DataSourceSelectArguments.Empty), System.Data.DataView).Item(i)
        
        Session("Key") = datStudent.Item(1).ToString
        
        Session("AtCapacity") = datStudent.Item(44).ToString
        Session("contact_info") = datStudent.Item(45).ToString
        Session("presenter") = datStudent.Item(46).ToString
        Session("lodging_plans") = datStudent.Item(47).ToString
        
        If Session("contact_info") = "Done" Then
            Session("txtAddress") = datStudent.Item(18).ToString
            Session("txtCity") = datStudent.Item(19).ToString
            Session("ddlStates") = datStudent.Item(20).ToString
            Session("txtZip") = datStudent.Item(21).ToString
            Session("txtAreaCode") = Mid(datStudent.Item(22).ToString, 2, 3)
            Session("txtPhone1") = Mid(datStudent.Item(22).ToString, 7, 3)
            Session("txtPhone2") = Right(datStudent.Item(22).ToString, 4)
            Session("txtEmail") = datStudent.Item(23).ToString
            Session("txtMajor") = datStudent.Item(24).ToString
        End If
        
        If Session("presenter") = "Done" Then
            Session("rblPresType") = datStudent.Item(25).ToString
            Session("txtTitle") = datStudent.Item(26).ToString
            Session("txtResDept") = datStudent.Item(27).ToString
            Session("txtAbstract") = datStudent.Item(28).ToString
            Session("txtMentorFirst") = datStudent.Item(29).ToString
            Session("txtMentorMiddle") = datStudent.Item(30).ToString
            Session("txtMentorLast") = datStudent.Item(31).ToString
            Session("txtMentDisc") = datStudent.Item(32).ToString
            Session("txtMentInst") = datStudent.Item(33).ToString
            Session("chkEquipment1") = datStudent.Item(34).ToString
            Session("chkEquipment2") = datStudent.Item(35).ToString
            Session("chkEquipment3") = datStudent.Item(36).ToString
            Session("chkEquipment4") = datStudent.Item(37).ToString
        End If
        
        If Session("lodging_plans") = "Done" Then
            Session("txtFirstName") = datStudent.Item(2).ToString
            Session("txtMiddleName") = datStudent.Item(3).ToString
            Session("txtLastName") = datStudent.Item(4).ToString
            Session("rblSex") = datStudent.Item(5).ToString
            Session("txtStuInst") = datStudent.Item(6).ToString
            Session("rblModerator") = datStudent.Item(7).ToString
            Session("rblRoom") = datStudent.Item(8).ToString
            
            Session("txtRoommate1First") = datStudent.Item(9).ToString
            Session("txtRoommate1Middle") = datStudent.Item(10).ToString
            Session("txtRoommate1Last") = datStudent.Item(11).ToString
            Session("txtRoommate2First") = datStudent.Item(12).ToString
            Session("txtRoommate2Middle") = datStudent.Item(13).ToString
            Session("txtRoommate2Last") = datStudent.Item(14).ToString
            Session("txtRoommate3First") = datStudent.Item(15).ToString
            Session("txtRoommate3Middle") = datStudent.Item(16).ToString
            Session("txtRoommate3Last") = datStudent.Item(17).ToString
            
            Session("Amount") = datStudent.Item(38).ToString
        End If
                
        Session("date_submitted") = datStudent.Item(39).ToString
        Session("Update") = "True"
    End Sub
        
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
    <div style="text-align:center;">
    
    <p>
        Please note: If you are a staff member who would like to
        register for the Graduate Fair as well, simply register
        as a staff member and check the provided option on the
        staff registration form indicating that you are attending
        the Graduate Fair. ($<%=session("priceGradFair")%> fee
        for the Graduate Fair will be added to your charge.)
    </p>        
    
    <p><b>
        Also, registration for each member is not complete until
        all of his/her sections have been completed.
    </b></p>
    
    <asp:Panel ID="pnlStaff" runat="server" CssClass="aspPanelMembers" BorderColor="Black" BorderStyle="Double" BorderWidth="4px">
        <h3>Staff Members in your group:</h3>
        <asp:GridView ID="grdStaff" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" ShowHeader="false" OnSelectedIndexChanged="staff_changed" CssClass="aspGridView" OnRowDataBound="format_row">
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:AccessDataSource ID="adsStaffProfiles" runat="server" />
        <br />
        <asp:Button ID="btnUpdateStaff" runat="server" Text="Update Selected Staff Member" Width="200px"
            OnClick="UpdateStaff" Enabled="False" />
        <br />
        <asp:Button ID="btnRemoveStaff" runat="server" Text="Remove Selected Staff Member" Width="200px"
            OnClick="RemoveStaff" Enabled="False" />
        <asp:Label ID="lblRemoveStaff" runat="server" Text="(must finish all sections first)" Visible="False"></asp:Label>   
        <br />
        <asp:Button ID="btnAddStaff" runat="server" Text="Add New Staff Member" PostBackUrl="~/ManagerMain/Staff/Default.aspx" Width="150px" Enabled="False" />
        <asp:Label ID="lblAddStaff" runat="server"></asp:Label>
    </asp:Panel>
    
    <br />
    
    <asp:Panel ID="pnlStudents" runat="server" CssClass="aspPanelMembers" BorderColor="Black" BorderStyle="Double" BorderWidth="4px">
        <h3>Students in your group:</h3>        
        <asp:GridView OnSelectedIndexChanged="student_changed" ShowHeader="False" CssClass="aspGridView" ID="grdStudents" runat="server" OnRowDataBound="format_row" CellPadding="4" ForeColor="#333333" GridLines="None">
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />            
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>            
        <asp:AccessDataSource ID="adsStudentProfiles" runat="server" />
        <br />
        <asp:Button ID="btnUpdateStudent" runat="server" Text="Update Selected Student" Width="170px"
            OnClick="UpdateStudent" Enabled="False" />
        <br />
        <asp:Button ID="btnRemoveStudent" runat="server" Text="Remove Selected Student" Width="170px"
            OnClick="RemoveStudent" Enabled="False" />
        <asp:Label ID="lblRemoveStudent" runat="server" Text="(must finish all sections first)" Visible="False"></asp:Label>   
        <br />
        <asp:Button ID="btnAddStudent" runat="server" Text="Add New Student" PostBackUrl="~/ManagerMain/Student/Default.aspx" Width="120px" Enabled="False" />
        <asp:Label ID="lblAddStudent" runat="server"></asp:Label>
    </asp:Panel>
    
    <br />
    
    <asp:Panel ID="pnlPayment" runat="server" CssClass="aspPanelPayment" BorderColor="Black" BorderStyle="Double" BorderWidth="4px">
        <p>
            Payment information for your group can be provided by
            clicking on the button below.
        </p>
        <p>
            <asp:Label ID="lblPayment" runat="server"
                       Text="<h3>(Incomplete)</h3>"
                       ForeColor="Red" />                           
        </p>            
        <p>
            <asp:Button ID="btnPay"
                        runat="server"
                        Text="Payment"
                        PostBackUrl="~/ManagerMain/PaymentInfo.aspx"/>
        </p>
    </asp:Panel>        
    <br />        
    <asp:LoginStatus ID="LoginStatus1" runat="server"
        LogoutAction="Redirect"
        LogoutPageUrl="~/Default.aspx"
        OnLoggedOut="AbandonSession" />
        
    </div>
    
</asp:Content>

MASTER PAGE:

 <%@ Master Language="VB" %>
<%@ Register Assembly="SmartScroller" Namespace="sstchur.web.SmartNav" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script type="text/javascript" language="javascript">

    // Used to count the number of words in the description.
    function WordCount()
    {
        var text = document.getElementById('ctl00_ContentPlaceHolder1_txtDescription');
        var display = document.getElementById('ctl00_ContentPlaceHolder1_txtWords');

        var pattern = /\s+/;
        var word_array = text.value.split(pattern);
      
        if (text.value == '')
            display.value = "0 words";
        else
            display.value = word_array.length + " words";
       
        if (word_array.length > 300)
            display.style.color="red";
        else
            display.style.color="black";           
    }
       
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title><%=Session("year")%> National McNair Research Conference & Graduate School Fair</title>   
    <link type="text/css" rel="Stylesheet" href="styles/styles.css" />
    <link rel="shortcut icon" href="../../images/omsaicon.ico" type="image/x-icon" />
    <script language="JavaScript" type="text/javascript"></script>
</head>
<body>
   
    <div id="banner">
        <div id="logo" align="center">
            <img src="http://www.omsa.uiuc.edu/annualevents/mcnair_app/images/header2.gif" alt="Office of Minority Student Affairs" width="750" height="113" />
        </div>
    </div>
   
    <a href="http://www.uiuc.edu/"
       id="uiLogo"
       target="_blank">
            <img src="http://www.omsa.uiuc.edu/images/vsmlformal.gif"
                 alt="University of Illinois at Urbana-Champaign"
                 align="top"
                 border="0"
                 width="35"
                 height="46"/>
    </a>
   
    <div id="McNair">
        <img src="http://www.omsa.uiuc.edu/annualevents/mcnair_app/images/mcnairsmall.JPG" alt="Ronald E. McNair" width="149" height="173" />
    </div>
   
    <div id="McNairLogo">
        <img src="http://www.omsa.uiuc.edu/annualevents/mcnair_app/images/mcnairlogo.PNG" alt="McNair Logo" width="92" height="92" />
    </div>
   
    <form id="form1" runat="server">
        <asp:contentplaceholder id="ContentPlaceHolder1" runat="server" />
        <cc1:SmartScroller ID="SmartScroller1" runat="server" />
    </form>
   
    <br /><br />
</body>
</html>

 

"Amanda Wang -
NewsGroup User
Re: Selectable GridView within Content Page not working6/12/2007 7:40:05 AM

0

Hi,

If you want to select a row in the gridview , you should add a new colum of SelectButton. When you click on the selectButton, the row will be sselected.

    <asp:GridView ID="grdStaff" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" ShowHeader="False" OnSelectedIndexChanged="staff_changed" CssClass="aspGridView" OnRowDataBound="format_row" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="Location" HeaderText="Location" SortExpression="Location" />
                <asp:BoundField DataField="Job" HeaderText="Job" SortExpression="Job" />
                <asp:CommandField ShowSelectButton="True" />
            </Columns>
        </asp:GridView>
 
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
"aspnet686" <>
NewsGroup User
Re: Selectable GridView within Content Page not working6/12/2007 6:44:12 PM

0

Amanda,

 Thanks for your reply. I can't use this method since I programmatically specify the select statement for the access data source and bind the grid view to it. What I was originally doing before switching to a master page was programmatically hiding certain fields of the gridview and then adding a select link to the end. You can see this if you look at my format_row method, which is called on the rowdatabound event of the gridviews. When adding the select link to the end of each row I was setting its text property to "<a href=javascript:__doPostBack('grdStaff','Select$" which was working just fine. But, when I switched to use a master page, I forgot that the id's of controls are changed, so I had to change the text of the select link to "<a href=javascript:__doPostBack('ctl00$ContentPlaceHolder1$grdStaff','Select$". This works just fine now.

 - Ray

 

"Amanda Wang -
NewsGroup User
Re: Selectable GridView within Content Page not working6/13/2007 1:39:03 AM

0

Hi Ray,

I am very glad to hear your problem has been solved, Thank you for sharing the solution!   Smile.

 

Thanks


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:













web.sitemap

we don't need a templated gui.. do we still have to use master pages?

how to recreate the www.asp.net menu bar using a menu control?

smallbusiness masterpage not displaying properly

master page events and user controls

menu/treeview hybrid site navigation?

access my user control from a nested master

how to set nodeindex of treeview at page_load ?

add dynamic controls to a content control??

how to use sitemap in webcontrols

disable asp:menu items

css and master pages - help!

trouble linking a menu control using sitemap datasource to multiview control?

1 master page or several?

child elements do not display with menu control

treeview frozen

does asp .net support javascript?

i need some help with the asp:menu control

hiding controls in form master when certain contents loaded?

using wildcards in sitemap when doing url-rewriting and using menu-control

how can i remove meta tags in the head tag

css not applied in any pages with a theme

tree view

web.config themepreference

recompile behavior on master page update

how to display certain levels in a treeview menu?

databound menu-selected item style

how to simulate treeview checkbox as radio button?

how to change the layout of a treeview component to this?

height of the page is an issue at runtime

why can i set some properties of controls using skins, while the other i can`t

access to smart tags and creating event stubs when using nested master pages

sitemap question

max nodes in a treeview.

collapse a parent treenode by clicking on the text

theme, master page

image disppeared from master page!!

using master and content pages to simulate html frames

parent nodes disappear when hover over child node in menu

templates?

accessing master page methods in user controls

how do i use absolute positioning in content?

how to increase child page height inherits master page

site maps roles and query strings

treeview control node text

question on menu contorl, cannot make it horizontal?

for a customisation theme....skin takes precedence but css does not. please explain.

how do i disabled back button in ie for master.page, those who have content pages

create menu individual for each user. how to?

need help using skmmenu.

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT