|
-
Sep 9th, 2003, 06:16 AM
#1
Thread Starter
Addicted Member
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
-
Sep 9th, 2003, 06:27 AM
#2
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.
-
Sep 9th, 2003, 06:32 AM
#3
Thread Starter
Addicted Member
I'd like to column 'active' be checkbox column. Can I do it in listview?
regard j
-
Sep 9th, 2003, 07:03 AM
#4
Fanatic Member
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.
-
Sep 9th, 2003, 07:16 AM
#5
Thread Starter
Addicted Member
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
-
Sep 9th, 2003, 07:33 AM
#6
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|