Results 1 to 6 of 6

Thread: How to display data?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234

    Angry How to display data?

    I read some data from database and I'm wondering how to display that data to the user (which cotnrol to use)?
    Namely, I read from database four column (first name, last name, address, and active- can be true or false) and about 0-300 rows. User can see all columns but changes are allow only for 'active' column. What do you think which control I need?
    I try with datagrid but how to allow user to change value only in one column? Then I try checkedListBox, but it can't display more than one column ...
    I hope that you have some code snippet or link to solve my problem.

    regard j

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    I think I'd go for a ListView with four TextBoxes underneath it that line up with the colums. Copy the data from the selected row into the TextBoxes (on the ListView's Selected event) and set the .ReadOnly property True for the textboxes that don't correspond to the 'active' column.
    This world is not my home. I'm just passing through.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234
    I'd like to column 'active' be checkbox column. Can I do it in listview?

    regard j

  4. #4
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Wouldn't the easiest be to use the datagrid, the Active indicator probably came in as a checkbox automatically. You can then define a CustomTableStyles for the datagrid to define what is modifiable and what is not (Maybe setting to ReadOnly?)

    Sorry I don't have any code to share, as I haven't actually done this, but it would seem as though it would be the easiest solution.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234
    Like I already said it's not so easy to set only one column in datagrid to be readable. If you know how to do this please share with as.

    regard j

  6. #6
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    It may well be that the datagrid is the way to go. I've never used this control so I can't comment.

    If you want to use a ListView then yes you can have 'active' as a checkbox column as long as it's the first (leftmost) column. Just set the CheckBoxes property on the ListView to true (you'll have already selected Details for the View property).


    EDIT: On reflection I guess this isn't strictly true - the checkbox applies to the entire row, but if your first column dosen't have any text in it then it looks like it's a column of checkboxes.
    This world is not my home. I'm just passing through.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width