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

Handling "Select All" in a datagrid

I have a reqmt. wherein rows are selected in a datagrid and users can add information by using a add button.

I have putin code in Click and CurrentCellChanged event handlers to enable/disable the add button based on if a row is selected or not.

But in the datagrid if i do a A, all rows get selected but the control does not go to the above two handlers and hence the add button is not enabled.

Can someone kindly let me know how to handle this or how do i disable the Ctrl A option for the datagrid.

Thanks,
Kannan



1 Reply

NA Nisha Arockiya A Syncfusion Team August 20, 2008 07:09 AM UTC


Hi Kannan,

Thanks for your interest in Syncfusion products.

You can make the add button enabled by including the following code snippet into KeyDown event of your Form.


if (e.Control)
if(e.KeyCode==Keys.A)
this.add.Enabled = true;


Please let me know if it helps you.

Regards,
Nisha


>I have a reqmt. wherein rows are selected in a datagrid and users can add information by using a add button.

I have putin code in Click and CurrentCellChanged event handlers to enable/disable the add button based on if a row is selected or not.

But in the datagrid if i do a A, all rows get selected but the control does not go to the above two handlers and hence the add button is not enabled.

Can someone kindly let me know how to handle this or how do i disable the Ctrl A option for the datagrid.

Thanks,
Kannan





Loader.
Live Chat Icon For mobile
Up arrow icon