Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
590
WDG - How can I tell if the column is a template field?
posted

I am iterating through my grid as below and need to base some logic on whether the grid column in question - gridField is a template field or a bound field of the grid.

foreach (GridField gridField in wdg.Columns)

Hope someone can help.

  • 33839
    Verified Answer
    posted

    Hi asanghi,

    Could you try the following?

    bool isTemplate = gridField is TemplateDataField;

    If that doesn't quite work, you could try getting the actual type.  And then compare it to typeof(TemplateDataField).

    regards,

    David Young