MultiSelect Property: DataGridView

MultiSelect influences selection behavior. When you create a new DataGridView, the user can select many cells at once. This is appropriate for some programs, but not for all. In this document, we take a look at how you can disable this feature with the MultiSelect property.

MultiSelect

This DataGridView article describes the MultiSelect property in Windows Forms.

Change MultiSelect

First, your program should have a DataGridView control. You need to add columns and rows to this control somehow; you can see information on doing this in a separate tutorial. Next, in Visual Studio, right-click on the DataGridView and select Properties. Then, locate the MultiSelect property and change it to False.

DataGridView TipsProperty (Icon copyright Microsoft)

MultiSelect = False. When this property is set to false, only one piece of the DataGridView can be selected by the user at once. This can mean one row is selected; one cell is selected; or one column is selected. In the screenshot, only one cell is selected because MultiSelect was set to False.

Summary

MultiSelect is a useful property on the DataGridView control. Most programs I have built have it set to False; this is because the programs do not mutate multiple cells at once. If you do need to allow the user to change multiple cells at once, keep this property set to True.

Windows Forms
.NET