PC Review


Reply
Thread Tools Rate Thread

C# - DataGrid on Windowsform.

 
 
Wayne Gibson
Guest
Posts: n/a
 
      2nd Sep 2003
Hi all,

Was wondering if somebody could help me or at least point me in the right
direction...

I have a System.Windows.Forms.DataGrid, which is bound to a dataset. I
would like to hide certain columns, so that the user can't see them..

Also was wondering if it was possible if when a cell was selected the whole
row is selected..
I want it to behave like a Listbox, I guess..

Thanks

Wayne Gibson


 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      2nd Sep 2003
Wayne,

If you want to select a whole row when a cell is selected, you will want
to hook up to the CellChanged event and then select the whole row when the
cell changes.

If you want to hide some columns, then what you will want to do is get
the TableStyles for the particular table you want to view, and then get the
ColumnStyles for that table. Then, you would just remove the columns that
you don't want to see.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"Wayne Gibson" <(E-Mail Removed)> wrote in message
news:bj2d2q$fta$1$(E-Mail Removed)...
> Hi all,
>
> Was wondering if somebody could help me or at least point me in the right
> direction...
>
> I have a System.Windows.Forms.DataGrid, which is bound to a dataset. I
> would like to hide certain columns, so that the user can't see them..
>
> Also was wondering if it was possible if when a cell was selected the

whole
> row is selected..
> I want it to behave like a Listbox, I guess..
>
> Thanks
>
> Wayne Gibson
>
>



 
Reply With Quote
 
Wayne Gibson
Guest
Posts: n/a
 
      2nd Sep 2003
Thanks, that helped a lot..


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
last column of windowsform.datagrid must take up rest of control rhaazy Microsoft Dot NET Framework Forms 0 20th Jul 2006 04:22 PM
Multiple row select on windowsform datagrid with hidden row headers Gav Microsoft Dot NET 0 19th Sep 2005 05:10 PM
Select row in dataGrid - WindowsForm PawelR Microsoft C# .NET 1 29th Jun 2005 02:48 PM
Insert new Row DataGrid WindowsForm Steven M Microsoft Dot NET Framework 7 3rd Mar 2005 02:17 PM
C# - DataGrid on Windowsform. Wayne Gibson Microsoft C# .NET 2 2nd Sep 2003 05:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:29 AM.