Exemple #1
0
        public static void BuildGridHyperLinkColumn(BasePage page, RadGrid Grid, Grid GridObject, HyperLinkGridColumn Column, string ResourceKeyPrefix)
        {
            GridHyperLinkColumn col = new GridHyperLinkColumn();

            string HeaderText           = Common.CoalesceStr(col.HeaderText, Column.HeaderText);
            string DataTextFormatString = Common.CoalesceStr(col.DataTextFormatString, Column.DataTextFormatString);
            string Text = Common.CoalesceStr(col.Text, Column.Text);

            col.HeaderText = GetGlobalResourceString(page, Column, ResourceKeyPrefix, "HeaderText", HeaderText);

            col.SortExpression        = Common.CoalesceStr(col.SortExpression, Column.SortExpression);
            col.DataNavigateUrlFields = Common.CoalesceDelimArr(col.DataNavigateUrlFields, Column.DataNavigateUrlFields, ',');

            string urlFormatString = Common.CreateUrlWithQueryStringContext(Column.DataNavigateUrlFormatString, Column.Context);

            col.DataNavigateUrlFormatString = Common.CoalesceStr(col.DataNavigateUrlFormatString, urlFormatString);
            col.DataTextField        = Common.CoalesceStr(col.DataTextField, Column.DataTextField);
            col.DataTextFormatString = GetGlobalResourceString(page, Column, ResourceKeyPrefix, "DataTextFormatString", DataTextFormatString);
            col.Text = GetGlobalResourceString(page, Column, ResourceKeyPrefix, "Text", Text);

            if (!String.IsNullOrEmpty(Column.Target))
            {
                col.Target = Column.Target;
            }

            FormatStyle(col, Column);

            Grid.MasterTableView.Columns.Add(col);
        }
