AllowCustom Not Working

Good Day Syncfusion Group,

 Can you please help me what is the solution for AllowCustom="true" is not working?, my source code is:

Thanks in Advance..

Nelson 
 



6 Replies

UD UdhayaKumar Duraisamy Syncfusion Team January 5, 2023 10:51 AM UTC

The Value field in the ComboBox component must be of type string when the AllowCustom feature is enabled. If you need to use a different type for the Value field, you can use the CustomValueSpecifier event to send the Item instead.

For more information, please refer to the documentation and sample code provided in the release notes at this link: https://blazor.syncfusion.com/documentation/release-notes/18.3.35?type=all#combobox

<div id="ControlRegion">

    <div class='control-wrapper'>

        <p>@ComboVal</p>

        <SfComboBox TValue="decimal" TItem="EmployeeData" CssClass="template" Placeholder="Select a customer" DataSource="@Data" AllowCustom="true" AllowFiltering="true" @bind-Value="ComboVal">

            <ComboBoxFieldSettings Value="UnitCost" Text="UnitCost"></ComboBoxFieldSettings>

            <ComboBoxEvents TValue="decimal" TItem="EmployeeData" CustomValueSpecifier="@customValue"></ComboBoxEvents>

        </SfComboBox>

    </div>

</div>

 

@code {

    public decimal ComboVal;

 

    private void customValue(CustomValueSpecifierEventArgs<EmployeeData> args)

    {

        args.Item = new EmployeeData() { UnitCost = decimal.Parse(args.Text), TypeOfUse = args.Text };

    }

    public class EmployeeData

    {

        public string TypeOfUse { get; set; }

        public decimal UnitCost { get; set; }

    }

    List<EmployeeData> Data = new List<EmployeeData>();

 

    }


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/AllowCustom_TValue_is_decimal122530040


[ Reference ]

 



NT Nelson Tan January 6, 2023 03:52 PM UTC

Good Day UdhayaKumar Duraisamy ,


Thanks for  the reply .. it working..


Nelson



UD UdhayaKumar Duraisamy Syncfusion Team January 9, 2023 05:10 AM UTC

Thank you for letting us know that it's working! We are glad to help.



ST steve replied to UdhayaKumar Duraisamy August 28, 2025 05:05 AM UTC

Hi UdhayaKumar,

Can you please help.

I want to get the following functionality in the ComboBox like image that I have attached.



But, the sample in the link does not provide the functionality, even though AllowCustom is true.


Can you please tell me what I am doing wrong?


Attachment: ComboBox_dropdown_ab5c4c8c.jpg


ST steve replied to steve August 28, 2025 05:53 AM UTC

Hi, I found answer in another post.

Documentation was not clear. I think that it needs to be improved.




PK Priyanka Karthikeyan Syncfusion Team August 29, 2025 01:18 PM UTC

Hi steve,

Thanks for pointing that out! Since you’ve found the answer, we’ll make sure to update the documentation in one of our upcoming releases to reflect it more clearly.

Regards,

Priyanka K


Loader.
Up arrow icon