I have a Checkboxlist in which Items are binded from database.
Now what I want is, whenever user checks Registration / Conveyance Deed value from the list, Then the gridview should get disabled.
I tried with below code.
protected void ddlStatus_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlStatus.SelectedValue == "30" && strMode == "M")
{
GridExpInfo.AllowAddingRecords = false;
}
else
{
GridExpInfo.AllowAddingRecords = true;
}
}
What happens is, it always shows the selected value of Agreement from the list, which is 20
Below is the screenshot of the list
update
ASPX:-
<asp:CheckBoxList ID="ddlStatus" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
</asp:CheckBoxList>
C#
private void BindStatus()
{
DataTable dtstatus = new DataTable();
OracleDataAdapter dastatus = new OracleDataAdapter("SELECT lookup_code agr_type_code, meaning agr_type " +
"FROM apps.fnd_lookup_values_vl " +
"WHERE (NVL ('', territory_code) = territory_code OR territory_code IS NULL " +
") AND lookup_type = 'XXACL_FARM_AGR_TYPE' " +
"AND (lookup_type LIKE 'XXACL_FARM_AGR_TYPE') " +
"AND (view_application_id = 0) " +
"AND (security_group_id = 0) " +
"ORDER BY 1", ObjPriCon);
dastatus.Fill(dtstatus);
ddlStatus.DataTextField = "agr_type";
ddlStatus.DataValueField = "agr_type_code";
ddlStatus.DataSource = dtstatus;
ddlStatus.DataBind();
}