Exemple #2
0
        public GridHyperLinkColumn AddHyperLinkColumn(string dataTextField, string headerText)
        {
            GridHyperLinkColumn c = new GridHyperLinkColumn();

            _grid.MasterTableView.Columns.Add(c);
            c.DataTextField = dataTextField;
            c.HeaderText    = headerText;
            return(c);
        }
        public override void AttachProperties(GridColumn gridColumn)
        {
            base.AttachProperties(gridColumn);

            GridHyperLinkColumn column = (GridHyperLinkColumn)gridColumn;

            column.DataNavigateUrlFields       = DataNavigateUrlFields;
            column.DataNavigateUrlFormatString = DataNavigateUrlFormatString;
            column.DataTextField = DataTextField;
            column.Text          = Text;
        }
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);  // first things first
        if (ConciergeAPI.CurrentEntity == null)
        {
            return;
        }

        targetForm = LoadObjectFromAPI <msCustomObjectPortalForm>(ContextID);
        if (targetForm == null)
        {
            GoToMissingRecordPage();
        }

        targetObject = LoadObjectFromAPI <msCustomObject>(targetForm.CustomObject);

        using (var api = GetServiceAPIProxy())
            targetFormManifest = api.DescribePortalForm(targetForm.ID, ConciergeAPI.CurrentEntity.ID).ResultValue;

        rgMainDataGrid.AutoGenerateColumns = false;

        targetSearch = new Search(targetObject.Name);
        targetSearch.AddCriteria(Expr.Equals("Owner", ConciergeAPI.CurrentEntity.ID));

        var columns = targetForm.ManagementFieldsToDisplay;

        if (columns == null || columns.Count == 0)
        {
            columns = new List <string> {
                "Name"
            }
        }
        ;

        columns.ForEach(targetSearch.AddOutputColumn);


        if (!IsPostBack)
        {
            using (var api = GetServiceAPIProxy())
            {
                var meta = api.DescribeCompiledSearch(targetSearch).ResultValue;
                GridLogic.GenerateRadGridColumnsFromFieldMetadata(rgMainDataGrid, meta.Fields);
            }
        }

        GridHyperLinkColumn gc = new GridHyperLinkColumn();

        rgMainDataGrid.Columns.Add(gc); // remember we have to do this right away for column settings to persist
        gc.DataNavigateUrlFormatString = "ViewFormInstance.aspx?contextID={0}&formID=" + targetForm.ID;
        gc.DataNavigateUrlFields       = new string[] { "ID" };
        gc.Text = "(view)";
    }
        private void grdClientRevenue_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            DataSet ds = GetData();

            // Ensure that data has been returned.
            if (ds != null)
            {
                // if we only have the totals row (i.e. no client revenue data was returned) then remove
                // totals row and let the grid display its "No revenue data for the specified date range." message
                if (ds.Tables[0].Rows.Count == 1)
                {
                    ds.Tables[0].Rows.Remove(ds.Tables[0].Rows[0]);
                }

                // Reset the columns.
                grdClientRevenue.MasterTableView.Columns.Clear();

                GridHyperLinkColumn customerColumn = new GridHyperLinkColumn();
                customerColumn.HeaderText    = "Customer";
                customerColumn.DataTextField = "Customer";
                customerColumn.DataNavigateUrlFormatString = string.Format("workForClient.aspx?mode=client&csid=FS21eE&customerID={0}&startDate={1}&endDate={2}",
                                                                           "{0}",
                                                                           HttpUtility.UrlEncode(StartDate.ToString("s", System.Globalization.CultureInfo.InvariantCulture), System.Text.Encoding.UTF8),
                                                                           HttpUtility.UrlEncode(EndDate.ToString("s", System.Globalization.CultureInfo.InvariantCulture), System.Text.Encoding.UTF8));
                customerColumn.DataNavigateUrlFields     = new string[] { "IdentityID" };
                customerColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
                grdClientRevenue.MasterTableView.Columns.Add(customerColumn);

                for (int columnIndex = 2; columnIndex < ds.Tables[0].Columns.Count; columnIndex++)
                {
                    GridBoundColumn column = new GridBoundColumn();
                    column.HeaderText                = ds.Tables[0].Columns[columnIndex].ColumnName;
                    column.DataField                 = ds.Tables[0].Columns[columnIndex].ColumnName;
                    column.DataFormatString          = "{0:C}";
                    column.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                    grdClientRevenue.MasterTableView.Columns.Add(column);
                }

                // Set the last column (the total column to show bold amounts).
                GridBoundColumn totalColumn = grdClientRevenue.MasterTableView.Columns[grdClientRevenue.MasterTableView.Columns.Count - 1] as GridBoundColumn;
                if (totalColumn != null)
                {
                    totalColumn.ItemStyle.Font.Bold = true;
                }
            }

            grdClientRevenue.DataSource = ds;
            grdClientRevenue.Visible    = ds != null; // Only show the grid if data is present.

            heading.InnerText = this.HeadingText;
        }
        private void DefineColumns()
        {
            gvProd.MasterTableView.DataKeyNames = new string[] { KeyFieldName };

            GridHyperLinkColumn c2 = new GridHyperLinkColumn();

            gvProd.MasterTableView.Columns.Add(c2);
            c2.HeaderText    = Localize("Shop.UserControls.ProductListGrid.HeaderTextName", "Product Name");
            c2.DataTextField = ProductInfoDto.FLD_Name;
            c2.DataNavigateUrlFormatString = string.Format("{0}?{1}={{0}}", ServerPath + ProductPage.PageUrl, ProductPage.QryInstanceId);
            c2.DataNavigateUrlFields       = new string[] { ProductInfoDto.FLD_ProductId };
            c2.ItemStyle.Width             = Unit.Pixel(160);

            GridBoundColumn c3 = new GridBoundColumn();

            gvProd.MasterTableView.Columns.Add(c3);
            c3.HeaderText      = Localize("Shop.UserControls.ProductListGrid.HeaderTextPrice", "Unit Price");
            c3.DataField       = ProductInfoDto.FLD_UnitPrice;
            c3.ItemStyle.Width = Unit.Pixel(60);

            GridBoundColumn c7 = new GridBoundColumn();

            gvProd.MasterTableView.Columns.Add(c7);
            c7.HeaderText      = Localize("Shop.UserControls.ProductListGrid.HeaderTextUom", "Unit of Measure");
            c7.DataField       = ProductInfoDto.FLD_UnitOfMeasure;
            c7.ItemStyle.Width = Unit.Pixel(80);

            GridBoundColumn c5 = new GridBoundColumn();

            gvProd.MasterTableView.Columns.Add(c5);
            c5.HeaderText      = Localize("Shop.UserControls.ProductListGrid.HeaderTextPackaging", "Packaging");
            c5.DataField       = ProductInfoDto.FLD_Packaging;
            c5.ItemStyle.Width = Unit.Pixel(80);

            GridBoundColumn c4 = new GridBoundColumn();

            gvProd.MasterTableView.Columns.Add(c4);
            c4.HeaderText      = Localize("Shop.UserControls.ProductListGrid.HeaderTextDescription", "Description");
            c4.DataField       = ProductInfoDto.FLD_Description;
            c4.ItemStyle.Width = Unit.Pixel(200);

            GridHyperLinkColumn c1 = new GridHyperLinkColumn();

            gvProd.MasterTableView.Columns.Add(c1);
            c1.HeaderText    = Localize("Shop.UserControls.ProductListGrid.HeaderTextSupplier", "Supplier");
            c1.DataTextField = ProductInfoDto.FLD_SupplierName;
            c1.DataNavigateUrlFormatString = string.Format("{0}?{1}={{0}}", ServerPath + SupplierPage.PageUrl, SupplierPage.QryInstanceId);
            c1.DataNavigateUrlFields       = new string[] { SupplierInfoDto.FLD_SupplierId };
            c1.ItemStyle.Width             = Unit.Pixel(120);
        }
