Hi Ys,
You will need to handle the two grid events( TableContolMouseDown and SelectedRecordChanging event). one for selecting/de-selecting the multiple records in a group when it is clicked. The SelectedRecordChanging event used for disable the record selection technique in a grid. The attached sample implements two events to answer this. Please try the attached sample and let me know if this helps.
void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
Element el = e.TableControl.PointToNestedDisplayElement(new Point(e.Inner.X, e.Inner.Y));
Record rec = el.GetRecord();
if (rec != null)
{
AllowSelectGroup = true;
bool isSelected = Control.ModifierKeys != Keys.Control? true:!rec.IsSelected();
if( Control.ModifierKeys != Keys.Control )
e.TableControl.Table.SelectedRecords.Clear();
foreach (Record r in rec.ParentGroup.Records)
r.SetSelected(isSelected);
AllowSelectGroup = false;
}
}
bool AllowSelectGroup = false;
void gridGroupingControl1_SelectedRecordsChanging(object sender, SelectedRecordsChangedEventArgs e)
{
if( !AllowSelectGroup )
e.Cancel = true;
}
Sample :
GGCSelectRecord.zipBest regards,
Haneef