Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do you make records Read-only in mvc 4

Posted on 2014-04-18
4
Medium Priority
?
292 Views
Last Modified: 2014-04-23
Please help
       I want to be able to click on a button(s) and deactivate a row(s).
                1) click on a button(S)
                2) press the deactivate * * button
                3) the record is now read only and the text of the record is grayed out
                 4) the fact that this record is readonly has to be stored in the sql database for future inquires
ReadOnly.rtf
0
Comment
Question by:vcurtis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 40010184
Which part do you need help with exactly? Presumably you are already reading/writing data to your database.

There is no built-in way in the database to mark a record read only, so you need to do it yourself. A simple bit field should do the job.
0
 

Author Comment

by:vcurtis
ID: 40012990
You are right about the database, So I using the "bit" datatype. What I am not sure is, how can I do the following
  1) have the application Read the bit datatype as false/true
  2) have the  application "grey out" the record so it is read-only and cannot be clicked or
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 40013144
It depends how you are reading your data. If you are using a DataReader then calling GetBoolean with the index of your column will convert the bit to a bool.

Once you check that value you can simply set the Enabled property of your server controls to false to disable/grey them out.
0
 

Author Closing Comment

by:vcurtis
ID: 40018933
Thanks Carl
  That worked
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question