SelectedRecords help

I have a flat ggc, like a listview.
I have 5 colummns (col1, col2, col3, col4, col5).

I have enable multi-select by using the floowing settings...


this.ggc.TableControl.Selections.Clear();
this.ggc.TableOptions.AllowSelection = GridSelectionFlags.None; this.ggc.TableOptions.ListBoxSelectionMode = SelectionMode.MultiSimple;

col1 - col3 are Static readonly cell and col4 and col5 are editable.

I want to make it such that only col1 - col3 should be able to select the cell. col4 and col5 should be like regular cell. The reason being that in the default implementation, clicking col4 and col5 first toggle the selection mode of the row before putting the cell in edit mode. Consequently, you have to click the cell almost twice to edit col 4 or col 5.

I am handling the SelectedRecordsChanging event to see if I can do this, but I can seem to get the column name or or index from this event because it is executing before the other events.


1 Reply

AD Administrator Syncfusion Team February 1, 2007 07:14 PM UTC

Hi James,

Could you please try this code.

private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
int row,col;
if( e.TableControl.PointToRowCol(new Point(e.Inner.X,e.Inner.Y ),out row,out col))
{
int field = e.TableControl.TableDescriptor.ColIndexToField(col);
if( field > -1)
{
string ColumnName = e.TableControl.TableDescriptor.Columns[field].Name;
if( ColumnName == "Col2")
{
e.TableControl.CurrentCell.MoveTo(row,col);
e.TableControl.CurrentCell.BeginEdit(true);
}
}
}
}

Best Regards,
Haneef

Loader.
Up arrow icon