protected void ddlCompany_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlCompany.SelectedIndex > 0)
                {
                    txtExchangeRateFactor.Enabled     = true;
                    txtTransactionReceiptDate.Enabled = true;
                    imgBtnInsert.Enabled = true;

                    exchangeRateFactorsBL = new ExchangeRateFactorsBL();
                    DataSet companyData = exchangeRateFactorsBL.GetCompanyData(ddlCompany.SelectedValue, out errorId);
                    exchangeRateFactorsBL = null;

                    if (companyData.Tables.Count != 0 && errorId != 2)
                    {
                        Session["ExchangeRateFactorData"] = companyData.Tables[1];
                        gvExchangeRateDetails.PageIndex   = 0;

                        //WUIN-746 clearing sort hidden files
                        hdnSortExpression.Value = string.Empty;
                        hdnSortDirection.Value  = string.Empty;

                        BindGrid(companyData.Tables[1]);

                        ddlCompany.Items.FindByValue(companyData.Tables[0].Rows[0]["company_code"].ToString()).Selected = true;
                        txtDomesticCurrency.Text         = companyData.Tables[0].Rows[0]["currency_code"].ToString();
                        txtDomesticCurrencyGrouping.Text = companyData.Tables[0].Rows[0]["domestic_currency_group"].ToString();
                    }
                    else
                    {
                        ExceptionHandler("Error in fetching data", string.Empty);
                    }
                }
                else
                {
                    txtDomesticCurrency.Text          = string.Empty;
                    txtDomesticCurrencyGrouping.Text  = string.Empty;
                    txtExchangeRateFactor.Enabled     = false;
                    txtTransactionReceiptDate.Enabled = false;
                    imgBtnInsert.Enabled = false;

                    dtEmpty = new DataTable();
                    gvExchangeRateDetails.DataSource = dtEmpty;
                    gvExchangeRateDetails.DataBind();
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler("Error in selecting company.", ex.Message);
            }
        }