P
philipl
hi,
i have a datagrid which display custom controls when user clicks edit,
changing data. I am using customvalidator to validate this control. I
can get validation of user input to work no problem when user clicks
on update in datagrid.
My problem is that when I try to get customvalidation to work when
user changes the value in the control, as i want this to be checked as
soon as user changes the control. The custom control offers an
OnServerChanged event which I can call the customvalidation but I
don't know how to access my custom validation control when I am in
this event. Does any know how i can do this?
Here is my code:
<asp:TemplateColumn HeaderStyle-CssClass="header"
HeaderText="Language">
<ItemTemplate>
<asp:Label runat="server" ID="lang"
Text='<%#DataBinder.Ev(Container.DataItem, "langname")%>'/>
</ItemTemplate>
<EditItemTemplate>
<ccl:combobox id="langEntry"
autopostback="true" runat="server" Style="FONT-FAMILY:verdana"
DataSource='<%# ListLanguageList() %>' DataTextField="lang"
DataValueField="langID">
</ccl:combobox>
<asp:CustomValidator
id="customcbval" Runat="server" ControlToValidate="langEntry"
OnServerValidate="cbLangCheck"
ErrorMessage="You must select
language from list" Display="Dynamic"></asp:CustomValidator>
</EditItemTemplate>
</asp:TemplateColumn>
//code-behind function which gets called when my custom control
changes
protected void langentry_textchanged(object sender, System.EventArgs
e)
{
// don't know how i can call my customvalidatot here
}
i have a datagrid which display custom controls when user clicks edit,
changing data. I am using customvalidator to validate this control. I
can get validation of user input to work no problem when user clicks
on update in datagrid.
My problem is that when I try to get customvalidation to work when
user changes the value in the control, as i want this to be checked as
soon as user changes the control. The custom control offers an
OnServerChanged event which I can call the customvalidation but I
don't know how to access my custom validation control when I am in
this event. Does any know how i can do this?
Here is my code:
<asp:TemplateColumn HeaderStyle-CssClass="header"
HeaderText="Language">
<ItemTemplate>
<asp:Label runat="server" ID="lang"
Text='<%#DataBinder.Ev(Container.DataItem, "langname")%>'/>
</ItemTemplate>
<EditItemTemplate>
<ccl:combobox id="langEntry"
autopostback="true" runat="server" Style="FONT-FAMILY:verdana"
DataSource='<%# ListLanguageList() %>' DataTextField="lang"
DataValueField="langID">
</ccl:combobox>
<asp:CustomValidator
id="customcbval" Runat="server" ControlToValidate="langEntry"
OnServerValidate="cbLangCheck"
ErrorMessage="You must select
language from list" Display="Dynamic"></asp:CustomValidator>
</EditItemTemplate>
</asp:TemplateColumn>
//code-behind function which gets called when my custom control
changes
protected void langentry_textchanged(object sender, System.EventArgs
e)
{
// don't know how i can call my customvalidatot here
}