Exemple #7
0
        private static void BuildGridPickerHyperLinkGridColumn(BasePage page, RadGrid Grid, Grid GridObject, PickerHyperLinkGridColumn Column, string ResourceKeyPrefix)
        {
            GridHyperLinkColumn col = new GridHyperLinkColumn();

            string HeaderText = Common.CoalesceStr(col.HeaderText, Column.HeaderText);


            col.HeaderText = GetGlobalResourceString(page, Column, ResourceKeyPrefix, "HeaderText", HeaderText);

            col.SortExpression = Common.CoalesceStr(col.SortExpression, Column.SortExpression);
            col.Text           = "test";


            FormatStyle(col, Column);

            Grid.MasterTableView.Columns.Add(col);
        }
        public override GridColumn CreateColumn()
        {
            GridHyperLinkColumn column = new GridHyperLinkColumn();

            return(column);
        }
Exemple #9
0
        public static void HandleItemCommand(RadGrid Grid, CodeTorch.Core.Grid GridConfig, object source, GridCommandEventArgs e)
        {
            //HANDLE EDIT GRIDS
            if (e.CommandName == RadGrid.InitInsertCommandName) //"Add new" button clicked
            {
                GridEditCommandColumn editColumn = GetEditColumn(Grid, GridConfig);
                if (editColumn != null)
                {
                    editColumn.Visible = false;
                }
            }
            else if (e.CommandName == RadGrid.RebindGridCommandName && e.Item.OwnerTableView.IsItemInserted)
            {
                //dont't allow refreshing of grid while in add mode
                e.Canceled = true;
            }
            else
            {
                GridEditCommandColumn editColumn = GetEditColumn(Grid, GridConfig);
                if (editColumn != null)
                {
                    if (!editColumn.Visible)
                    {
                        editColumn.Visible = true;
                    }
                }
            }

            //HANDLE EXPORTS
            if (
                (e.CommandName == RadGrid.ExportToCsvCommandName) ||
                (e.CommandName == RadGrid.ExportToExcelCommandName) ||
                (e.CommandName == RadGrid.ExportToPdfCommandName) ||
                (e.CommandName == RadGrid.ExportToWordCommandName)
                )
            {
                int gridColumnIndex = 0;
                foreach (CodeTorch.Core.GridColumn column in GridConfig.Columns)
                {
                    bool isColumnVisible = true;

                    if (column.VisiblePermission.CheckPermission)
                    {
                        isColumnVisible = Common.HasPermission(column.VisiblePermission.Name);
                    }

                    if (isColumnVisible)
                    {
                        bool includeInExport = column.IncludeInExport;

                        if (includeInExport)
                        {
                            if (column.ExportPermission.CheckPermission)
                            {
                                includeInExport = Common.HasPermission(column.ExportPermission.Name);
                            }
                        }

                        if (!includeInExport)
                        {
                            Grid.Columns[gridColumnIndex].Visible = false;
                        }
                        else
                        {
                            if (!String.IsNullOrEmpty(column.ExportDataField))
                            {
                                switch (column.ColumnType)
                                {
                                case GridColumnType.BoundGridColumn:
                                    GridBoundColumn boundcol = ((GridBoundColumn)Grid.Columns[gridColumnIndex]);
                                    boundcol.DataField = column.ExportDataField;
                                    break;

                                case GridColumnType.HyperLinkGridColumn:
                                    GridHyperLinkColumn hypercol = ((GridHyperLinkColumn)Grid.Columns[gridColumnIndex]);
                                    hypercol.DataTextField = column.ExportDataField;
                                    break;
                                }
                            }
                        }

                        gridColumnIndex++;
                    }
                }
            }
        }
        private void BuildTheColumns(TGDetail selectedViewBy, DataRow dataRow, string StandardLevel = "")
        {
            GridBoundColumn gridBoundColumn = new GridBoundColumn
            {
                DataField = selectedViewBy + "Name",
                HeaderText = "",
                ShowSortIcon = true,
                AllowSorting = true
            };
            radGridResults.MasterTableView.Columns.Add(gridBoundColumn);

            GridHyperLinkColumn hyperLinkColumn = new GridHyperLinkColumn
            {
                HeaderText = "StandardLevel",
                DataTextField = "StandardName",
                DataNavigateUrlFields = new[] { "EncryptedID" },
                DataNavigateUrlFormatString = "~/Record/StandardsPage.aspx?xID={0}",
                Target = "_new",
                ShowSortIcon = true,
                AllowSorting = true
            };
            radGridResults.MasterTableView.Columns.Add(hyperLinkColumn);


            if (StandardLevel != null && StandardLevel != string.Empty)
            {
                GridBoundColumn TotalCompletencies = new GridBoundColumn();
                radGridResults.MasterTableView.Columns.Add(TotalCompletencies);
                TotalCompletencies.HeaderText = "Competencies";
                TotalCompletencies.DataField = "TotalCompetencies";
                TotalCompletencies.Display = true;
            }

            //GridBoundColumn StudentID = new GridBoundColumn();
            //radGridResults.MasterTableView.Columns.Add(StudentID);
            //StudentID.DataField = "StudentID";
            //StudentID.Display = false;

            GridBoundColumn StudentID = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(StudentID);
            StudentID.DataField = "StudentID";
            StudentID.Display = false;

            GridBoundColumn TeacherID = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(TeacherID);
            TeacherID.DataField = "TeacherID";
            TeacherID.Display = false;

            GridBoundColumn StanderdID = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(StanderdID);
            StanderdID.DataField = "StandardId";
            StanderdID.Display = false;

            GridBoundColumn WorksheetID = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(WorksheetID);
            WorksheetID.DataField = "WorksheetID";
            WorksheetID.Display = false;

            GridBoundColumn included = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(included);
            included.DataField = "Included";
            included.Display = false;

            GridBoundColumn total = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(total);
            total.DataField = "Total";
            total.Display = false;

            GridBoundColumn excluded = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(excluded);
            excluded.DataField = "Excluded";
            excluded.Display = false;



            GridBoundColumn scoreColumnA = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(scoreColumnA);
            scoreColumnA.DataField = "DateA";
            scoreColumnA.HeaderText = dataRow["ScoreColumnA"].ToString();
            scoreColumnA.DataFormatString = "{0:MM/dd/yy}";

            GridBoundColumn countColumnA = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(countColumnA);
            countColumnA.DataField = "CountA";
            countColumnA.Display = false;

            GridBoundColumn scoreColumnB = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(scoreColumnB);
            scoreColumnB.DataField = "DateB";
            scoreColumnB.HeaderText = dataRow["ScoreColumnB"].ToString();
            scoreColumnB.DataFormatString = "{0:MM/dd/yy}";
            GridBoundColumn countColumnB = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(countColumnB);
            countColumnB.DataField = "CountB";
            countColumnB.Display = false;

            GridBoundColumn scoreColumnC = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(scoreColumnC);
            scoreColumnC.DataField = "DateC";
            scoreColumnC.HeaderText = dataRow["ScoreColumnC"].ToString();
            scoreColumnC.DataFormatString = "{0:MM/dd/yy}";
            GridBoundColumn countColumnC = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(countColumnC);
            countColumnC.DataField = "CountC";
            countColumnC.Display = false;

            GridBoundColumn scoreColumnD = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(scoreColumnD);
            scoreColumnD.DataField = "DateD";
            scoreColumnD.HeaderText = dataRow["ScoreColumnD"].ToString();
            scoreColumnD.DataFormatString = "{0:MM/dd/yy}";
            GridBoundColumn countColumnD = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(countColumnD);
            countColumnD.DataField = "CountD";
            countColumnD.Display = false;

            GridBoundColumn scoreColumnE = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(scoreColumnE);
            scoreColumnE.DataField = "DateE";
            scoreColumnE.HeaderText = dataRow["ScoreColumnE"].ToString();
            scoreColumnE.DataFormatString = "{0:MM/dd/yy}";
            GridBoundColumn countColumnE = new GridBoundColumn();
            radGridResults.MasterTableView.Columns.Add(countColumnE);
            countColumnE.DataField = "CountE";
            countColumnE.Display = false;

            //GridBoundColumn perA = new GridBoundColumn();
            //radGridResults.MasterTableView.Columns.Add(perA);
            //perA.DataField = "PerA";
            //perA.Display = false;

            //GridBoundColumn perB = new GridBoundColumn();
            //radGridResults.MasterTableView.Columns.Add(perB);
            //perB.DataField = "PerB";
            //perB.Display = false;

            //GridBoundColumn perC = new GridBoundColumn();
            //radGridResults.MasterTableView.Columns.Add(perC);
            //perC.DataField = "PerC";
            //perC.Display = false;

            //GridBoundColumn perD = new GridBoundColumn();
            //radGridResults.MasterTableView.Columns.Add(perD);
            //perD.DataField = "PerD";
            //perD.Display = false;

            //GridBoundColumn perE = new GridBoundColumn();
            //radGridResults.MasterTableView.Columns.Add(perE);
            //perE.DataField = "PerE";
            //perE.Display = false;





        }
