How do I make a drop down list visible and invisible in a grid, based on the selected value of another drop doWn list -PLEASE READ THE WHOLE QUESTION

Posted on 2007-09-30
Last Modified: 2012-06-21
I have a grid view consisting of about 7 columns namely, treatment reason, treatment id, status code , letter code , etc Treatment reason , treatment id, status code, letter code have drop down lists.treatment id drop down list populated by the values from a table and contains values such as 1, 2, 3.

when treatment id "1" is selected, a value from the status code drop down list must be selected ,
otherwise, the drop down list needs  to be hidden from the user, when adding a row or updating a row.
or the user should not be able to select any status code when treatment id is not "1".

Can anyone help me accomplish this ASAP USING ASP.NET AND C#2.0

It's very urgent. If i can get the logic/ code , that'll be grrreat.

I have one more question.
I have a table which ha sthe following columns
Treatment reason id pk, fk, not null
treatment id,pk, fk, not null
status code,pk, fk, not null
letter code fk not null
ttp null

treatment reason id, treatment id , status code constitute composite primary key.
as mentioned above, the user must select a status code only when the treatment id is "1", otherwise,
status code should be stored as an empty string in the sql server table.

I'm not able to arrive at the solution as status code is part of the composite primary key for the table and
it cannot be null.

Please help me accomplish this as it's extremely urgent.
I need it by tomorrow morning.If I can get the logic/ code , that'll be grreat!

Question by:amukta
    LVL 14

    Assisted Solution

    in the SELECTEDITEM CHANGED even of the treatment ID
    write code to select the status code ...(enable / make visible the STATU CODE field)
    this event will be fired even when you are adding a thts to it... for the first question
    LVL 14

    Accepted Solution

    you should not have COMPOSITE PRIMARY KEY columns that will hold the value as wht if you want to...instead of storing NULL(which you cannot) a default value like "0"(incase it is INT) or "NA" (if its a varchar)...
    but you have to make sure the COMPOSITE PK contraint applies for it...otherwise error will thrown as DUPLICATE primary key constraint violation

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now