Hi,
I'm binding a runtime-generated DataTable which is passed as a model via Razor. No updates are required, however I'd like to style a few of the known columns. This means that the .Column(b => b.For(c => ???)).Template("<a href... />") syntax doesn't work.
I've found a few answers on this forum mostly pointing towards creating a proper model etc, however in my case that won't work because it's unknown at design time.
A possible solution would be to retrospectively apply a template at runtime with JavaScript, making use of the $("#myGrid').live('iggridheaderrendered') features, however I've not been able to apply a column template here. I've even tried making the cell data actually BE the hyperlink, but after encoding it doesn't display.
The column in question will always be column zero.
Is there a way to do this?
Thanks, Tom
Hi Tom,
if you handle iggriddatarendering, columns should always be available at that point, no matter if they are auto-generated, or manually defined. Let me know if that works for you. Thanks,
Angel
I am struggeling at the same point. I have changed the template property of a column in the iggriddatarendering event, but only the initial template string is used.
It seems not to be used. :-(
Kind regards,
Tom
okay, the reason is the change of column.template has no effect, because the rowtemplate is previously constructed internally.
The change of the column has no effect on this.
Has anybody an idea, how to change the column template dynamically?
I have opened a customer case for you. Developer support will assist you with creating an internal customer issue and we will handle it from there.
Meanwhile you can try calling dataBind for the grid. It will render the grid anew but the new template you have provided will be used. This is a workaround but you can use it temporarily.
Thank you for using the Infragistics forums!