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. Image for the cookie policy date

Selection of any cell should highlight entire row.

How can this be accomplished in GridGroupingControl?

3 Replies

VK Vinish Kumar K Syncfusion Team December 10, 2012 04:47 AM UTC

 Hi Gaukhar Massabayeva,

Thank you for your interested in Syncfusion products.

Query.

Highlighting any row while selecting a cell

You can achieve this functionality using the ListBoxSelectionMode property. Please refer the following codes which are used for your reference.

 

this.gridGroupingControl1.TableOptions.ListBoxSelectionMode =SelectionMode.MultiSimple;

           this.gridGroupingControl1.TableOptions.ListBoxSelectionColorOptions = GridListBoxSelectionColorOptions.ApplySelectionColor;

            this.gridGroupingControl1.TableOptions.AllowSelection =GridSelectionFlags.AlphaBlend;

 

Please refer the following UG Link  also. It will helps to you to get more details about this property, 

UG Link :  http://help.syncfusion.com/UG/User%20Interface/Windows%20Forms/Grid/default.htm#!Documents/selectedrangescollection.htm

Please let me know if you have further concerns.

Note : Already you have created duplicated forum for this Query ( 106067) Please follow up any one of query.

Regards,

Vinish.



GM Gaukhar Massabayeva December 10, 2012 12:06 PM UTC

Thank you Vinish.
 
You solution works.
 
However it is now conflicting with the current settings in the grid.
 
After implementing your suggestions. I no longer can select certain cells and rows, without the whole row being selected.
 
For example:
 
I want to select only the middle section of my grid
 

 

 

 

 

 

 

 

             

 

 

 

 

 
but instead it enforces selection of the whole row:
 

 

 

 

 

 

 

 

 

 

 

 

 

 
 
I tried Focused Selection but e.Style is missing AlphaBlend property that I need.
Please be so kind to share your expertise in solving this. Thank you


VK Vinish Kumar K Syncfusion Team December 11, 2012 11:52 AM UTC

Hi  Gaukhar Massabayeva,

 

Thanks for your update.

 

Query

Middle Selection

We have analysis your last update. If you want to select the middle cells of current row while clicking use the Current cell start editing event.

 

We have implement MidSelection property for your requirement. Please refer the following codes.

 

Please enable the MidSelection property in form load.

 

void gridGroupingControl1_TableControlCurrentCellStartEditing(object sender, GridTableControlCancelEventArgs e)

        {

            GridCurrentCell c = this.gridGroupingControl1.TableControl.CurrentCell;

            if (midselection == true && c.ColIndex > 0 && c.RowIndex > 2)

            {

                this.gridGroupingControl1.TableControl.Selections.Clear();

                int colCount = this.gridGroupingControl1.TableDescriptor.Columns.Count;

                int midCol = colCount / 2;

                if(colCount%2==1)

                    this.gridGroupingControl1.TableControl.Selections.Add(GridRangeInfo.Cell(c.RowIndex,midCol+1));

                else

                this.gridGroupingControl1.TableControl.Selections.Add(GridRangeInfo.Cells(c.RowIndex, midCol, c.RowIndex, midCol + 1));

            }

        }

 

Please refer the attached sample also it will helps to you for further analysis.

 

Please let me know if you have further concerns.

 

Regards,

Vinish.

 



MidSelection_207e5af3.zip

Loader.
Live Chat Icon For mobile
Up arrow icon