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

Select entire row in GDBG

hi, how do i select the entire row when i click on a cell, and the cell can start editing.

thanks!

6 Replies

AD Administrator Syncfusion Team August 11, 2006 06:58 AM UTC

Hi Lim,

Try the below property setting to achieve this.

this.gridDataBoundGrid1.ListBoxSelectionMode = SelectionMode.One;

Thanks,
Rajagopal


AD Administrator Syncfusion Team August 11, 2006 10:21 AM UTC

hi thanks! It''s working!

but when i click on a disable cell in the other row, the selected row is remain at the previous row.
how could i select the row whenever i click on a cell including the disable cell.

Thanks!

>Hi Lim,

Try the below property setting to achieve this.

this.gridDataBoundGrid1.ListBoxSelectionMode = SelectionMode.One;

Thanks,
Rajagopal


AD Administrator Syncfusion Team August 11, 2006 11:16 AM UTC

Hi Lim,

I dont see your problem, even when you click over any disabled cells in the grid, the selection of the row should be fine. Are you able to see this problem in the attached sample. If you still face any problem, kindly post a sample showing the problem.
Here is a sample
http://www.syncfusion.com/Support/user/uploads/GDBGRow_bb50254c.zip

Thanks,
Rajagopal



AD Administrator Syncfusion Team August 11, 2006 11:37 AM UTC

hi! from the sample u gave me, the problem is same as mine.

if i click the other cell which is disable, the row is only highlighted but the selected row is still remain at the previous row and also the active cell is still there..

How do i make the row is selected and activate the first enable cell in the row when i click on a disable cell.

Thanks!


AD Administrator Syncfusion Team August 11, 2006 01:12 PM UTC

Hi Lim,

Please try the code below in the CellClick event of the grid, to get this working as desired.

int index = 0;
private void gridDataBoundGrid1_CellClick(object sender, GridCellClickEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if(!this.gridDataBoundGrid1.Model[e.RowIndex, e.ColIndex].Enabled)
{
for(int i = 1; i <= this.gridDataBoundGrid1.Model.ColCount ; i++)
{
if(this.gridDataBoundGrid1.Model[e.RowIndex, i].Enabled == true)
index = i;
break;
}
this.gridDataBoundGrid1.CurrentCell.MoveTo(e.RowIndex, index);
}
}

Let me know if you need any further assistance.
Regards,
Rajagopal


AD Administrator Syncfusion Team August 14, 2006 06:00 AM UTC

hi! that''s what i want!

Thanks a lot!

Loader.
Live Chat Icon For mobile
Up arrow icon