2014-05-07 91 views
1

感謝您花時間閱讀我的問題,我已經Google搜索並閱讀了大量文章,並且沒有嘗試過,我在Windows桌面應用程序中使用了infragistisc,請告訴我爲什麼我不能編輯它? (我的意思是,當我點擊它,它什麼都不做)無法編輯UltraGrid?

設計師:

Me.mygrid.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ 
       Or System.Windows.Forms.AnchorStyles.Left) _ 
       Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) 
    Me.mygrid.Cursor = System.Windows.Forms.Cursors.Default 
    Me.mygrid.DisplayLayout.AddNewBox.ButtonConnectorStyle = Infragistics.Win.UIElementBorderStyle.None 
    Appearance5.BackColor = System.Drawing.Color.White 
    Me.mygrid.DisplayLayout.Appearance = Appearance5 
    Me.mygrid.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns 
    UltraGridBand1.AddButtonCaption = "DummyBand 1" 
    UltraGridBand1.CardSettings.AllowSizing = False 
    Me.mygrid.DisplayLayout.BandsSerializer.Add(UltraGridBand1) 
    Me.mygrid.DisplayLayout.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid 
    Me.mygrid.DisplayLayout.GroupByBox.ShowBandLabels = Infragistics.Win.UltraWinGrid.ShowBandLabels.None 
    Me.mygrid.DisplayLayout.MaxBandDepth = 1 
    Me.mygrid.DisplayLayout.MaxRowScrollRegions = 1 
    Me.mygrid.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No 
    Me.mygrid.DisplayLayout.Override.AllowColMoving = Infragistics.Win.UltraWinGrid.AllowColMoving.NotAllowed 
    Me.mygrid.DisplayLayout.Override.AllowColSizing = Infragistics.Win.UltraWinGrid.AllowColSizing.None 
    Me.mygrid.DisplayLayout.Override.AllowColSwapping = Infragistics.Win.UltraWinGrid.AllowColSwapping.NotAllowed 
    Me.mygrid.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.[False] 
    Me.mygrid.DisplayLayout.Override.AllowGroupBy = Infragistics.Win.DefaultableBoolean.[False] 
    Me.mygrid.DisplayLayout.Override.AllowGroupMoving = Infragistics.Win.UltraWinGrid.AllowGroupMoving.NotAllowed 
    Me.mygrid.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.[False] 
    Me.mygrid.DisplayLayout.Override.AllowRowLayoutCellSizing = Infragistics.Win.UltraWinGrid.RowLayoutSizing.None 
    Me.mygrid.DisplayLayout.Override.AllowRowLayoutLabelSizing = Infragistics.Win.UltraWinGrid.RowLayoutSizing.None 
    Me.mygrid.DisplayLayout.Override.AllowRowSummaries = Infragistics.Win.UltraWinGrid.AllowRowSummaries.[False] 
    Me.mygrid.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.[True] 
    Appearance6.BackColor = System.Drawing.Color.Transparent 
    Me.mygrid.DisplayLayout.Override.CardAreaAppearance = Appearance6 
    Appearance7.TextVAlignAsString = "Middle" 
    Me.mygrid.DisplayLayout.Override.CellAppearance = Appearance7 
    Me.mygrid.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect 
    Appearance8.BackColor = System.Drawing.Color.FromArgb(CType(CType(89, Byte), Integer), CType(CType(135, Byte), Integer), CType(CType(214, Byte), Integer)) 
    Appearance8.BackColor2 = System.Drawing.Color.FromArgb(CType(CType(7, Byte), Integer), CType(CType(59, Byte), Integer), CType(CType(150, Byte), Integer)) 
    Appearance8.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical 
    Appearance8.FontData.BoldAsString = "True" 
    Appearance8.FontData.Name = "Arial" 
    Appearance8.FontData.SizeInPoints = 10.0! 
    Appearance8.ForeColor = System.Drawing.Color.White 
    Appearance8.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent 
    Me.mygrid.DisplayLayout.Override.HeaderAppearance = Appearance8 
    Me.mygrid.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti 
    Appearance9.BackColor = System.Drawing.Color.WhiteSmoke 
    Me.mygrid.DisplayLayout.Override.RowAlternateAppearance = Appearance9 
    Appearance10.BackColor = System.Drawing.Color.FromArgb(CType(CType(89, Byte), Integer), CType(CType(135, Byte), Integer), CType(CType(214, Byte), Integer)) 
    Appearance10.BackColor2 = System.Drawing.Color.FromArgb(CType(CType(7, Byte), Integer), CType(CType(59, Byte), Integer), CType(CType(150, Byte), Integer)) 
    Appearance10.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical 
    Me.mygrid.DisplayLayout.Override.RowSelectorAppearance = Appearance10 
    Me.mygrid.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.[True] 
    Me.mygrid.DisplayLayout.Override.RowSizing = Infragistics.Win.UltraWinGrid.RowSizing.Fixed 
    Appearance11.BackColor = System.Drawing.Color.FromArgb(CType(CType(251, Byte), Integer), CType(CType(230, Byte), Integer), CType(CType(148, Byte), Integer)) 
    Appearance11.BackColor2 = System.Drawing.Color.FromArgb(CType(CType(238, Byte), Integer), CType(CType(149, Byte), Integer), CType(CType(21, Byte), Integer)) 
    Appearance11.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical 
    Me.mygrid.DisplayLayout.Override.SelectedRowAppearance = Appearance11 
    Me.mygrid.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.[Single] 
    Me.mygrid.DisplayLayout.TabNavigation = Infragistics.Win.UltraWinGrid.TabNavigation.NextControl 
    Me.mygrid.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) 
    Me.mygrid.Location = New System.Drawing.Point(28, 177) 
    Me.mygrid.Name = "mygrid" 
    Me.mygrid.Size = New System.Drawing.Size(543, 268) 
    Me.mygrid.TabIndex = 2 

說我綁定數據的方式:

Dim dt As New DataTable 
      dt = GetData(Order) 
      Dim dtcloned As DataTable = dt.Clone() 
      dtcloned.Columns(0).DataType = GetType(Integer) 
      dtcloned.Columns(1).DataType = GetType(Boolean) 
      lblCantidadCont.Text = dt.Rows.Count.ToString() 
      For Each row As DataRow In dt.Rows 
       dtcloned.ImportRow(row) 
      Next 

      mygrid.DataSource = dtcloned 

回答

2

乍一看,這行是錯(分裂的可讀性)

Me.mygrid.DisplayLayout.Override.CellClickAction = 
       Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect 

應該

Me.mygrid.DisplayLayout.Override.CellClickAction = 
       Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText 
+0

這就是發生了什麼事。 – user3044096