感谢您抽出宝贵时间阅读我的问题,我搜索了很多帖子并阅读了我尝试过的任何内容,我在Windows桌面应用程序中使用了infragistisc,你能不能告诉我为什么我可以'编辑它? (我的意思是,当我点击它时,它什么都不做)
设计师:
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
答案 0 :(得分:2)
乍一看这条线是错误的(为了便于阅读而分开)
Me.mygrid.DisplayLayout.Override.CellClickAction =
Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect
应该是
Me.mygrid.DisplayLayout.Override.CellClickAction =
Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText