Example #1
0
        /// <summary>
        /// Gets the checked collection.
        /// </summary>
        /// <param name="CurrentPage">The current page.</param>
        /// <param name="GridId">The grid id.</param>
        /// <returns></returns>
        public static string[] GetCheckedCollection(Page CurrentPage, string GridId)
        {
            MetaGridServer grid = null;

            grid = GetMetaGridFromCollection(CurrentPage.Controls, GridId);

            if (grid != null)
            {
                //return grid.ctrlJsGrid.hfGridCheckedValues.Value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                //return grid.hfCheckedCollection.Value.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                return(grid.GetCheckedCollection().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries));
            }

            return(null);
        }
Example #2
0
        /// <summary>
        /// Gets the meta grid from collection.
        /// </summary>
        /// <param name="coll">The coll.</param>
        /// <param name="GridId">The grid id.</param>
        /// <returns></returns>
        public static MetaGridServer GetMetaGridFromCollection(ControlCollection coll, string GridId)
        {
            MetaGridServer retVal = null;

            foreach (Control c in coll)
            {
                if (c is MetaGridServer && (GridId != string.Empty && c.ID == GridId))
                {
                    retVal = (MetaGridServer)c;
                    break;
                }
                else
                {
                    retVal = GetMetaGridFromCollection(c.Controls, GridId);
                    if (retVal != null)
                    {
                        break;
                    }
                }
            }
            return(retVal);
        }