how do I conditionally change a DataGridViewButtonColumn?

I'd like to change the text and disable the column if a certain condition is true in the row. What events or methods should I be altering?
[140 byte] By [cuniculosis] at [2007-12-23]
# 1

Hi,

your 'certain condition' is a little vague. Which event is used is up to your condition. Is it TextChanged or just a timer... ? Change the text and disable the column is easy, you can set the relative property, say Text property or Visible property.

gqlu at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 2
In this example I want to be able to specify conditions related to business rules.

For example if column a is greater than column b, or some other formula.

cuniculosis at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...
# 3

Hi,

As I said, when to check the condition is all up to you. You may check it after the data is loaded or updated everytime.

Because your conditions are related to your business rules, you'd better not hard-code the rules. Write the rules in another file, therefore you have more flexibility.

gqlu at 2007-8-30 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...