How can I prevent the plus-minus icon that appears next to the row header when I have a datagrid displayed bound to a datasource that has a relation defined
Set the DataGrid.AllowNavigation property to false.
How can I adjust the version number for multiple projects without changing every AssemblyInfo.cs file constantly?
The version information needs to be set with the ‘AssemblyVersion’ attribute for each project. However, this attribute does not need to be specified in the project’s AssemblyInfo file. You can create a separate file with the ‘AssemblyVersion’ attribute that is shared across projects that you wish to keep in sync. This file can either be shared via VSS, or by including the file as a link in the projects.
Why are the Tooltips not being shown on a NumericUpDown control?
This is because of a bug in the .net framework. When tooltips are set on a control that hosts other controls within it (like the numeric updown), tooltips are not shown on those child controls. To workaround this issue, do the following in code: [C#] foreach(Control c in this.numericUpDown1.Controls) { this.tooltip.SetToolTip(c, ‘mytooltip’); } [VB.Net] Dim c As Control For Each c In Me.numericUpDown1.Controls Me.tooltip.SetToolTip(c, ‘mytooltip’) Next
How do I format a date column in a datagrid
If you have added a table style to your datagrid (so individual column styles have been generated), then you can use code such as this to set the Format property of the particular column style. [C#] //add format col 3 columnstyle where column 3 holds a date… DataGridTextBoxColumn dgtbc; dgtbc = dataGrid1.TableStyles[0].GridColumnStyles[3] as DataGridTextBoxColumn; if(dgtbc != null) dgtbc.Format = ‘g’; // or ‘u’ or whatever format you want to see [VB.NET] ’add format col 3 columnstyle where column 3 holds a date… Dim dgtbc as DataGridTextBoxColumn dgtbc = CType(dataGrid1.TableStyles(0).GridColumnStyles(3), DataGridTextBoxColumn) If Not dgtbc is Nothing Then dgtbc.Format = ‘g’ ’ or ‘u’ or whatever format you want to see End If
How can I listen to changes in a file/directory in the windows file system?
Use FileSystemWatcher to watch for changes in a specified directory. You can watch for changes in files and subdirectories of the specified directory. The component can watch files on a local computer, a network drive, or a remote computer.