I want to change the DBGrid.Option.I found the following code:

DBGrid.Options:=DBGrid.Options + [dgEditing];
DBGrid.Options:=[dgEditing];

But do not work properly and the error [dgEditing]. I want to enable or disable the [dgEditing],[dgRowSelect] mode.

thanks a lot, a lot.

有帮助吗?

解决方案

When working with set types, this is how you do :

DBGrid.Options := DBGrid.Options + [dgEditing];  // Adds dbEditing option

DBGrid.Options := DBGrid.Options - [dgEditing];  // Removes dbEditing option

To change several options at once :

DBGrid.Options := DBGrid.Options + [dgEditing,dgRowSelect]; 
DBGrid.Options := DBGrid.Options + [dgEditing] + [dgRowSelect]; // Same as above
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top