Dropdown DataGrid Search on TextProperty

For my employee data dropdown, it pulls via the employee ID. I have the dropdown TextProperty showing the username instead of the EmpID field and that works fine. The problem I am having is the search is still searching on the EmpID field with is the key the field is linked too.

I can enter and ID in the search and it shows me the username correctly but I need to be able to search with the username and not ID. I can't find where to change the search field.

By default filtering is on TextProperty if there is no extra code for filtering like LoadData, etc.

on other fields where there is only the ID and a value in the table, those work fine. This one has other fields in the table besides the EmpID and username. I can even see in the code in the output window where it is searching on EmpID for every keystroke and not the username so I get no results back if I enter a letter instead of a number.

You can attach Radzen.Blazor.csproj to your project to debug your case.

I don't understand what you are requesting I do? Sorry.

I also recommend checking the DropDownDataGrid demo page and comparing the working filtering configuration with yours.

I am using the Blazor Studio. I can see the SQL commands sent in the output window. Below is what I am seeing for the dropdown. You can see where it is trying to search by EmpID and not UserName. The text field is set to UserName and that is what is showing up in the dropdown. The search is searching by EmpID instead. Other search boxes on dropdowns are working correctly searching for the text and not the ID.

  SELECT [e].[EmpID], [e].[CostCenter], [e].[FirstName], [e].[LastName], [e].[ManagerID], [e].[ManagerName], [e].[PreferredFirstName], [e].[PreferredLastName], [e].[SupervisoryOrg], [e].[UserName]
  FROM [dbo].[EmployeeData] AS [e]
  WHERE [e].[EmpID] LIKE @__TypedProperty_0_rewritten ESCAPE N'\'
  ORDER BY [e].[EmpID]
  OFFSET @__TypedProperty_1 ROWS FETCH NEXT @__TypedProperty_2 ROWS ONLY

info: Microsoft.EntityFrameworkCore.Database.Command[20101]
Executed DbCommand (13ms) [Parameters=[@__TypedProperty_0='?' (Size = 450)], CommandType='Text', CommandTimeout='30']
SELECT [e].[EmpID], [e].[CostCenter], [e].[FirstName], [e].[LastName], [e].[ManagerID], [e].[ManagerName], [e].[PreferredFirstName], [e].[PreferredLastName], [e].[SupervisoryOrg], [e].[UserName]
FROM [dbo].[EmployeeData] AS [e]
WHERE [e].[EmpID] = @__TypedProperty_0

image

here is a screenshot of the dropdown as seen. If I type a letter here I get nothing back. As soon as start typing the employee ID like 200 I get a filtered list of names.

Can you post the code of the component?

           <RadzenColumn SizeMD="9">
               <RadzenDropDownDataGrid Data="@employeeDataForEmpID" TextProperty="UserName" ValueProperty="EmpID" AllowClear=true
                    Placeholder="Choose EmployeeData" style="display: block; width: 100%" @bind-Value="@pCstatusLog.EmpID" Name="EmpID"
                   SelectedValue=@employeeDataForEmpIDValue Count=@employeeDataForEmpIDCount LoadData=@employeeDataForEmpIDLoadData />
           </RadzenColumn>

Please post the code of this event as well.

   protected async Task employeeDataForEmpIDLoadData(LoadDataArgs args)
   {
       try
       {
           var result = await MotivaDesktopHardwareService.GetEmployeeData(top: args.Top, skip: args.Skip, count:args.Top != null && args.Skip != null, filter: $"contains(EmpID, '{(!string.IsNullOrEmpty(args.Filter) ? args.Filter : "")}')", orderby: $"{args.OrderBy}");
           employeeDataForEmpID = result.Value.AsODataEnumerable();
           employeeDataForEmpIDCount = result.Count;

           if (!object.Equals(miscHardwareLog.EmpID, null))
           {
               var valueResult = await MotivaDesktopHardwareService.GetEmployeeData(filter: $"EmpID eq '{miscHardwareLog.EmpID}'");
               var firstItem = valueResult.Value.FirstOrDefault();
               if (firstItem != null)
               {
                   employeeDataForEmpIDValue = firstItem;
               }
           }

       }
       catch (System.Exception ex)
       {
           NotificationService.Notify(new NotificationMessage(){ Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to load EmployeeData" });
       }
   }

Here is the code that filters by EmpID. I warned for this in my first post which you obviously ignored: