1
Answer

dropdown list css not working when it is disabled, why?

Photo of Dilip Solanki

Dilip Solanki

12y
1.4k
1
Hello Friendz...


I have a problem...

When i m going to disable dropdown list on checkbox then dropdownlist related css not working, but i want that dropdownlist  related css effect should be displayed and dropdownlist related selection related work should be locked only.



PROBLEM RELATED CODE:

<asp:CheckBox ID="chkbox_border_style" runat="server" Text="Same for all" AutoPostBack="true" TextAlign="Right" class="form_property_heading" oncheckedchanged="chkbox_border_style_CheckedChanged" />

<asp:DropDownList ID="drpdwn_border_style_top" class="section_id_drpdwn" width="70%" runat="server">
                                                <asp:ListItem>Select Your Desired Top Border Style</asp:ListItem>
                                                <asp:ListItem>dashed</asp:ListItem>
                                                <asp:ListItem>dotted</asp:ListItem>
                                                <asp:ListItem>double</asp:ListItem>
                                                <asp:ListItem>groove</asp:ListItem>
                                                <asp:ListItem>hidden</asp:ListItem>
                                                <asp:ListItem>inset</asp:ListItem>
                                                <asp:ListItem>none</asp:ListItem>
                                                <asp:ListItem>outset</asp:ListItem>
                                                <asp:ListItem>ridge</asp:ListItem>
                                                <asp:ListItem>solid</asp:ListItem>
                                                <asp:ListItem>inherit</asp:ListItem>
                                            </asp:DropDownList>



protected void chkbox_border_style_CheckedChanged(object sender, EventArgs e)
    {
        if (chkbox_border_style.Checked == true)
        {
            drpdwn_border_style_top.Enabled = false;
            
        }

        if (chkbox_border_style.Checked == false)
        {
            drpdwn_border_style_top.Enabled = true;
            
        }
    }

Answers (1)

0
Photo of Nitin Sontakke
NA 11.7k 2.2k 7y
I must admit that I don't quite understand your code. However, it is not quite clear which column of which table exactly here has unique index / primary key declared.
 
Also not clear how exactly, are you reproducing scenario of two inserts at identical time.
 
Also, not clear how a duplicate row can possibly get inserted when unique key is defined.
 
0
Photo of Rakesh Singh
NA 10 321 7y
Hi Nitin,
yes, we have created unique index for the below sample table:
 
 
DECLARE @falics TABLE (Id int, faliId int, TimeId int)
INSERT INTO Table1
( ForecastLineItemId
, TimeId
, CurrencyAmt
, CreateUserId
, CreateDttm
, UpdateUserId
, UpdateDttm)
OUTPUT INSERTED.ForecastLineItemCellId, INSERTED.ForecastLineItemId, INSERTED.TimeId INTO @falics
SELECT
ForecastLineItemId
, TimeId
, CurrencyAmt
, CreateUserId
, CreateDttm
, UpdateUserId
, UpdateDttm
FROM @adjustmentCellsTable
ORDER BY ForecastLineItemId, TimeId
SELECT Id FROM @falics ORDER BY faliId, TimeId
and we have the below sample insert query: 
sb.AppendLine("INSERT INTO Table1 ")
sb.AppendLine(" (ForecastVersionId ")
sb.AppendLine(" ,[CostCollectorId] ")
sb.AppendLine(" ,AdjustmentDesc ")
sb.AppendLine(" ,AdjustmentTypeCd ")
sb.AppendLine(" ,ElementCategoryId ")
sb.AppendLine(" ,CurrencyCd ")
sb.AppendLine(" ,AdjustmentAmt ")
sb.AppendLine(" ,SpeculativeInd ")
sb.AppendLine(" ,CreateUserId ")
sb.AppendLine(" ,CreateDttm ")
sb.AppendLine(" ,UpdateUserId ")
sb.AppendLine(" ,UpdateDttm ")
sb.AppendLine(" ,LastUpdateDttm) ")
sb.AppendLine(" VALUES ")
sb.AppendLine(" (@ForecastVersionId ")
sb.AppendLine(" ,@CostCollectorId ")
sb.AppendLine(" ,@AdjustmentDesc ")
sb.AppendLine(" ,@AdjustmentTypeCd ")
sb.AppendLine(" ,@ElementCategoryId ")
sb.AppendLine(" ,@CurrencyCd ")
sb.AppendLine(" ,@AdjustmentAmt ")
sb.AppendLine(" ,0 ")
sb.AppendLine(" ,@CreateUserId ")
sb.AppendLine(" ,@CreateDttm ")
sb.AppendLine(" ,@UpdateUserId ")
sb.AppendLine(" ,@UpdateDttm ")
sb.AppendLine(" ,@LastUpdateDttm ) ")
sb.AppendLine("SET @ForecastLineItemId = SCOPE_IDENTITY() ")
 
 
0
Photo of Nitin Sontakke
NA 11.7k 2.2k 7y
Please elaborate a bit. Share some code may be from back-end. 
 
How exactly are managing to test this scenario.
 
Which column you want to be unique? Have you already created primary key / unique index  on that column?