示例#1
0
    private void setComboState()
    {
        //fill the states has an unbound mode
        if (WebCombo1.Rows.Count == 0)
        {
            foreach (DataRow dr in CMStatesUI.getStates().Tables[0].Rows)
            {
                WebComboRow wcRow = new WebComboRow();

                WebComboCell wgTCell = new WebComboCell();
                wgTCell.Text = dr[0].ToString();
                wcRow.Cells.Add(wgTCell);

                // add hidden cell for the value, the column and properties is defined at design time.
                WebComboCell wgVCell = new WebComboCell();
                wgVCell.Text = dr[1].ToString();
                wcRow.Cells.Add(wgVCell);

                WebComboCell wghCell = new WebComboCell();
                wghCell.Text = dr[2].ToString();
                wcRow.Cells.Add(wghCell);

                // add the row to State
                WebCombo1.Rows.Add(wcRow);
            }
        }
    }
    private void setComboRiskValues()
    {
        if (wcRiskLevel.Rows.Count == 0)
        {
            for (int i = minValue; i <= maxValue; i++)
            {
                WebComboRow wcRow = new WebComboRow();

                WebComboCell wgTCell = new WebComboCell();
                wgTCell.Text = i.ToString();
                wcRow.Cells.Add(wgTCell);

                WebComboCell wgVCell = new WebComboCell();
                wgVCell.Text = i.ToString();
                wcRow.Cells.Add(wgVCell);

                wcRiskLevel.Rows.Add(wcRow);
            }
        }
    }