enforce mutual exclusion in text-box of a datagrid control

M

Mark Siffer

Suppose I have a datagrid with two template column

<asp:datagrid id="mydatagrid" runat="server" . . . >
<Columns>
<asp:TemplateColumn>
<asp:EditItemTemplate>
<asp:TextBox id="text1" runat="server/>
</asp:EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<asp:EditItemTemplate>
<asp:TextBox id="text2" runat="server/>
</asp:EditItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>


I want to enforce that one and only one textbox can have a value in it at a
time. So if text1 is populated, then text2 better not be. If text2 is
populated, text1 shouldn't be. Is there a way to do this? I was trying to
use a CustomerValidator but it appears to be privy only of its
ControlToValidate. Any ideas?

Thanks in advance
MS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top