using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace LLNet.Controls
{
	/// <summary>
	/// Summary description for dlgAdvancedList.
	/// </summary>
	public class dlgAdvancedList : System.Windows.Forms.Form
	{
		public DevExpress.XtraGrid.GridControl Grid;
		private DevExpress.XtraGrid.Views.Grid.GridView gridView1;
		public System.Data.DataView dataView;
		public LLNet.Controls.LLToolbar llToolbar;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public dlgAdvancedList()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
			llToolbar.tblChanges.Visible = false;
			llToolbar.btnAdvancedQuery.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
			llToolbar.cbMyFilters.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
			llToolbar.btnSaveQuery.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; 
		}

	/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.Grid = new DevExpress.XtraGrid.GridControl();
			this.gridView1 = new DevExpress.XtraGrid.Views.Grid.GridView();
			this.dataView = new System.Data.DataView();
			this.llToolbar = new LLNet.Controls.LLToolbar();
			((System.ComponentModel.ISupportInitialize)(this.Grid)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.gridView1)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.dataView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.llToolbar)).BeginInit();
			this.SuspendLayout();
			// 
			// Grid
			// 
			this.Grid.Dock = System.Windows.Forms.DockStyle.Fill;
			// 
			// Grid.EmbeddedNavigator
			// 
			this.Grid.EmbeddedNavigator.Name = "";
			this.Grid.Location = new System.Drawing.Point(0, 25);
			this.Grid.MainView = this.gridView1;
			this.Grid.Name = "Grid";
			this.Grid.Size = new System.Drawing.Size(792, 549);
			this.Grid.TabIndex = 4;
			this.Grid.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
																								this.gridView1});
			this.Grid.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Grid_KeyDown);
			this.Grid.EditorKeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Grid_EditorKeyPress);
			this.Grid.DoubleClick += new System.EventHandler(this.Grid_DoubleClick);
			this.Grid.EditorKeyDown += new System.Windows.Forms.KeyEventHandler(this.Grid_EditorKeyDown);
			// 
			// gridView1
			// 
			this.gridView1.Appearance.ColumnFilterButton.BackColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.ColumnFilterButton.BackColor2 = System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(212)), ((System.Byte)(212)));
			this.gridView1.Appearance.ColumnFilterButton.BorderColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.ColumnFilterButton.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.ColumnFilterButton.ForeColor = System.Drawing.Color.Gray;
			this.gridView1.Appearance.ColumnFilterButton.Options.UseBackColor = true;
			this.gridView1.Appearance.ColumnFilterButton.Options.UseBorderColor = true;
			this.gridView1.Appearance.ColumnFilterButton.Options.UseFont = true;
			this.gridView1.Appearance.ColumnFilterButton.Options.UseForeColor = true;
			this.gridView1.Appearance.ColumnFilterButtonActive.BackColor = System.Drawing.Color.LightGray;
			this.gridView1.Appearance.ColumnFilterButtonActive.BackColor2 = System.Drawing.Color.WhiteSmoke;
			this.gridView1.Appearance.ColumnFilterButtonActive.BorderColor = System.Drawing.Color.LightGray;
			this.gridView1.Appearance.ColumnFilterButtonActive.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBackColor = true;
			this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseBorderColor = true;
			this.gridView1.Appearance.ColumnFilterButtonActive.Options.UseFont = true;
			this.gridView1.Appearance.DetailTip.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(225)));
			this.gridView1.Appearance.DetailTip.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.DetailTip.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.DetailTip.Options.UseBackColor = true;
			this.gridView1.Appearance.DetailTip.Options.UseFont = true;
			this.gridView1.Appearance.DetailTip.Options.UseForeColor = true;
			this.gridView1.Appearance.Empty.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243)));
			this.gridView1.Appearance.Empty.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.Empty.ForeColor = System.Drawing.Color.White;
			this.gridView1.Appearance.Empty.Options.UseBackColor = true;
			this.gridView1.Appearance.Empty.Options.UseFont = true;
			this.gridView1.Appearance.Empty.Options.UseForeColor = true;
			this.gridView1.Appearance.EvenRow.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(223)), ((System.Byte)(223)), ((System.Byte)(223)));
			this.gridView1.Appearance.EvenRow.BackColor2 = System.Drawing.Color.GhostWhite;
			this.gridView1.Appearance.EvenRow.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.EvenRow.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.EvenRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal;
			this.gridView1.Appearance.EvenRow.Options.UseBackColor = true;
			this.gridView1.Appearance.EvenRow.Options.UseFont = true;
			this.gridView1.Appearance.EvenRow.Options.UseForeColor = true;
			this.gridView1.Appearance.FilterCloseButton.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200)));
			this.gridView1.Appearance.FilterCloseButton.BackColor2 = System.Drawing.Color.FromArgb(((System.Byte)(118)), ((System.Byte)(170)), ((System.Byte)(225)));
			this.gridView1.Appearance.FilterCloseButton.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200)));
			this.gridView1.Appearance.FilterCloseButton.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.FilterCloseButton.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.FilterCloseButton.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal;
			this.gridView1.Appearance.FilterCloseButton.Options.UseBackColor = true;
			this.gridView1.Appearance.FilterCloseButton.Options.UseBorderColor = true;
			this.gridView1.Appearance.FilterCloseButton.Options.UseFont = true;
			this.gridView1.Appearance.FilterCloseButton.Options.UseForeColor = true;
			this.gridView1.Appearance.FilterPanel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(28)), ((System.Byte)(80)), ((System.Byte)(135)));
			this.gridView1.Appearance.FilterPanel.BackColor2 = System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200)));
			this.gridView1.Appearance.FilterPanel.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.FilterPanel.ForeColor = System.Drawing.Color.White;
			this.gridView1.Appearance.FilterPanel.Options.UseBackColor = true;
			this.gridView1.Appearance.FilterPanel.Options.UseFont = true;
			this.gridView1.Appearance.FilterPanel.Options.UseForeColor = true;
			this.gridView1.Appearance.FixedLine.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(58)), ((System.Byte)(58)), ((System.Byte)(58)));
			this.gridView1.Appearance.FixedLine.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.FixedLine.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.FixedLine.Options.UseBackColor = true;
			this.gridView1.Appearance.FixedLine.Options.UseFont = true;
			this.gridView1.Appearance.FixedLine.Options.UseForeColor = true;
			this.gridView1.Appearance.FocusedCell.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(225)));
			this.gridView1.Appearance.FocusedCell.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.FocusedCell.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.FocusedCell.Options.UseBackColor = true;
			this.gridView1.Appearance.FocusedCell.Options.UseFont = true;
			this.gridView1.Appearance.FocusedCell.Options.UseForeColor = true;
			this.gridView1.Appearance.FocusedRow.BackColor = System.Drawing.Color.Navy;
			this.gridView1.Appearance.FocusedRow.BackColor2 = System.Drawing.Color.FromArgb(((System.Byte)(50)), ((System.Byte)(50)), ((System.Byte)(178)));
			this.gridView1.Appearance.FocusedRow.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.FocusedRow.ForeColor = System.Drawing.Color.White;
			this.gridView1.Appearance.FocusedRow.Options.UseBackColor = true;
			this.gridView1.Appearance.FocusedRow.Options.UseFont = true;
			this.gridView1.Appearance.FocusedRow.Options.UseForeColor = true;
			this.gridView1.Appearance.FooterPanel.BackColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.FooterPanel.BorderColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.FooterPanel.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.FooterPanel.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.FooterPanel.Options.UseBackColor = true;
			this.gridView1.Appearance.FooterPanel.Options.UseBorderColor = true;
			this.gridView1.Appearance.FooterPanel.Options.UseFont = true;
			this.gridView1.Appearance.FooterPanel.Options.UseForeColor = true;
			this.gridView1.Appearance.GroupButton.BackColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.GroupButton.BorderColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.GroupButton.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.GroupButton.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.GroupButton.Options.UseBackColor = true;
			this.gridView1.Appearance.GroupButton.Options.UseBorderColor = true;
			this.gridView1.Appearance.GroupButton.Options.UseFont = true;
			this.gridView1.Appearance.GroupButton.Options.UseForeColor = true;
			this.gridView1.Appearance.GroupFooter.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(202)), ((System.Byte)(202)));
			this.gridView1.Appearance.GroupFooter.BorderColor = System.Drawing.Color.FromArgb(((System.Byte)(202)), ((System.Byte)(202)), ((System.Byte)(202)));
			this.gridView1.Appearance.GroupFooter.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.GroupFooter.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.GroupFooter.Options.UseBackColor = true;
			this.gridView1.Appearance.GroupFooter.Options.UseBorderColor = true;
			this.gridView1.Appearance.GroupFooter.Options.UseFont = true;
			this.gridView1.Appearance.GroupFooter.Options.UseForeColor = true;
			this.gridView1.Appearance.GroupPanel.BackColor = System.Drawing.SystemColors.InactiveCaption;
			this.gridView1.Appearance.GroupPanel.BackColor2 = System.Drawing.Color.White;
			this.gridView1.Appearance.GroupPanel.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
			this.gridView1.Appearance.GroupPanel.ForeColor = System.Drawing.Color.White;
			this.gridView1.Appearance.GroupPanel.Options.UseBackColor = true;
			this.gridView1.Appearance.GroupPanel.Options.UseFont = true;
			this.gridView1.Appearance.GroupPanel.Options.UseForeColor = true;
			this.gridView1.Appearance.GroupRow.BackColor = System.Drawing.Color.Gray;
			this.gridView1.Appearance.GroupRow.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.GroupRow.ForeColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.GroupRow.Options.UseBackColor = true;
			this.gridView1.Appearance.GroupRow.Options.UseFont = true;
			this.gridView1.Appearance.GroupRow.Options.UseForeColor = true;
			this.gridView1.Appearance.HeaderPanel.BackColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.HeaderPanel.BorderColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.HeaderPanel.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Bold);
			this.gridView1.Appearance.HeaderPanel.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.HeaderPanel.Options.UseBackColor = true;
			this.gridView1.Appearance.HeaderPanel.Options.UseBorderColor = true;
			this.gridView1.Appearance.HeaderPanel.Options.UseFont = true;
			this.gridView1.Appearance.HeaderPanel.Options.UseForeColor = true;
			this.gridView1.Appearance.HideSelectionRow.BackColor = System.Drawing.Color.Gray;
			this.gridView1.Appearance.HideSelectionRow.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.HideSelectionRow.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200)));
			this.gridView1.Appearance.HideSelectionRow.Options.UseBackColor = true;
			this.gridView1.Appearance.HideSelectionRow.Options.UseFont = true;
			this.gridView1.Appearance.HideSelectionRow.Options.UseForeColor = true;
			this.gridView1.Appearance.HorzLine.BackColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.HorzLine.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.HorzLine.ForeColor = System.Drawing.Color.Gray;
			this.gridView1.Appearance.HorzLine.Options.UseBackColor = true;
			this.gridView1.Appearance.HorzLine.Options.UseFont = true;
			this.gridView1.Appearance.HorzLine.Options.UseForeColor = true;
			this.gridView1.Appearance.OddRow.BackColor = System.Drawing.Color.White;
			this.gridView1.Appearance.OddRow.BackColor2 = System.Drawing.Color.White;
			this.gridView1.Appearance.OddRow.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.OddRow.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.OddRow.GradientMode = System.Drawing.Drawing2D.LinearGradientMode.BackwardDiagonal;
			this.gridView1.Appearance.OddRow.Options.UseBackColor = true;
			this.gridView1.Appearance.OddRow.Options.UseFont = true;
			this.gridView1.Appearance.OddRow.Options.UseForeColor = true;
			this.gridView1.Appearance.Preview.BackColor = System.Drawing.Color.White;
			this.gridView1.Appearance.Preview.BackColor2 = System.Drawing.Color.White;
			this.gridView1.Appearance.Preview.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.Preview.ForeColor = System.Drawing.Color.Navy;
			this.gridView1.Appearance.Preview.Options.UseBackColor = true;
			this.gridView1.Appearance.Preview.Options.UseFont = true;
			this.gridView1.Appearance.Preview.Options.UseForeColor = true;
			this.gridView1.Appearance.Row.BackColor = System.Drawing.Color.White;
			this.gridView1.Appearance.Row.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.Row.ForeColor = System.Drawing.Color.Black;
			this.gridView1.Appearance.Row.Options.UseBackColor = true;
			this.gridView1.Appearance.Row.Options.UseFont = true;
			this.gridView1.Appearance.Row.Options.UseForeColor = true;
			this.gridView1.Appearance.RowSeparator.BackColor = System.Drawing.Color.White;
			this.gridView1.Appearance.RowSeparator.BackColor2 = System.Drawing.Color.FromArgb(((System.Byte)(243)), ((System.Byte)(243)), ((System.Byte)(243)));
			this.gridView1.Appearance.RowSeparator.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.RowSeparator.ForeColor = System.Drawing.Color.Gray;
			this.gridView1.Appearance.RowSeparator.Options.UseBackColor = true;
			this.gridView1.Appearance.RowSeparator.Options.UseFont = true;
			this.gridView1.Appearance.RowSeparator.Options.UseForeColor = true;
			this.gridView1.Appearance.SelectedRow.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(10)), ((System.Byte)(10)), ((System.Byte)(138)));
			this.gridView1.Appearance.SelectedRow.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.SelectedRow.ForeColor = System.Drawing.Color.White;
			this.gridView1.Appearance.SelectedRow.Options.UseBackColor = true;
			this.gridView1.Appearance.SelectedRow.Options.UseFont = true;
			this.gridView1.Appearance.SelectedRow.Options.UseForeColor = true;
			this.gridView1.Appearance.VertLine.BackColor = System.Drawing.Color.Silver;
			this.gridView1.Appearance.VertLine.Font = new System.Drawing.Font("Arial", 8F);
			this.gridView1.Appearance.VertLine.ForeColor = System.Drawing.Color.Gray;
			this.gridView1.Appearance.VertLine.Options.UseBackColor = true;
			this.gridView1.Appearance.VertLine.Options.UseFont = true;
			this.gridView1.Appearance.VertLine.Options.UseForeColor = true;
			this.gridView1.GridControl = this.Grid;
			this.gridView1.GroupPanelText = "Arrastre las columnas aquí para agrupar";
			this.gridView1.Name = "gridView1";
			this.gridView1.OptionsBehavior.Editable = false;
			// 
			// llToolbar
			// 
			this.llToolbar.Active = false;
			this.llToolbar.BllInstance = null;
			this.llToolbar.ConnectionName = "";
			this.llToolbar.DataSource = null;
			this.llToolbar.EntityClasifications = null;
			this.llToolbar.Form = this;
			this.llToolbar.MaxItemId = 21;
			this.llToolbar.ModuleName = null;
			this.llToolbar.ModulePrefix = null;
			this.llToolbar.PageSize = 20;
			this.llToolbar.QueryName = null;
			this.llToolbar.QueryParams = null;
			this.llToolbar.User = null;
			// 
			// dlgAdvancedList
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(792, 574);
			this.Controls.Add(this.Grid);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
			this.KeyPreview = true;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "dlgAdvancedList";
			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			this.Text = "Lista de Valores";
			this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dlgAdvancedList_KeyDown);
			this.Closing += new System.ComponentModel.CancelEventHandler(this.dlgAdvancedList_Closing);
			this.Activated += new System.EventHandler(this.dlgAdvancedList_Activated);
			((System.ComponentModel.ISupportInitialize)(this.Grid)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.gridView1)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.dataView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.llToolbar)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void Grid_DoubleClick(object sender, System.EventArgs e)
		{
			this.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.Close();
		}

		private void Grid_EditorKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
		{
			
		}

		private void Grid_EditorKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Enter)
			{
				this.DialogResult = System.Windows.Forms.DialogResult.OK;
				this.Close();
			}
			
		}

		private void dlgAdvancedList_Activated(object sender, System.EventArgs e)
		{
			foreach(DevExpress.XtraGrid.Columns.GridColumn col in gridView1.Columns)
			{
				if ((col.Caption == "TUPLA") || (col.Caption == "NoCaption"))
				{
					col.Visible = false;
					col.OptionsColumn.ShowInCustomizationForm = false;
				}
                if ((col.Caption == "DOCUMENTO") || (col.Caption == "SOCIO"))
                {
                    col.Visible = false;
                    col.OptionsColumn.ShowInCustomizationForm = false;
                }

			}


			gridView1.BestFitColumns();


		}

		private void dlgAdvancedList_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
				
		}

		private void Grid_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Enter)
			{
				this.DialogResult = System.Windows.Forms.DialogResult.OK;
				this.Close();
			}
		
		}

		private void dlgAdvancedList_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
				DialogResult = DialogResult.Cancel;
		}
	}
}
