Show message in empty cells in GridView

后端 未结 4 2097
野性不改
野性不改 2021-01-06 14:03

I\'m importing GridView from excel I need to show a message near every empty cell to give the user information about what it should be writing..



        
4条回答
  •  余生分开走
    2021-01-06 14:18

    Maybe you can use a ToolTip to show your alert:

    toolTip1.ToolTipIcon = ToolTipIcon.Warning;
    toolTip1.ToolTipTitle = "Warning!";
    toolTip1.Show("Missing 'First Name'", x, y);
    

    You only need to guess the location of the cell based on the sizes of the rows and columns of the DataGridView.

    Example1 Example2

    ToolTip is in System.Windows.Forms namespace.

提交回复
热议问题