Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

datagrid fullrow select

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan - 29 Jul 2004 17:26 GMT
How can I select the full row in a datagrid? I tried the code below (from
the Syncfusion windows forms faq), so that all the cells of a row are
selected when I click on a single cell, BUT this has the effect of not
allowing multiple rows selection (ctrl-click or shift-click). How can I fix
this?

Thanx!

 private void DataGrid_MouseUp(object sender, MouseEventArgs e)
 {
  DataGrid dg = (DataGrid)sender;
  System.Drawing.Point pt = new Point(e.X, e.Y);
  DataGrid.HitTestInfo hti = dg.HitTest(pt);
  if (hti.Type == DataGrid.HitTestType.Cell)
  {
   dg.CurrentCell = new DataGridCell(hti.Row, hti.Column);
   dg.Select(hti.Row);
  }
 }
Gary Vidal - 29 Jul 2004 18:03 GMT
This code worked for me.

Private Sub dgList_RowChanging(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles dglist.CurrentCellChanged

dglist.Select(dglist.CurrentCell.RowNumber)

End Sub

> How can I select the full row in a datagrid? I tried the code below (from
> the Syncfusion windows forms faq), so that all the cells of a row are
[quoted text clipped - 15 lines]
>    }
>   }
Dan - 30 Jul 2004 10:24 GMT
Thanks, but I keep getting the same problem: with any of the two solutions I
can select multiple rows with ctrl/shift-click ONLY if I click on the
leftmost portion of the grid (where the small triangle 'cursor' is shown);
when I click on a row cell the whole row is selected, but only 1 row at once
can be selected (when I ctrl/shift-click onto another row's cell, the
previous row is deselected).
Any idea?

> This code worked for me.
>
[quoted text clipped - 4 lines]
>
> End Sub
Gary Vidal - 30 Jul 2004 22:03 GMT
I tested the function it seems that if you double click the row header (the little box next to the row) it will select a row.  Its weird but it works

> Thanks, but I keep getting the same problem: with any of the two solutions I
> can select multiple rows with ctrl/shift-click ONLY if I click on the
[quoted text clipped - 12 lines]
> >
> > End Sub

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.