Ejemplo n.º 1
0
 private void dataLayoutControl1_FieldRetrieved(object sender, DevExpress.XtraDataLayout.FieldRetrievedEventArgs e)
 {
     if (e.FieldName == "ConnectionWasTested" || e.FieldName == "IsFolder")
     {
         (e.Control as DevExpress.XtraEditors.CheckEdit).Properties.GlyphAlignment = DevExpress.Utils.HorzAlignment.Near;
         e.Item.TextVisible = false;
         return;
     }
     if (e.FieldName == "Description" || e.FieldName == "Preview")
     {
         e.Item.TextLocation = DevExpress.Utils.Locations.Top;
         return;
     }
     if (e.FieldName == "Props")
     {
         this.gc = e.Item.Control as DevExpress.XtraGrid.GridControl;
         if (this.gc == null)
         {
             return;
         }
         this.gc.UseEmbeddedNavigator = true;
         this.gc.ForceInitialize();
         this.gv             = (DevExpress.XtraGrid.Views.Grid.GridView) this.gc.MainView;
         this.gv.InitNewRow += new DevExpress.XtraGrid.Views.Grid.InitNewRowEventHandler(this.gridView2_InitNewRow);
         var ob = this.gv.OptionsBehavior;
         ob.Editable = true;
         ob.ReadOnly = false;
         var ov = this.gv.OptionsView;
         ov.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Top;
         ov.ShowFooter         = true;
     }
 }
 void dataLayoutControl1_FieldRetrieved(object sender, DevExpress.XtraDataLayout.FieldRetrievedEventArgs e)
 {
     if (e.FieldName == "FirstName" || e.FieldName == "LastName")
     {
         e.Control.BackColor = Color.GreenYellow;
     }
     if (e.FieldName == "ZipCode")
     {
         RepositoryItemComboBox riComboBox = e.RepositoryItem as RepositoryItemComboBox;
         riComboBox.TextEditStyle = TextEditStyles.DisableTextEditor;
         riComboBox.Items.Add("20505");
         riComboBox.Items.Add("20506");
         riComboBox.Items.Add("20507");
         riComboBox.Items.Add("20508");
         riComboBox.Items.Add("20509");
     }
 }