0

I have some user controls that contain asp.net GridViews and Repeaters and before binding data to them, i have to run some checks. I need to know whether certain controls exist in a TemplateField or ItemTemplate. Of course i cannot do .Row[0].FindControl, because there are no rows at this stage.

Tys
  • 3,592
  • 9
  • 49
  • 71

1 Answers1

0

Before calling Databind, you cannot check any of the databound templates for controls.

Not sure what your situation is, but perhaps you can loop through your data and validate there?

Kenneth Ito
  • 5,201
  • 2
  • 25
  • 44
  • So, you can add template fields programmatically, but you cannot do anything with the existing ones? – Tys Apr 11 '12 at 22:33
  • I did it by parsing the usercontrol as a textfile. That worked fine :) – Tys Apr 11 '12 at 22:56