TValue as Int64doesn't work

I am trying to convert from Telerik Blazor's suite as you have quite a few more controls than they have, but I am having a problem with the first component that I am trying to replace.

<SfDropDownList TValue="Int64"
                TItem="Account"
                Placeholder="Select Account"
                @bind-Value="@SelectedAccountId"
                DataSource="@ValidAccounts">
    <DropDownListFieldSettings Value="Id" Text="IdName" />
</SfDropDownList>

My primary keys are all Int64's.  The above code renders a disabled component.  If I remove the TValue and TItem definitions, I still get a disabled component.  But if I change it to use a list of objects with Int32's as the primary key, I get an enabled component that works fine.

This was my definition with Telerik's suite:

<TelerikDropDownList Data="@ValidAccounts"
    @bind-Value="@SelectedAccountId"
    TextField="IdName"
    ValueField="Id" />

Is there any way around this with your controls?  

3 Replies

SP Sureshkumar P Syncfusion Team April 27, 2020 11:33 AM UTC

Hi Randy, 
 
Greetings from Syncfusion support.  
 
Based on your shared information, we suspect that you want to render the dropdownlist with int64 TValue. We suggest you use “int?” int nullable type instead of int64 into the TValue property to resolve the issue.  
 
Kindly refer the below code example.  
 
<SfDropDownList TValue="Int?" 
                TItem="Account" 
                Placeholder="Select Account" 
                @bind-Value="@SelectedAccountId" 
                DataSource="@ValidAccounts"> 
    <DropDownListFieldSettings Value="Id" Text="IdName" /> 
</SfDropDownList> 
 
 
Regards, 
Sureshkumar P 



RW Randy Wessels April 27, 2020 04:40 PM UTC

Sadly that won't help.  I get compile errors as the bind@-value is a long datatype.  Even if I change that to a nullable long type, it is still a datatype mismatch of int? to long?.  The list of objects that it is using for the datasource:  @ValidAccounts have primary keys that are longs.  While I will never have that many items in the dropdown at one time, this is a multi-tenant system where millions of records are being written and deleted.  That is why I choose a long primary key instead of just an int key.  

I supposed I could hack it on each side so that it converts it to and from a string.  That just seems like extra work for  what might be an issue with long/int64 binding on every control.

public class Account
{
     public long Id {get;set;}
     public string Name {get;set;}
     ...lots of other stuff...
}

-Randy


SP Sureshkumar P Syncfusion Team April 29, 2020 01:50 PM UTC

Hi Randy, 
 
Thanks for your update.  
 
We confirmed this as bug in our end and include the fix in the upcoming May 13th ,2020 patch release. You can track the status of the bug in the below feedback link. We appreciate your patience until then  
 
 
Regards, 
Sureshkumar P 


Loader.
Up arrow icon