Results 1 to 3 of 3

Thread: How to lock some columns in a datagrid

  1. #1
    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.

  2. #2
    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.

  3. #3
    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!!!

Similar Threads

  1. Replies: 5
    Last Post: 31-01-2012, 10:06 PM
  2. Issue with Dinovo Mini backslash, caps lock and num lock keys
    By Jarini in forum Hardware Peripherals
    Replies: 7
    Last Post: 02-11-2010, 02:27 AM
  3. Set warning sound for Caps lock,Num lock in Windows 7
    By rajmalhotra in forum Operating Systems
    Replies: 3
    Last Post: 13-05-2009, 02:49 PM
  4. Replies: 4
    Last Post: 27-03-2009, 06:46 PM
  5. How can I get the row count from DataGrid?
    By Shashikant in forum Software Development
    Replies: 4
    Last Post: 04-02-2009, 11:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,263,336.74248 seconds with 16 queries