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.
Unfortunately, activation email could not send to your email. Please try again.

How to select the whole row, wherever you click?

When you set the ListBoxSelectionMode property, it selects the row on clicking on a cell and the current cell is active. This implies that, its background does not match the rest of the selected row.

To make the current cell look like the rest of the row, subscribe to the TableControlCurrentCellActivating event. In the handler, set e.Inner.ColIndex = 0. This sets the current cell on the header and not conflict with the rest of the selected row.

The following code example is for changing the selection mode and CurrentCell.

C#

VB               

The following screenshot illustrates the output.

Figure 1: Selecting the whole row on a single click

Samples

SelectingRow-C#

SelectingRow-VB

Article ID: Published Date: Last Revised Date: Platform: Control:
644 04/30/2011 03/02/2015 Windows Forms GridGroupingControl
Did you find this information helpful?
Comments
Truong Nov 14, 2016

Value in my cell is hidden when i use above code  , please help me , this is my code :

private void gridPhaChe_TableControlCurrentCellActivating(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellActivatingEventArgs e)
        {
            if (e.Inner.RowIndex > 2)
            {
                TenMonAn_Label.Text = gridPhaChe.Table.CurrentRecord["TEN"].ToString();
                TongPhaChe_Label.Text = gridPhaChe.Table.CurrentRecord["SOLUONG"].ToString();
                ConLai_Label.Visible = false;
                Nhap_button.Visible = true;
                DaPhaChe_txtBox.Enabled = true;
                DaPhaChe_txtBox.Text = "0";
                DaPhaChe_txtBox.Focus();
                e.Inner.ColIndex = 0;
            }
            else
            {
                refresh();
            }
        }
Reply
Amal Raj Umapathy Selvam [Syncfusion] Nov 14, 2016

Hi Truong,

 

Thanks for using Syncfusion products.

 

We have created a simple sample to reproduce the reported scenario with your provided code. Unfortunately, we could not reproduce the issue “Value in cell is hidden” with the provided code snippet. Please refer to the sample below,

 

Sample Link

http://www.syncfusion.com/downloads/support/directtrac/general/ze/RowSelection497904622

 

Please create a new incident with your Direct-Trac account using below link for better follow up.

https://www.syncfusion.com/account/login

 

Regards,

Amal Raj U.

Reply
Add Comment
You must log in to leave a comment

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.