<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="frm_AgregarUsuariosExamen.aspx.vb" Inherits="SGHweb.frm_AgregarUsuariosExamen" %>

<!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></title>
<link href="../Styles/Examen.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
  <!-- noty -->
  <script type="text/javascript" src="../Scripts/noty/jquery.noty.js"></script>
  <!-- themes -->
  <script type="text/javascript" src="../Scripts/noty/themes/default.js"></script>
  <script type="text/javascript" src="../Scripts/noty/layouts/center.js"></script>
  <link rel="stylesheet" type="text/css" href="../Scripts/noty/buttons.css" />

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
        <script type="text/javascript">

            function generate_success(type, texto) {
                var n = noty({
                    text: texto,
                    type: type,
                    dismissQueue: false,
                    layout: 'center',
                    modal: true,
                    theme: 'defaultTheme',
                    buttons: [
                            { addClass: 'btn btn-primary', text: 'Ok', onClick: function ($noty) {
                                $noty.close();
                                Close();
                            }
                            },
                          ]
                });
                console.log(type + ' - ' + n.options.id);
                return n;
            }

            function mostrar_alerta_success(texto) {
                $(document).ready(function () {
                    ///////////////////////
                    // alert             //
                    //  information      //
                    //   error           //
                    //    warning        //
                    //     notification  //
                    ///////////////////////

                    var success = generate_success('notification', texto);

                    setTimeout(function () {
                        $.noty.setText(success.options.id, texto);
                    }, 1000);
                });
            }
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow)
                    oWindow = window.radWindow;
                else if (window.frameElement.radWindow)
                    oWindow = window.frameElement.radWindow;
                return oWindow;
            }

            function Close() {
                var oWindow = GetRadWindow();
                oWindow.argument = null;
                oWindow.close();
                return false;
            }
            var selected = {};
            function RadGrid_RowSelected(sender, args) {
                var UsuarioID = args.getDataKeyValue("UsuarioID");
                if (!selected[UsuarioID]) {
                    selected[UsuarioID] = true;
                }
            }
            function RadGrid_RowDeselected(sender, args) {
                var UsuarioID = args.getDataKeyValue("UsuarioID");
                if (selected[UsuarioID]) {
                    selected[UsuarioID] = null;
                }
            }
            function RadGrid_RowCreated(sender, args) {
                var UsuarioID = args.getDataKeyValue("UsuarioID");
                if (selected[UsuarioID]) {
                    args.get_gridDataItem().set_selected(true);
                }
            }
            function GridCreated(sender, eventArgs) {
                var masterTable = sender.get_masterTableView(),
              headerCheckBox = $telerik.$(masterTable.HeaderRow).find(":checkbox")[0];

                if (headerCheckBox) {
                    headerCheckBox.checked = masterTable.get_selectedItems().length == masterTable.get_pageSize();
                }


            }
        </script>
 </telerik:RadCodeBlock>
</head>
<body>
    
    <form id="form1" runat="server">
    
    <div>
        
<telerik:RadGrid ID="RadGrid1" runat="server" Culture="es-ES" 
            DataSourceID="SqlDataSource_listadoUsuarios" AllowMultiRowSelection="True" 
            Skin="Windows7">
            <ClientSettings>
            <Selecting AllowRowSelect="True" 
                    CellSelectionMode="None" UseClientSelectColumnOnly="True" />
                        <ClientEvents 

                        OnGridCreated="GridCreated" OnRowCreated="RadGrid_RowCreated" 
                        OnRowDeselected="RadGrid_RowDeselected" OnRowSelected="RadGrid_RowSelected" />

                        <Selecting 
                            AllowRowSelect="True" CellSelectionMode="None" 
                            UseClientSelectColumnOnly="True" />

                        <ClientEvents 
                            OnGridCreated="GridCreated" OnRowCreated="RadGrid_RowCreated" 
                            OnRowDeselected="RadGrid_RowDeselected" OnRowSelected="RadGrid_RowSelected" />

                        <Scrolling UseStaticHeaders="True" />
            </ClientSettings>

<MasterTableView AutoGenerateColumns="False" DataKeyNames="UsuarioID" 
                DataSourceID="SqlDataSource_listadoUsuarios">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

    <Columns>
        <telerik:GridClientSelectColumn 
            UniqueName="CheckboxSelectColumn">
        </telerik:GridClientSelectColumn>
        <telerik:GridBoundColumn DataField="UsuarioID" DataType="System.Int32" 
            FilterControlAltText="Filter UsuarioID column" HeaderText="UsuarioID" 
            ReadOnly="True" SortExpression="UsuarioID" UniqueName="UsuarioID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="NombreUsuario" 
            FilterControlAltText="Filter NombreUsuario column" HeaderText="NombreUsuario" 
            SortExpression="NombreUsuario" UniqueName="NombreUsuario">
        </telerik:GridBoundColumn>
    </Columns>

<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>

<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
        
        <telerik:RadButton ID="RadButton1" runat="server" Text="Guardar">
        </telerik:RadButton>        

        <asp:SqlDataSource ID="SqlDataSource_listadoUsuarios" runat="server" 
            
            SelectCommand="SELECT [UsuarioID], [NombreUsuario] FROM [Usuarios]">
        </asp:SqlDataSource>
    
    </div>
    
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    </form>
    
</body>
</html>
