Hi,
I have validationfield control on a different tab and a datalist control on another tab.
I am trying to edit a record in my datalist but everytime i click on ImageButton, validation throws an error message which is not related to the datalist at all.
I thought to use validationgroup in my validationfield control and ImageButton control. But i can not find the property in Imagebutton control.
Is there a way to group them together?
thanks,
Kamal
I have the same concern. I really hope there is a property to set the validation group.
Edit: Apparently it is not supported which was really stupid on Infragistics part since now I can't use the WebImageButton.
Hi, you can implement ValidationGroups in the following way...
Add these two methods to your Masterpage/Page/Usercontrol (ie where the WebImageButton resides..
{
}
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "ValidateGroupOnClick",
and my button looks like this in Markup...
<igtxt:WebImageButton ID="YourWebImageButtonID" runat="server" Text="Add People Contact" AutoSubmit="true" CausesValidation="false" ><RoundedCorners HeightOfBottomEdge="2" HoverImageUrl="ig_butCRM2.gif" ImageUrl="ig_butCRM1.gif" MaxHeight="40" MaxWidth="400" PressedImageUrl="ig_butCRM2.gif" RenderingType="FileImages" WidthOfRightEdge="2" /> </igtxt:WebImageButton>
This seems to work. For what its worth, on examining the source code the reason why infragistis have not implemented the ValidationGroup property is because the WebImageControl does not implement the System.Web.UI.WebControls.IButtonInterface. Also, there are no actual server controls inside the WebImageButton that implement this interface that could host the ValidationGroup property, and consequently register it with the ASP validator jscript. So they chose not to bother. I guess this shows it would have been pretty easy to do. Next release maybe?
Cheers,
Nick
thanks for this; 2 years later and they still haven't gor round to adding this!
I already had a click event in my code doing further client side validation, so just wrapped that javascript with:
if (Page_ClientValidate("MyValidationGroup")) {
//further validation
The bit I forgot was to set CauseValidation on the button to false as I was now calling that myself in the click event.
Thanks once again
Andrew