Is it safe to change datagridcolumn cell style at run time?
-
The question is in the title. I just need to relieve myself of the gnawing worries, that is, until someone answers "No".
-
The question is in the title. I just need to relieve myself of the gnawing worries, that is, until someone answers "No".
It should be safe because you are only changing the style and do not delete it or anything like that.
-
It should be safe because you are only changing the style and do not delete it or anything like that.
Thank you, but one more thing: I have come across examples that involve replacing DataGridColumn objects in handlers for AutoGeneratingColumn event. Would you consider that unsafe?
-
Thank you, but one more thing: I have come across examples that involve replacing DataGridColumn objects in handlers for AutoGeneratingColumn event. Would you consider that unsafe?
I have no experience with this. But it sounds kinda scry to me :sigh:
-
Thank you, but one more thing: I have come across examples that involve replacing DataGridColumn objects in handlers for AutoGeneratingColumn event. Would you consider that unsafe?
You are trying to replace an Event (AutoGeneratingColumn) with an object? I think you mean and auto generated column with a customised datagridcolumn, therefore replacing one object with the same type of object just custom built. I would think this would be reasonable, be prepared for the column collection to object but I don't see how. I would locate the column in the collection and customise it in place rather than replacing it. Caveat - I have never done this either!
Never underestimate the power of human stupidity RAH
-
You are trying to replace an Event (AutoGeneratingColumn) with an object? I think you mean and auto generated column with a customised datagridcolumn, therefore replacing one object with the same type of object just custom built. I would think this would be reasonable, be prepared for the column collection to object but I don't see how. I would locate the column in the collection and customise it in place rather than replacing it. Caveat - I have never done this either!
Never underestimate the power of human stupidity RAH
Thank you, too, but I had written "... replacing DataGridColumn objects in handlers for AutoGeneratingColumn event ...". The author of such an example also expressed concerns, like you did.
-
Thank you, too, but I had written "... replacing DataGridColumn objects in handlers for AutoGeneratingColumn event ...". The author of such an example also expressed concerns, like you did.
Ah that makes more sense, I would still try and change the existing columns properties rather than replacing it. In one scenario I know the content of the first 4 columns and change the individual formats in the afterautocolumngenerated event (the event name maybe wrong :-O ). The remainder are from a pivot query and are not formatted.
Never underestimate the power of human stupidity RAH