S
Steve Hershoff
Hi everyone,
I have a DataGrid with several TemplateColumns. One of these columns has an
EditItemTemplate that contains an ASP.Net DropDownList. I'm catching this
DropDownList's SelectedIndexChanged event.
I also have another TemplateColumn, with a RequiredFieldValidator that
validates a TextBox in the column. It all looks like this, in broad
strokes:
<TemplateColumn>
<EditItemTemplate>
<aspropDownList OnSelectedIndexChanged="some method">
</aspropDownList>
</EditItemTemplate>
</TemplateColumn>
<TemplateColumn>
<EditItemTemplate>
<asp:TextBox id="textbox1">
</asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="textbox1">
</asp:RequiredFieldValidator>
</EditItemTemplate>
</TemplateColumn>
When I'm in the method that catches the SelectedIndexChanged event, can I
somehow retrieve the RequiredFieldValidator and set its properties? I've
been noodling with FindControl() in various incarnations but haven't found
the right mix yet. Any help or snippets are appreciated.
Thanks!
I have a DataGrid with several TemplateColumns. One of these columns has an
EditItemTemplate that contains an ASP.Net DropDownList. I'm catching this
DropDownList's SelectedIndexChanged event.
I also have another TemplateColumn, with a RequiredFieldValidator that
validates a TextBox in the column. It all looks like this, in broad
strokes:
<TemplateColumn>
<EditItemTemplate>
<aspropDownList OnSelectedIndexChanged="some method">
</aspropDownList>
</EditItemTemplate>
</TemplateColumn>
<TemplateColumn>
<EditItemTemplate>
<asp:TextBox id="textbox1">
</asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="textbox1">
</asp:RequiredFieldValidator>
</EditItemTemplate>
</TemplateColumn>
When I'm in the method that catches the SelectedIndexChanged event, can I
somehow retrieve the RequiredFieldValidator and set its properties? I've
been noodling with FindControl() in various incarnations but haven't found
the right mix yet. Any help or snippets are appreciated.
Thanks!