Ejemplo n.º 1
0
        /// <summary>
        /// Gets the dymanic data request URL.
        /// </summary>
        /// <param name="grid">The grid.</param>
        /// <returns></returns>
        public static string GetDymanicDataRequestUrl(DynamicGrid grid)
        {
            StringBuilder builder = new StringBuilder(GetHadlerURL(_handlerKeyDataSource));

            builder.Append("&" + _dynamicDataColumnCount + "=" + grid.Columns.Count);

            if (!string.IsNullOrEmpty(grid.AssociatedDataKey))
            {
                builder.Append("&" + _dymanicDataType + "=" + HttpUtility.UrlEncode(grid.AssociatedDataKey));
            }


            if (!string.IsNullOrEmpty(grid.DataSourceID))
            {
                DynamicGridDataSource dataSource = ControlHelper.FindControl(grid, grid.DataSourceID) as DynamicGridDataSource;
                builder.AppendFormat("&{0}={1}",
                                     _dymanicDataSourceId,
                                     dataSource == null ? grid.DataSourceID : HttpUtility.UrlEncode(dataSource.ClientID));
            }

            if (!string.IsNullOrEmpty(grid.AdditionalXmlQueryParams))
            {
                builder.Append("&" + grid.AdditionalXmlQueryParams);
            }
            return(builder.ToString());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Performs object initialization with specified grid id
 /// </summary>
 /// <param name="gridClientId">Id of grid</param>
 public DynamicGridInfoProvider(DynamicGrid grid)
 {
     _grid = grid;
 }