Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 31-01-2009
Member
 
Join Date: Aug 2008
Posts: 40
How to lock some columns in a datagrid

Hi,
I don't know if it is possible or not.
I am working on Vb.Net platform & need to know if its possible?
Is it possible to lock some columns from the datagrid & the user can scroll the remaining columns?

Thanks in advance.
Reply With Quote
  #2  
Old 31-01-2009
Member
 
Join Date: Jan 2008
Posts: 56
Re: How to lock some columns in a datagrid

You can use 2 different datagrid for this requirement.
One is locked & second is free to scroll.

DataGridTextBoxColumn has a ReadOnly property. You must define a
DataGridTableStyle that refer to your source and add a DataGridTextBoxColumn
for each column you want to show. You set the ReadOnly property to true if
you want to prevent the user from modifying the data.
Reply With Quote
  #3  
Old 31-01-2009
Member
 
Join Date: Nov 2005
Posts: 631
Re: How to lock some columns in a datagrid

I created an application with a datagrid and textboxes on a form. The datagrid and textboxes are bound to the same data set from a data adapter, using an Access data base. So when you navigate through the datagrid information, the textboxes also show the corresponding fields. My problem is, I want the datagrid to only show a few of the columns, and just have the rest of the information in the textboxes. I tried looking up hiding or deleting columns in vb help, but none helped. It had information on adding columns and something about a tables style collection and gridcolumns style, but that is all empty in mine. I know I can get rid of columns in the data adapter but that means I cannot access that information for the textboxes. I hope I am making enough sense, but any help would be greatly appreciated! I know hiding columns is easier for web apps, and apparently there's a datagrid property builder thing for that, but a stupid windows form is much more complicated. Thanks in advance!!!
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to lock some columns in a datagrid"
Thread Thread Starter Forum Replies Last Post
HP Pavilion dv4 not getting charged only Scroll/Num Lock and Caps Lock LED's blinking Pillars Portable Devices 5 31-01-2012 10:06 PM
Issue with Dinovo Mini backslash, caps lock and num lock keys Jarini Hardware Peripherals 7 02-11-2010 02:27 AM
Set warning sound for Caps lock,Num lock in Windows 7 rajmalhotra Operating Systems 3 13-05-2009 02:49 PM
Notification area/ How to get rid of Caps Lock, Scroll Lock Heidi Vista Help 4 27-03-2009 06:46 PM
How can I get the row count from DataGrid? Shashikant Software Development 4 04-02-2009 11:47 PM


All times are GMT +5.5. The time now is 03:47 AM.