Ejemplo n.º 1
0
        private void dgFields_EditCommand(object source, DataGridCommandEventArgs e)
        {
            dgFields.EditItemIndex = e.Item.ItemIndex;
            dgFields.DataKeyField  = "FieldId";
            BindValues();
            int       sid = int.Parse(e.Item.Cells[0].Text);
            LdapField lf  = LdapField.Load(sid);

            foreach (DataGridItem dgi in dgFields.Items)
            {
                DropDownList ddEqual = (DropDownList)dgi.FindControl("ddEqual");
                if (ddEqual != null)
                {
                    ddEqual.SelectedValue = lf.Equal ? "true" : "false";
                }

                DropDownList ddIbnName = (DropDownList)dgi.FindControl("ddIbnName");
                if (ddIbnName != null)
                {
                    ddIbnName.SelectedValue = lf.IbnName;
                }

                DropDownList ddLdapName = (DropDownList)dgi.FindControl("ddLdapName");
                if (ddLdapName != null)
                {
                    try
                    {
                        ddLdapName.SelectedValue = lf.LdapName;
                    }
                    catch { }
                    ddLdapName.Attributes.Add("onchange", "ChangeLdap(this)");
                }
            }
        }