protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            int questionID = Request.QueryString["id"] == null ? 0 : Int32.Parse(Request.QueryString["id"]);

            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                //Get questionID here
                int attributeID     = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "attributeID"));
                int AttributeTypeID = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "attributeTypeID"));
                //pass Question ID to your DB and get all available options for the question
                //Bind the RadiobUttonList here
                RadioButtonList scoreTxtBoxElm  = (RadioButtonList)e.Item.FindControl("scoreTxtBx");
                HiddenField     attributeIDText = (HiddenField)e.Item.FindControl("attributeID");
                fillRelevanceScore(scoreTxtBoxElm, false);

                //if (AttributeTypeID == 1001)
                {
                    RadioButtonList RadioButtonList1 = (RadioButtonList)e.Item.FindControl("radlstPubs");

                    List <KMSABET.MyPocos.QueAttributeOption> optionsList = new List <KMSABET.MyPocos.QueAttributeOption>();

                    Boolean isRelevanceApplicable = false;
                    DBUtils dbUtils = new DBUtils();
                    String  query   = "SELECT * FROM Q_Attribute_Options QAO"
                                      + " JOIN Q_Attribute ON attribute_id = Q_Attribute_attribute_id"
                                      + " WHERE Q_Attribute_attribute_id = " + attributeID.ToString()
                                      + " ORDER BY QAO.PRIORITY_OPTION";
                    SqlDataReader attributeListReader = dbUtils.readOperation(query);
                    while (attributeListReader.Read())
                    {
                        KMSABET.MyPocos.QueAttributeOption optionTemp = new KMSABET.MyPocos.QueAttributeOption();

                        isRelevanceApplicable        = (Boolean)attributeListReader["IS_RELEVANCE_APPLICABLE"];
                        optionTemp.attributeOptionId = (int)attributeListReader["attribute_option_id"];
                        optionTemp.optionStatement   = attributeListReader["PRIORITY_OPTION"].ToString()
                                                       + " - " + attributeListReader["option_statement"].ToString();
                        //optionTemp.attributeId = (int)attributeListReader["Q_Attribute_attribute_id"];
                        optionsList.Add(optionTemp);
                    }

                    dbUtils.closeDBConnection();
                    QueAttributeOption optionIgnoreThis = new QueAttributeOption();
                    optionIgnoreThis.attributeOptionId = 214748364 + attributeID;
                    optionIgnoreThis.optionStatement   = "Ignore This";
                    optionsList.Add(optionIgnoreThis);

                    RadioButtonList1.DataSource     = optionsList;
                    RadioButtonList1.DataTextField  = "optionStatement";
                    RadioButtonList1.DataValueField = "attributeOptionId";
                    RadioButtonList1.DataBind();

                    attributeIDText.Value = attributeID.ToString();

                    if (isRelevanceApplicable == false)
                    {
                        Label scoreTxtBoxLabel = (Label)e.Item.FindControl("Label1");
                        scoreTxtBoxLabel.Visible = false;
                        scoreTxtBoxElm.Visible   = false;
                    }

                    Boolean goneInside = false;
                    if (questionID != 0)
                    {
                        QueDao dbUtils1 = new QueDao();
                        List <QueAttributeOption> attOptions = dbUtils1.getOptionsListByAttributeIDQuestionID(attributeID, questionID);
                        foreach (QueAttributeOption attOption in attOptions)
                        {
                            scoreTxtBoxElm.SelectedValue   = attOption.score.ToString();
                            RadioButtonList1.SelectedValue = attOption.attributeOptionId.ToString();
                            goneInside = true;
                        }
                    }
                    if (goneInside == false)
                    {
                        RadioButtonList1.SelectedValue = optionIgnoreThis.attributeOptionId.ToString();
                    }
                }

                /*else if (AttributeTypeID == 1002)
                 * {
                 *  CheckBoxList CheckBoxList1 = (CheckBoxList)e.Item.FindControl("chkBxList1");
                 *
                 *  List<KMSABET.MyPocos.QueAttributeOptions> optionsList = new List<KMSABET.MyPocos.QueAttributeOptions>();
                 *
                 *  DBUtils dbUtils = new DBUtils();
                 *  SqlDataReader attributeListReader = dbUtils.readOperation("SELECT * FROM Q_Attribute_Options"
                 + " JOIN Q_Attribute ON attribute_id = Q_Attribute_attribute_id AND attribute_type_id = 1002"
                 + " WHERE Q_Attribute_attribute_id = " + attributeID.ToString());
                 +  while (attributeListReader.Read())
                 +  {
                 +      KMSABET.MyPocos.QueAttributeOptions optionTemp = new KMSABET.MyPocos.QueAttributeOptions();
                 +
                 +      optionTemp.attributeOptionId = (int)attributeListReader["attribute_option_id"];
                 +      optionTemp.optionStatement = attributeListReader["option_statement"].ToString();
                 +      optionTemp.attributeId = (int)attributeListReader["Q_Attribute_attribute_id"];
                 +      optionsList.Add(optionTemp);
                 +  }
                 +  dbUtils.closeDBConnection();
                 +
                 +  CheckBoxList1.DataSource = optionsList;
                 +  CheckBoxList1.DataTextField = "optionStatement";
                 +  CheckBoxList1.DataValueField = "attributeOptionId";
                 +  CheckBoxList1.DataBind();
                 +
                 +  if (questionID != 0)
                 +  {
                 +      QueDao dbUtils1 = new QueDao();
                 +      List<QueAttributeOptions> attOptions = dbUtils1.getOptionsListByAttributeIDQuestionID(attributeID, questionID);
                 +      TextBox scoreTxtBoxElm = (TextBox)e.Item.FindControl("scoreTxtBx");
                 +      foreach (QueAttributeOptions attOption in attOptions)
                 +      {
                 +          scoreTxtBoxElm.Text = attOption.scoreValue.ToString();
                 +          CheckBoxList1.Items.FindByValue(attOption.attributeOptionId.ToString()).Selected = true;
                 +      }
                 +  }
                 + }*/
            }
        }
        protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {

                //Get attributeId here
                int AttributeID = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "attributeID"));
                int AttributeTypeID = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "attributeTypeID"));
                //pass Question ID to your DB and get all available options for the question
                //Bind the RadiobUttonList here

                if (AttributeTypeID == 1001)
                {
                    RadioButtonList RadioButtonList1 = (RadioButtonList)e.Item.FindControl("radlstPubs");

                    List<KMSABET.MyPocos.QueAttributeOption> optionsList = new List<KMSABET.MyPocos.QueAttributeOption>();

                    List<QueAttributeOption> options = queDaoObj.getAttributeOptionListByAttrID(AttributeID.ToString());
                    foreach (QueAttributeOption option in options)
                    {
                        optionsList.Add(option);
                    }
                    QueAttributeOption optionIgnoreThis = new QueAttributeOption();
                    optionIgnoreThis.attributeOptionId = 214748364 + AttributeID;
                    optionIgnoreThis.optionStatement = "Ignore This";
                    optionsList.Add(optionIgnoreThis);

                    RadioButtonList1.DataSource = optionsList;

                    Boolean goneInside = false;
                    if (ViewState["searchCriteria"] != null)
                    {
                        selectedItemList = (Dictionary<String, String>)ViewState["searchCriteria"];
                        foreach (QueAttributeOption item in optionsList)
                        {
                            if (selectedItemList.ContainsKey(item.attributeOptionId.ToString()))
                            {
                                goneInside = true;
                                RadioButtonList1.SelectedValue = item.attributeOptionId.ToString();
                            }
                        }
                    }
                    if (goneInside == false)
                    {
                        RadioButtonList1.SelectedIndex = 0;
                    }

                    RadioButtonList1.DataTextField = "optionStatement";
                    RadioButtonList1.DataValueField = "attributeOptionId";
                    RadioButtonList1.DataBind();
                }
                else
                {
                    Label fromLabelComp = (Label)e.Item.FindControl("fromLabel");
                    Label toLabelComp = (Label)e.Item.FindControl("toLabel");
                    TextBox fromTextComp = (TextBox)e.Item.FindControl("fromText");
                    TextBox toTextComp = (TextBox)e.Item.FindControl("toText");
                    fromLabelComp.Visible = true;
                    toLabelComp.Visible = true;
                    fromTextComp.Visible = true;
                    toTextComp.Visible = true;
                    if (ViewState["searchCriteriaRangeValue"] != null)
                    {
                        rangedValueList = (List<QuestionRangedValue>) ViewState["searchCriteriaRangeValue"];
                        foreach(QuestionRangedValue rangedValue in rangedValueList)
                        {
                            if (rangedValue.attributeID == AttributeID.ToString())
                            {
                                fromTextComp.Text = rangedValue.fromValue;
                                toTextComp.Text = rangedValue.toValue;
                            }
                        }
                    }
                }
            }
        }