Ejemplo n.º 1
0
        public static List <string> ToListOfString(this IEnumerable en, JQAutoComplete autoComplete)
        {
            DataTable     dataTable  = en.ToDataTable(autoComplete);
            List <string> list       = new List <string>();
            IEnumerator   enumerator = dataTable.Rows.GetEnumerator();

            try
            {
                DataRow row;
                while (enumerator.MoveNext())
                {
                    row = (DataRow)enumerator.Current;
                    if (string.IsNullOrEmpty(list.Find((string s) => s == row[autoComplete.DataField].ToString())))
                    {
                        list.Add(row[autoComplete.DataField].ToString());
                    }
                }
            }
            finally
            {
                IDisposable disposable = enumerator as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            return(list);
        }
Ejemplo n.º 2
0
        public MvcHtmlString JQAutoComplete(JQAutoComplete autoComplete, string id)
        {
            JQAutoCompleteRenderer jQAutoCompleteRenderer = new JQAutoCompleteRenderer(autoComplete);

            autoComplete.ID = id;
            return(MvcHtmlString.Create(jQAutoCompleteRenderer.RenderHtml()));
        }
Ejemplo n.º 3
0
		public static List<string> ToListOfString(this IEnumerable en, JQAutoComplete autoComplete)
		{
			DataTable dataTable = en.ToDataTable(autoComplete);
			List<string> list = new List<string>();
			IEnumerator enumerator = dataTable.Rows.GetEnumerator();
			try
			{
				DataRow row;
				while (enumerator.MoveNext())
				{
					row = (DataRow)enumerator.Current;
					if (string.IsNullOrEmpty(list.Find((string s) => s == row[autoComplete.DataField].ToString())))
					{
						list.Add(row[autoComplete.DataField].ToString());
					}
				}
			}
			finally
			{
				IDisposable disposable = enumerator as IDisposable;
				if (disposable != null)
				{
					disposable.Dispose();
				}
			}
			return list;
		}
Ejemplo n.º 4
0
        internal static string ConstructLinqFilterExpression(JQAutoComplete autoComplete, Util.SearchArguments args)
        {
            Guard.IsNotNull(autoComplete.DataField, "DataField", "must be set in order to perform search operations. If you get this error from search/export method, make sure you setup(initialize) the grid again prior to filtering/exporting.");
            string filterExpressionCompare = "{0} {1} \"{2}\"";

            return(Util.GetLinqExpression(filterExpressionCompare, args, false, typeof(string)));
        }
Ejemplo n.º 5
0
 public static DataTable ToDataTable(this IEnumerable en, JQAutoComplete autoComplete)
 {
     return(en.ToDataTable(new JQGrid
     {
         Columns =
         {
             new JQGridColumn
             {
                 DataField = autoComplete.DataField
             }
         }
     }));
 }
Ejemplo n.º 6
0
		public static DataTable ToDataTable(this IEnumerable en, JQAutoComplete autoComplete)
		{
			return en.ToDataTable(new JQGrid
			{
				Columns = 
				{
					new JQGridColumn
					{
						DataField = autoComplete.DataField
					}
				}
			});
		}
Ejemplo n.º 7
0
		public JQAutoCompleteRenderer(JQAutoComplete autoComplete)
		{
			this._model = autoComplete;
		}
Ejemplo n.º 8
0
		public MvcHtmlString JQAutoComplete(JQAutoComplete autoComplete, string id)
		{
			JQAutoCompleteRenderer jQAutoCompleteRenderer = new JQAutoCompleteRenderer(autoComplete);
			autoComplete.ID = id;
			return MvcHtmlString.Create(jQAutoCompleteRenderer.RenderHtml());
		}
Ejemplo n.º 9
0
 public JQAutoCompleteRenderer(JQAutoComplete autoComplete)
 {
     this._model = autoComplete;
 }