I have read http://www.componentsource.com/products/webcombo-net/summary.html that webcombo can be validated via requiredfield validator.
But when i use
<igcmbo:WebCombo ID="cboTransmission" runat="server" BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" ForeColor="Black" SelBackColor="DarkBlue" SelForeColor="White" Version="4.00" Width="77px" OnInitializeLayout="cboTransmission_InitializeLayout"> <Columns> <igtbl:UltraGridColumn> <header caption="Column0"></header> </igtbl:UltraGridColumn> </Columns> <ExpandEffects ShadowColor="LightGray" /> <DropDownLayout BorderCollapse="Separate" RowHeightDefault="20px" Version="4.00" ColWidthDefault="" DropdownHeight="" DropdownWidth=""> <HeaderStyle BackColor="LightGray" BorderStyle="Solid"> <BorderDetails ColorLeft="White" ColorTop="White" WidthLeft="1px" WidthTop="1px" /> </HeaderStyle> <FrameStyle BackColor="Silver" BorderStyle="Ridge" BorderWidth="2px" Cursor="Default" Font-Names="Verdana" Font-Size="10pt"> </FrameStyle> <RowStyle BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px"> <BorderDetails WidthLeft="0px" WidthTop="0px" /> </RowStyle> <SelectedRowStyle BackColor="DarkBlue" ForeColor="White" /> </DropDownLayout> </igcmbo:WebCombo> <asp:RequiredFieldValidator ID="cvTransmission" ControlToValidate="cboTransmission runat="server" InitialValue="" ErrorMessage="Transmission cannot be null." ValidationGroup="vgApp">*</asp:RequiredFieldValidator>
I got the error
Control 'cboTransmission' referenced by the ControlToValidate property of 'cvTransmission' cannot be validated.
I am using Infragistics2.WebUI.WebCombo.v7.2
I don't want's to use custom validator
What can I do ?
Use custom validator with this:
function ValidateCombo(oCombo,ColIndex) { try {
var grid=oCombo.getGrid(); var rowCount=grid.Rows.length; var currVal=''; var comboText=oCombo.displayValue;
for(i=0;i<rowCount;i++){ var row=grid.Rows.getRow(i); currVal=row.getCell(ColIndex).getValue(); if (currVal == comboText) { return true; } } return false; } catch ( err ) { var txtMessage = document.title + " - Error in ValidateCombo()\n" + err.description ; alert( txtMessage ) ; }
}
Hi ,
I want to validate webcombo using custom validator when invalid data is entered.
my sinario is
1) Bind a data set with webcombo-- (working fine)
2) while typing inside the webcomo it will display the suggestion --- (working fine)
3) suppose i enter a wrong value (whic is not in combolist) the i want display an alert message -- no idea
pls help me
I think you might be using editable combo. even I am using that in my application. my requirement is I need to allow the user to create the new record and at the same user can select the existing one. I should raise error only if the displayvalue of the webcombo is null.we can't use required field validator for webcombo. I have used custom validator in that I have checked the displayvalue of the webcombo at the client side.
I hope this can help you...
{
var str=combo.getDisplayValue();
// alert(combo.getDisplayValue());
else
args.IsValid = true;
<asp:CustomValidator ID="CVddlBusinessProces" runat="server" ErrorMessage="Please Select a Process or Enter the Name for Create"
Width="296px" ClientValidationFunction="ValidateBusinessProcess" ValidateEmptyText="True" ValidationGroup="BusinessProcessvalidation"></asp:CustomValidator>
Can you try looking into this http://forums.infragistics.com/forums/t/1213.aspx