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 Controls / March 2006

Tip: Looking for answers? Try searching our database.

Highlight entire row in datagrid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob Altman - 29 Mar 2006 17:55 GMT
Hi all,

My application displays read-only data in a WinForms DataGrid.  When the
user selects a row in the grid then I want the entire row to simply be
highlighted.  However, the grid insists on displaying the selected cell as
though it was editable (entire cell has a grey background, selected
characters are white on a navy background).

As described in the technical article "Customizing the Windows Forms
DataGrid", I created my own derived DataGridTextBoxColumn class and overrode
the Draw method.  Even though I paint the cells in that method, the datagrid
subsequently paints its own stuff on the current cell.

TIA

 - Bob
Bob Altman - 29 Mar 2006 19:31 GMT
Turns out that if you override the Edit method then the grid doesn't display
the the editing cues:

 ' Override the Edit method to suppress the editing cues
 Protected Overloads Overrides Sub Edit(...)
   ' <Do nothing>
 End Sub

> Hi all,
>
[quoted text clipped - 7 lines]
> DataGrid", I created my own derived DataGridTextBoxColumn class and overrode
> the Paint method.  Even though I paint the cells in that method, the
datagrid
> subsequently paints its own stuff on the current cell.
>
> TIA
>
>   - Bob

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.