<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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 id="Head1" runat="server">
	<title></title>
	<style type="text/css">
		html, body, form
		{
			margin: 0;
			height: 100%;
			overflow: hidden;
		}
	</style>
	<script type="text/javascript">

	

	</script>
</head>
<body>
	<form id="form1" runat="server">
	<telerik:RadScriptManager ID="ScriptManager1" runat="server" />
	<telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server" />
	<div style="display: none;">
		<input type="hidden" runat="server" id="TextGenID" />
		<input type="hidden" runat="server" id="TextGrpID" />
		<input type="hidden" runat="server" id="TextDateID" />
	</div>
	<div id="gridDiv">
		<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
		</telerik:RadAjaxLoadingPanel>
		<telerik:RadGrid ID="gridAllergies" runat="server" CellSpacing="0" GridLines="None" OnNeedDataSource="RadGrid_NeedDataSource">
			<ClientSettings>
				<Selecting CellSelectionMode="None"></Selecting>
			</ClientSettings>
			<MasterTableView CommandItemDisplay="Top">
				<CommandItemSettings ExportToPdfText="Export to PDF" AddNewRecordText="Ajouter" RefreshText="Rafraîchir">
				</CommandItemSettings>
				<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
				</RowIndicatorColumn>
				<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
				</ExpandCollapseColumn>
				<Columns>
					<telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
						ButtonType="ImageButton" EditText="Modifier" Resizable="False" HeaderStyle-Width="46px"
						EditImageUrl="Images/Icons/006-Write-New-Icon.png">
						<HeaderStyle Width="32px"></HeaderStyle>
					</telerik:GridEditCommandColumn>
					<telerik:GridButtonColumn CommandName="Delete" ConfirmText="Êtez-vous sûr de vouloir supprimer?"
						FilterControlAltText="Filter column column" Text="Supprimer" UniqueName="colDelete"
						ButtonType="ImageButton" ImageUrl="Images/Icons/059-Close-Delete-circle-Icon.png"
						HeaderStyle-Width="46px" ConfirmDialogType="Classic">
						<HeaderStyle Width="32px"></HeaderStyle>
					</telerik:GridButtonColumn>
					<telerik:GridBoundColumn DataField="palg_noauto" FilterControlAltText="Filter column1 column"
						UniqueName="colNoAuto" Visible="False" ReadOnly="True">
					</telerik:GridBoundColumn>
					<telerik:GridBoundColumn DataField="allergie" FilterControlAltText="Filter column2 column"
						HeaderText="Allergie" UniqueName="colAllergie" CurrentFilterFunction="StartsWith"
						FilterDelay="700" ShowFilterIcon="false" ReadOnly="True">
					</telerik:GridBoundColumn>
					<telerik:GridCheckBoxColumn DataField="isGroupe" DataType="System.Boolean" FilterControlAltText="Filter column column"
						HeaderText="Groupe" ReadOnly="True" UniqueName="colIsGroupe" ShowFilterIcon="false"
						AllowFiltering="False">
						<ItemStyle HorizontalAlign="Center" />
					</telerik:GridCheckBoxColumn>
					<telerik:GridDateTimeColumn DataField="Date" FilterControlAltText="Filter column3 column"
						HeaderText="Date" UniqueName="colDate" CurrentFilterFunction="StartsWith" FilterDelay="700"
						ShowFilterIcon="false" DataType="System.String" EditFormHeaderTextFormat="">
					</telerik:GridDateTimeColumn>
					<telerik:GridDropDownColumn FilterControlAltText="Filter column8 column" UniqueName="colGenerique"
						ListValueField="gene_numero" ListTextField="gene_nom" ShowFilterIcon="False"
						Visible="False" HeaderText="Generique" DropDownControlType="RadComboBox" DataField="gene_numero">
					</telerik:GridDropDownColumn>
					<telerik:GridDropDownColumn FilterControlAltText="Filter column7 column" UniqueName="colGroupeDesc"
						ListValueField="gral_numero" ListTextField="gral_description" ShowFilterIcon="False"
						Visible="False" HeaderText="Groupe" DropDownControlType="RadComboBox" DataField="gral_numero">
					</telerik:GridDropDownColumn>
					<telerik:GridBoundColumn DataField="palg_texte_1" FilterControlAltText="Filter column4 column"
						UniqueName="colTexte1" CurrentFilterFunction="StartsWith" FilterDelay="700" ShowFilterIcon="false"
						HeaderText="Texte1">
					</telerik:GridBoundColumn>
					<telerik:GridBoundColumn DataField="palg_texte_2" FilterControlAltText="Filter column5 column"
						HeaderText="Texte2" UniqueName="colTexte2" CurrentFilterFunction="StartsWith"
						FilterDelay="700" ShowFilterIcon="false">
					</telerik:GridBoundColumn>
					<telerik:GridCheckBoxColumn DataField="isImprime" FilterControlAltText="Filter colImprimer column"
						HeaderText="Imprimer" UniqueName="colImprimer" Visible="False">
					</telerik:GridCheckBoxColumn>
				</Columns>
				<SortExpressions>
					<telerik:GridSortExpression FieldName="allergie" SortOrder="Ascending" />
				</SortExpressions>
				<EditFormSettings>
					<EditColumn ButtonType="PushButton" CancelText="Annuler" UpdateText="Enregistrer"
						InsertText="Ajouter" FilterControlAltText="Filter EditCommandColumn column">
					</EditColumn>
				</EditFormSettings>
			</MasterTableView>
			<FilterMenu EnableImageSprites="False">
			</FilterMenu>
			<EditItemStyle BackColor="Silver" />
		</telerik:RadGrid>
	</div>
	<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
		<script type="text/javascript">
        <!--

			function Validate() {
				//                var cboGen = $find($get('<%=TextGenID.ClientID%>').value);
				//                var cboGrp = $find($get('<%=TextGrpID.ClientID%>').value);
				//                var pkDate = $find($get('<%=TextDateID.ClientID%>').value);
				//                var isValid = true;

				//                cboGen.get_inputDomElement().style.backgroundColor = "";
				//                cboGrp.get_inputDomElement().style.backgroundColor = "";

				//                if (cboGen.get_text() == "" && cboGrp.get_text() == "") {
				//                    cboGen.get_inputDomElement().style.backgroundColor = "#E77471";
				//                    cboGrp.get_inputDomElement().style.backgroundColor = "#E77471";
				//                    isValid = false;
				//                }

				//                if (pkDate.get_selectedDate() == null) {
				//                    pkDate.get_textBox().style.backgroundColor = "#E77471";
				//                    isValid = false;
				//                }
				alert("allo");
				return true;
			}

			function GenSelectionChanged(sender, eventArgs) {
				var cbo = $find($get('<%=TextGrpID.ClientID%>').value);
				if (sender.get_text() != "" && cbo.get_text() != "") {
					cbo.findItemByText("").select();
				}
			}

			function GrpSelectionChanged(sender, eventArgs) {
				var cbo = $find($get('<%=TextGenID.ClientID%>').value);
				if (sender.get_text() != "" && cbo.get_text() != "") {
					cbo.findItemByText("").select();
				}
			}

			function Resize() {
				var grid = $find("<%= gridAllergies.ClientID %>");
				ResizeRadControl(grid, 0);
			}

			function OnResponseEnd(sender, args) {
				Resize();
			}
            -->
		</script>
	</telerik:RadCodeBlock>
	</telerik:RadCodeBlock>
	</form>
</body>
</html>
