Hi el_sid,
Thanks for your post.
To do row selection in cell mouse click operation, we can handle MouseUp
event of DataGrid, and programmatically select certain row. Please refer to
the link below:
"5.11 How can I select the entire row when the user clicks on a cell in the
row?"
http://64.78.52.104/FAQ/WinForms/FAQ_c44c.asp#q689q
To implement the Shift/Ctrl multiselection function, we should do the
selection logic ourselves. I have implemented a sample for Shift key, I
think you can use this sample code as a reference and implement Ctrl key
function. Sample code listed below:
private void dataGrid1_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
System.Drawing.Point pt = new Point(e.X, e.Y);
DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);
if(hti.Type == DataGrid.HitTestType.Cell)
{
if((Control.ModifierKeys&Keys.Control)==Keys.Control)
{
bool funselect=false;
for(int i=0;i<al.Count;i++)
{
if(hti.Row==(int)al[i])
{
funselect=true;
}
else
{
this.dataGrid1.Select((int)al[i]);
}
}
if(!funselect)
{
this.dataGrid1.Select(hti.Row);
}
}
else
{
dataGrid1.CurrentCell = new DataGridCell(hti.Row, hti.Column);
dataGrid1.Select(hti.Row);
}
}
}
//Record original selected rows in arraylist in MouseDown event
ArrayList al=new ArrayList();
private void dataGrid1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
al.Clear();
for(int i=0;i<this.dataGrid1.BindingContext[this.dataGrid1.DataSource,
this.dataGrid1.DataMember].Count;i++)
{
if(this.dataGrid1.IsSelected(i))
{
al.Add(i);
}
}
}
This works well on my side. Hope it helps.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
el_sid - 29 Sep 2005 10:42 GMT
Thanks we will give it a try in the next couple of weeks and let you know how
we get on.
> Hi el_sid,
>
[quoted text clipped - 68 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
"Jeffrey Tan[MSFT]" - 30 Sep 2005 02:59 GMT
Hi el_sid,
Ok, I will wait for your further feedback. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.