We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Some question about GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

125282 Aug 5,2016 01:06 AM UTC Aug 8,2016 04:28 AM UTC WinForms 5
loading
Tags: GridGroupingControl
ligyste
Asked On August 5, 2016 01:06 AM UTC

pic



1、When I click the left and top cell,how to select all the records
2、I binds the column to a List<string>
List<string> list=new List<string>();
list.add("11111");
list.add("22222");
data_GridGroupingControl.TableDescriptor.Columns["col1"].Appearance.AnyRecordFieldCell.CellType = GridCellTypeName.GridListControl;
data_GridGroupingControl.TableDescriptor.Columns["col1"].Appearance.AnyRecordFieldCell.DataSource = list;

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.

3、I have handled the TableControlCurrentCellShowingDropDown  event 


data_GridGroupingControl.TableControlCurrentCellShowingDropDown += new GridTableControlCurrentCellShowingDropDownEventHandler(data_GridGroupingControl_TableControlCurrentCellShowingDropDown);

  private void data_GridGroupingControl_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
        {
            if (e.TableControl.CurrentCell.Renderer is GridDropDownGridListControlCellRenderer)
            {
                GridDropDownGridListControlCellRenderer renderer = e.TableControl.CurrentCell.Renderer as GridDropDownGridListControlCellRenderer;
             }
         }

How to change the "Object"  text

4、The DropDownList's border  is dotted line,how to change it into solid?

5、How to hide a column?


Thanks!


Attachment: pic_1dae32bc.rar

Amal Raj Umapathy Selvam [Syncfusion]
Replied On August 5, 2016 12:17 PM UTC

Hi ligyste, 
 
Thanks for using Syncfusion products. 
 
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 
 
Sample Link 
 
Regards, 
Amal Raj U. 


ligyste
Replied On August 6, 2016 01:39 AM UTC

It is very usefull for me,Thank you very much!

Amal Raj Umapathy Selvam [Syncfusion]
Replied On August 8, 2016 04:18 AM UTC

Hi ligyste, 

Thanks for your update. 

We are glad to know that the given solution has solved your query. Please let us know, If you need any further assistance. 

Regards, 
Amal Raj U. 


Ranjani Prabhakaran [Syncfusion]
Replied On August 8, 2016 04:26 AM UTC

From: ligyste2 [mailto:ligyste2@163.com]
Sent: Friday, August 5, 2016 9:36 PM
To: Syncfusion Support <support@syncfusion.com>
Subject: Re:Syncfusion support community forum 125282, Some question about GridGroupingControl, has been updated.
 

Thank you very much!

Ranjani Prabhakaran [Syncfusion]
Replied On August 8, 2016 04:28 AM UTC

Hi Ligyste, 
 
Please do contact us if you need any technical assistance in future. 
 
Regards, 
 
Ranjani 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;