I may have painted myself into a corner, or, being new to Telerik controls, just don't understand what I'm supposed to be doing.
I've inherited from GridBoundColumn to make my own ClientColumn. My ClientColumn class has a DisplayStyle property which determines how data is rendered in the grid. For example, if DisplayStyle is set to 1, then the column will display the ID of the client. If it's set to 2, it will display the name of the client.
I've got two of these columns in my grid, and each sets the DisplayStyle differently.
When the page initially displays, everything looks great. However, when the user pages to the next set of data, the ColumnCreating event fires. I presume that I am supposed to reinstantiate the columns, placing them in e.Column. However, the event doesn't appear to tell me which column I'm supposed to create. It only tells me the type (via the e.ColumnType property). I suppose I could make an assumption that ColumnCreating gets called in the order in which the columns appear, and count calls to ColumnCreating, but that feels extremely kludgey.
Is there a better way to handle this?
I've inherited from GridBoundColumn to make my own ClientColumn. My ClientColumn class has a DisplayStyle property which determines how data is rendered in the grid. For example, if DisplayStyle is set to 1, then the column will display the ID of the client. If it's set to 2, it will display the name of the client.
I've got two of these columns in my grid, and each sets the DisplayStyle differently.
When the page initially displays, everything looks great. However, when the user pages to the next set of data, the ColumnCreating event fires. I presume that I am supposed to reinstantiate the columns, placing them in e.Column. However, the event doesn't appear to tell me which column I'm supposed to create. It only tells me the type (via the e.ColumnType property). I suppose I could make an assumption that ColumnCreating gets called in the order in which the columns appear, and count calls to ColumnCreating, but that feels extremely kludgey.
Is there a better way to handle this?