Exemple #11
0
    protected void Page_Load(object sender, System.EventArgs e)
    {
        RadGrid RadGrid1 = new RadGrid();

        this.SqlDataSource1.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["RmsPM.Data.ConnectionString"].ConnectionString.ToString();
        this.SqlDataSource2.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["RmsPM.Data.ConnectionString"].ConnectionString.ToString();

        //Add the RadGrid instance to the controls
        this.PlaceHolder1.Controls.Add(RadGrid1);
        if (!IsPostBack)
        {
            RadGrid1.Skin = "Default";

            RadGrid1.DataSourceID = "SqlDataSource1";
            //RadGrid1.DataSource = DataSourse().Tables[0];
            RadGrid1.MasterTableView.DataKeyNames = new string[] { "groupcode" };

            RadGrid1.Width               = Unit.Percentage(100);
            RadGrid1.PageSize            = 5;
            RadGrid1.AllowPaging         = true;
            RadGrid1.AutoGenerateColumns = false;

            //Set options to enable Group-by
            RadGrid1.GroupingEnabled = true;
            //RadGrid1.ShowGroupPanel = true;
            // RadGrid1.ClientSettings.AllowDragToGroup = false;
            RadGrid1.ClientSettings.AllowColumnsReorder = true;

            //Add Customers table
            RadGrid1.MasterTableView.PageSize = 15;

            GridBoundColumn boundColumn;
            //boundColumn = new GridBoundColumn();
            //RadGrid1.MasterTableView.Columns.Add(boundColumn);
            //boundColumn.DataField = "GroupCode";
            //boundColumn.HeaderText = "类别编号";

            boundColumn = new GridBoundColumn();
            RadGrid1.MasterTableView.Columns.Add(boundColumn);
            boundColumn.DataField  = "GroupName";
            boundColumn.HeaderText = "类别名称";



            //Add Orders table
            GridTableView tableViewOrders = new GridTableView(RadGrid1);
            RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders);

            tableViewOrders.DataSourceID = "SqlDataSource2";
            //tableViewOrders.DataSource = DataSourse().Tables[1];
            tableViewOrders.DataKeyNames = new string[] { "ProcedureCode" };

            GridRelationFields relationFields = new GridRelationFields();
            tableViewOrders.ParentTableRelation.Add(relationFields);

            relationFields.MasterKeyField = "groupcode";
            relationFields.DetailKeyField = "SysType";

            //Add a group-by expression as string into Customer's collection
            //RadGrid1.MasterTableView.GroupByExpressions.Add(new GridGroupByExpression("GroupName Group By GroupName"));

            //Add a group-by expression by defining fields into Orders' collection
            GridGroupByExpression expression = new GridGroupByExpression();

            GridGroupByField gridGroupByField = new GridGroupByField();

            //Add select fileds (before the "Group By" clause)
            //gridGroupByField = new GridGroupByField();
            //gridGroupByField.FieldName = "ProcedureCode";
            //gridGroupByField.FormatString = "ProcedureCode: {0}";
            //expression.SelectFields.Add(gridGroupByField);

            //gridGroupByField = new GridGroupByField();
            //gridGroupByField.FieldName = "ProcedureName";
            //gridGroupByField.FormatString = "Total shipping cost is <strong>{0}</strong>";
            ////gridGroupByField.Aggregate = GridAggregateFunction.Sum;
            //expression.SelectFields.Add(gridGroupByField);

            ////Add a filed for group-by (after the "Group By" clause)
            //gridGroupByField = new GridGroupByField();
            //gridGroupByField.FieldName = "ProcedureCode";
            //expression.GroupByFields.Add(gridGroupByField);

            ////This expression as string would look like:
            //// "RequiredDate, Freight Group By RequiredDate"
            ////but the display format of filed values wolld be different
            //tableViewOrders.GroupByExpressions.Add(expression);

            boundColumn = new GridBoundColumn();
            tableViewOrders.Columns.Add(boundColumn);
            boundColumn.DataField  = "ProcedureCode";
            boundColumn.HeaderText = "流程编号";

            boundColumn = new GridBoundColumn();

            GridHyperLinkColumn ghlk = new GridHyperLinkColumn();
            tableViewOrders.Columns.Add(ghlk);

            string[] urlField = new string[2];
            urlField[0] = "Applicationpath";
            urlField[1] = "ProcedureCode";
            ghlk.DataNavigateUrlFields = urlField;
            ghlk.HeaderText            = "流程名称";
            // ghlk
            ghlk.DataNavigateUrlFormatString = "javascript:modifyProcedure('{0}','{1}','','');";
            ghlk.DataTextField = "ProcedureName";
        }
    }
        public static void BindTelerikGrid(
            ref RadGrid Grid
            , DataTable Dt_Source
            , List<ClsBindGridColumn_Web_Telerik> List_Gc
            , string Key = ""
            , bool AllowSort = true
            , bool HasDelete = false
            , eSelectorType SelectorType = eSelectorType.None
            )
        {
            Grid.DataSource = Dt_Source;

            if (Grid.Columns.Count > 0)
            { Grid.Columns.Clear(); }

            Grid.AutoGenerateColumns = false;
            if (SelectorType != eSelectorType.None)
            {
                Grid.ClientSettings.Selecting.AllowRowSelect = true;
                Grid.ClientSettings.Selecting.UseClientSelectColumnOnly = true;
            }

            Grid.AllowMultiRowSelection = SelectorType == eSelectorType.Multiple;

            //Grid.ClientSettings.Resizing.AllowColumnResize = true;
            //Grid.ClientSettings.Resizing.AllowResizeToFit = true;

            TableItemStyle Tis  = null;

            foreach (ClsBindGridColumn_Web_Telerik Inner_Gc in List_Gc)
            {
                if (!Inner_Gc.mIsVisible)
                {
                    continue;
                }

                switch (Inner_Gc.mFieldType)
                {
                    case Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Text:
                    {
                        GridBoundColumn Gc = new GridBoundColumn();
                        Grid.Columns.Add(Gc);

                        Gc.HeaderStyle.Width = Inner_Gc.mUnit_Width;
                        Gc.HeaderText = Inner_Gc.mFieldDesc;
                        Gc.DataField = Inner_Gc.mFieldName;
                        Gc.ReadOnly = !Inner_Gc.mEnabled;
                        Gc.DataFormatString = Inner_Gc.mDataFormat;

                        if (AllowSort)
                        { Gc.HeaderButtonType = GridHeaderButtonType.LinkButton; }

                        Gc.SortExpression = Inner_Gc.mFieldName;
                        Tis = Gc.ItemStyle;

                        break;
                    }

                    case Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Checkbox:
                    {
                        GridCheckBoxColumn Gc = new GridCheckBoxColumn();
                        Grid.Columns.Add(Gc);

                        Gc.HeaderStyle.Width = Inner_Gc.mUnit_Width;
                        Gc.DataField = Inner_Gc.mFieldName;
                        Gc.HeaderText = Inner_Gc.mFieldDesc;
                        Gc.ReadOnly = !Inner_Gc.mEnabled;

                        if (AllowSort)
                        { Gc.HeaderButtonType = GridHeaderButtonType.LinkButton; }

                        Gc.SortExpression = Inner_Gc.mFieldName;
                        Tis = Gc.ItemStyle;

                        break;
                    }

                    case Layer01_Constants.eSystem_Lookup_FieldType.FieldType_DateTime:
                    {
                        GridDateTimeColumn Gc = new Telerik.Web.UI.GridDateTimeColumn();
                        Grid.Columns.Add(Gc);

                        Gc.HeaderStyle.Width = Inner_Gc.mUnit_Width;
                        Gc.DataField = Inner_Gc.mFieldName;
                        Gc.HeaderText = Inner_Gc.mFieldDesc;
                        Gc.ReadOnly = !Inner_Gc.mEnabled;
                        Gc.DataFormatString = Inner_Gc.mDataFormat;

                        if (AllowSort)
                        { Gc.HeaderButtonType = GridHeaderButtonType.LinkButton; }

                        Gc.SortExpression = Inner_Gc.mFieldName;
                        Tis = Gc.ItemStyle;

                        break;
                    }

                    case Layer01_Constants.eSystem_Lookup_FieldType.FieldType_Button:
                    {
                        GridButtonColumn Gc = new GridButtonColumn();
                        Grid.Columns.Add(Gc);

                        Gc.HeaderStyle.Width = Inner_Gc.mUnit_Width;
                        Gc.HeaderText = Inner_Gc.mFieldDesc;
                        Gc.CommandName = Inner_Gc.mCommandName;

                        if (Inner_Gc.mFieldName == "")
                        { Gc.Text = Inner_Gc.mFieldText; }
                        else
                        { Gc.DataTextField = Inner_Gc.mFieldName; }

                        switch (Inner_Gc.mButtonType)
                        {
                            case ButtonColumnType.PushButton:
                                Gc.ButtonType = Telerik.Web.UI.GridButtonColumnType.PushButton;
                                break;
                            case ButtonColumnType.LinkButton:
                                Gc.ButtonType = Telerik.Web.UI.GridButtonColumnType.LinkButton;
                                break;
                        }

                        Tis = Gc.ItemStyle;
                        break;
                    }
                    case Layer01_Constants.eSystem_Lookup_FieldType.FieldType_HyperLink:
                    {
                        GridHyperLinkColumn Gc = new GridHyperLinkColumn();
                        Grid.Columns.Add(Gc);

                        Gc.HeaderStyle.Width = Inner_Gc.mUnit_Width;
                        Gc.HeaderText = Inner_Gc.mFieldDesc;
                        Gc.Text = Inner_Gc.mFieldText;
                        Gc.DataNavigateUrlFormatString = Inner_Gc.mFieldNavigateUrl_Text;
                        Gc.DataNavigateUrlFields = new string[] { Inner_Gc.mFieldNavigateUrl_Field };

                        Tis = Gc.ItemStyle;
                        break;
                    }
                    default:
                    {
                        GridBoundColumn Gc = new GridBoundColumn();
                        Grid.Columns.Add(Gc);

                        Gc.HeaderStyle.Width = Inner_Gc.mUnit_Width;
                        Gc.HeaderText = Inner_Gc.mFieldDesc;
                        Gc.DataField = Inner_Gc.mFieldName;
                        Gc.ReadOnly = true;
                        Gc.DataFormatString = Inner_Gc.mDataFormat;

                        if (AllowSort)
                        { Gc.HeaderButtonType = GridHeaderButtonType.LinkButton; }

                        Tis = Gc.ItemStyle;

                        break;
                    }
                }

                //Tis.Width = Inner_Gc.mUnit_Width;
            }

            if (HasDelete) { }

            switch (SelectorType)
            {
                case eSelectorType.Single:
                case eSelectorType.Multiple:
                    {
                        GridClientSelectColumn Gc = new GridClientSelectColumn();
                        Grid.Columns.Insert(0, Gc);
                        Gc.UniqueName = "Select";
                        Gc.HeaderText = "";
                        Gc.HeaderStyle.Width = new Unit("40px");
                        break;
                    }
            }

            if (Key != "")
            { Grid.MasterTableView.DataKeyNames = new string[] { Key }; }

            Grid.DataBind();
        }