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.

Prevent Certain Rows frm Bieng Selected

Thread ID:

Created:

Updated:

Platform:

Replies:

63745 Jul 9,2007 10:48 AM Jul 9,2007 12:04 PM Windows Forms 1
loading
Tags: GridControl
Raul
Asked On July 9, 2007 10:48 AM

Hi,

How do I Prevent certain rows in the grid to be non selectable depending on a certain runtime condition?

I am using DGBG.

Thanks in advance,

Raul Dsouza

haneefm [Syncfusion]
Replied On July 9, 2007 12:04 PM

Hi Rahul,

To prevent a row from being selected, you can handle the gridDataBoundGrid1.Model.SelectionChanging or gridControl1.SelectionChanging event, and if the cell is contained in the invalid value, then cancel the selection through e.Cancel property. Below is a code snippet

this.gridDataBoundGrid1.ListBoxSelectionMode = SelectionMode.One;

void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
int iRowIndex = e.ClickRange.Top;
GridModel _model = sender as GridModel;
if (_model[iRowIndex, 1].Text == "7")
e.Cancel = true;

}

Best regards,
Haneef

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.

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.

;