Setting ReadOnly to true makes the data source read-only so that the controls bound to this data source can not make any modifications. Setting it to true will prevent cell content modifications as well as adding and deleting of rows regardless of the AllowAdd and AllowDelete settings. This property caues the IBindingList.ReadOnly implementation in UltraDataSource to return true.
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinDataSource Imports Infragistics.Win.UltraWinGrid Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click ' Following code disables adding rows in all bands except first ' child band. UltraDataBand object has AllowAdd property whose ' default value is Default, in which case AllowAdd property off ' the UltraDataSource is used. However if AllowAdd off an ' UltraDataBand is explicitly set, it overrides the setting off ' the UltraDataSource. The same applies to AllowDelete and ReadOnly ' properties. ' Me.UltraDataSource1.AllowAdd = False Me.UltraDataSource1.Band.ChildBands(0).AllowAdd = DefaultableBoolean.True Me.UltraDataSource1.AllowDelete = False Me.UltraDataSource1.Band.ChildBands(0).AllowDelete = DefaultableBoolean.True ' NOTE: Setting ReadOnly to true disables adding and deleting rows ' regardless of the AllowAdd and AllowDelete property settings. Me.UltraDataSource1.ReadOnly = False Me.UltraDataSource1.Band.ChildBands(0).ReadOnly = DefaultableBoolean.False End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinDataSource; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void button1_Click(object sender, System.EventArgs e) { // Following code disables adding rows in all bands except first // child band. UltraDataBand object has AllowAdd property whose // default value is Default, in which case AllowAdd property off // the UltraDataSource is used. However if AllowAdd off an // UltraDataBand is explicitly set, it overrides the setting off // the UltraDataSource. The same applies to AllowDelete and ReadOnly // properties. // this.ultraDataSource1.AllowAdd = false; this.ultraDataSource1.Band.ChildBands[0].AllowAdd = DefaultableBoolean.True; this.ultraDataSource1.AllowDelete = false; this.ultraDataSource1.Band.ChildBands[0].AllowDelete = DefaultableBoolean.True; // NOTE: Setting ReadOnly to true disables adding and deleting rows // regardless of the AllowAdd and AllowDelete property settings. this.ultraDataSource1.ReadOnly = false; this.ultraDataSource1.Band.ChildBands[0].ReadOnly = DefaultableBoolean.False; }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2