Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I have a form where I am populating laundry details for the customer from the database onto datagridview.I want to mark these rows as disabled i.e grayed out , so that the user is unable to select these rows.

I have tried a few things such as making these rows read-only,making datagridview disable.I want to make only a few rows disabled(those fetched from database) rest of the rows where user makes a new data entry should be enabled/selected.

Appreciate any Help.
Please provide the code/examples.

Thanks
Cheers
:)
Posted

project99 wrote:
Please provide the code/examples.


Because if we tell you what to do, you won't know enough C# to understand us ?

Why does making them read only not work ? What if you render them the way you want to, and as a seperate thing, catch the mouse/kb actions related to those rows and reject them without allowing an edit ?
 
Share this answer
 
Don't post fake answers, edit your post. You obviously need to do what I said then, handle the events that start the delete process, check if the row is read only, and if so, stop the delete. Nothing else is going to work.
 
Share this answer
 
"You have mistaken the above was not my answer but a reply to your qs as why not read-only."

As I said, BECAUSE it's not an answer, don't push the button with ANSWER written on it, but instead, edit your post to add the detail.
 
Share this answer
 
Why don't you use 2 separate datagrids. One for viewing previous orders and another to create new orders. Surely this would be a better way to go. You can make the first on completely uneditable(is this a word?).
 
Share this answer
 
User is still able to delete the read-only rows.
The rows fetched from the DB are only a view to the user(user should not be able to make any action on them) but at the same time any new dataentry that the user makes should be selectable,can be deleted.

How do i tap the mouse/kb actions on rows from DB and then reject them.

Thanks for your Help.
 
Share this answer
 
You have mistaken the above was not my answer but a reply to your qs as why not read-only.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900