BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Query | Response |
When I click the left and top cell,how to select all the records | In order to select all records in the click of TopLeftHeaderCell, TableControlCellClick can be handled. Table.Records.SelectAll() method is used to select all records. Please make use of the below code. Code Snippet //Event hookup. this.gridGroupingControl1.TableControlCellClick += new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCellClick); void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e) { GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex); if (style.TableCellIdentity.TableCellType== GridTableCellType.TopLeftHeaderCell) { this.gridGroupingControl1.Table.Records.SelectAll(); } } UG Link |
I want to prevent the other people from editing the cell's value except they use the dropdown list,how should I set the cell into readonly. | To prevent editing, the dropdownstyle must be set to Exclusive for that columns. Please make use of the below code. Code Snippet //to prevent editing and only select options from dropdown. this.gridGroupingControl1.TableDescriptor.Columns["CategoryID"].Appearance.AnyRecordFieldCell.DropDownStyle = GridDropDownStyle.Exclusive; |
How to change the "Object" text in dropdown gridlistcontrol. | Column header text in GridListControl can be changed in PrepareViewStyleInfo event of GridListControl. Please make use of the below. Code Snippet //to get GridListControl renderer. GridDropDownGridListControlCellRenderer renderer = this.gridGroupingControl1.TableControl.CellRenderers["GridListControl"] as GridDropDownGridListControlCellRenderer; renderer.ListControlPart.Grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo); //to change GridListControl header text. void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if (e.ColIndex == 1 && e.RowIndex == 0) e.Style.Text = "Text"; } |
The DropDownList's border is dotted line,how to change it into solid? | Dropdown list border can be changed using PrepareViewStyleInfo event of GridListControl. Please make use of the below code. Code Snippet //to get GridListControl renderer. GridDropDownGridListControlCellRenderer renderer = this.gridGroupingControl1.TableControl.CellRenderers["GridListControl"] as GridDropDownGridListControlCellRenderer; renderer.ListControlPart.Grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo); //to change GridListControl header text. void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { e.Style.Borders.All = new GridBorder(GridBorderStyle.Solid, Color.LightGray); } |
How to hide a column? | Solution 1 Columns can be hided using Cols.Hidden property.Please make use of the below code. //to hide a column. this.gridGroupingControl1.TableModel.Cols.Hidden["Description"] = true; Solution 2 Columns can also be hidden by making width of that column = 0. //to hide a column. this.gridGroupingControl1.TableDescriptor.Columns["Description"].Width = 0; Solution 3 Columns can be hidden using VisibleColumns.Remove() method also. //to hide a column. this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Description"); Solution 4 Columns can be hidden using ColHiddenEntries.Add() method also. //to hide a column. GridColHidden hiddenColumn = new GridColHidden(2); this.gridGroupingControl1.TableModel.ColHiddenEntries.Add(hiddenColumn); Solution 5 If you want to hide an column in runtime, you can hide that particular column by resizing using the Resize indicator. KB Links UG Links |