Telerik Forums
Kendo UI for Angular Forum
0 answers
34 views
0

Below is my code snippet.

string query = $@" select name from inventory where id = @p1;

Var data=mycontext.Database.SqlQuery(query,typeid); Var returndata =data.ToDataSourceResult(request);

Here inventory is the view which contains around 262 columns and myclass is the corresponding c# class which contains the variable for view. I m getting data from db within seconds. But this ToDataSourceResult is taking very long time. Can anyone please help me on this. I cant make any changes to this view columns

Aswini
Top achievements
Rank 1
 asked on 11 Oct 2023
1 answer
126 views

I am using the external filter example

https://www.telerik.com/kendo-angular-ui/components/grid/filtering/external-filtering/

When initially filter, it filters and saves the filterValue as it does in the example

When I closed and re-open I get the following message: 



Error: There is no user-defined filter with 'sender_Name' field provided through the [filters] input property.

sender_name is the correct field. Below is the filters I am using.


export const  caseFilters: FilterExpression[] = [
    {
        field: 'sender_Name',
        editor: 'string',
    },
    {
      field: 'assign_To',
      title: 'Assign To',
      editor: 'string',
    },  
    {
        field: 'last_Date',
        title: 'Last Date',
        editor: 'date',
    },
    {
        field: 'case_Level',
        title: 'Level',
        editor: 'number',
    },
  
  ];


<div class="example-config">
  <p class="k-form-hint">
    Click the button below to filter the Grid from an external Filter
    component
  </p>
  <button kendoButton (click)="openFilter()" icon="filter">
    Filter the Grid
  </button>
</div>

<kendo-window *ngIf="opened" (close)="closeFilter()" [width]="620" [top]="300">
<div class="window-content">
    <kendo-filter #filter [value]="filterValue" [filters]="caseFilters">
    </kendo-filter>
    <button kendoButton (click)="applyFilter(filter.value)" style="width:100%;">Apply filter</button>
</div>
</kendo-window>

 


public applyFilter(value: CompositeFilterDescriptor): void {
  this.gridData = filterBy(this.orignalGridData, value);
  this.loadGrid();
  this.filterValue = value;
}

Preslava
Telerik team
 answered on 02 May 2022
1 answer
78 views

Hello, 

Hope that everyone is safe and well. 

I am developing an "Operations Dashboard", which consumes Kendo UI for Angular chart components to create different visualizations (bar charts, treemaps, data grid, KPIs).

All the visualizations need to retrieve the data from the same service, which at some point will be an internal API. For now, I am using a mock-up JSON file. 

Which is the best way to build this service? Can I use Kendo for jQuery DataSource? It will be compatible with my angular application and the Kendo UI charts?

Or should I explore other options for Angular?

 

Thanks!

 

 

1 answer
266 views

Hi,

We have a grid which displays a dialog for the user to add a record. Once it's been added the webapi (c#) returns the new record id and the dialog closes.

How can I get the grid to be reloaded with the new record as the first row and still honour the sorts/filters and still use DataSourceRequest and ToDataSourceResult() ?

I think I'm after a UNION but with the new record first.

Cheers,

Grahame

Grahame
Top achievements
Rank 1
Iron
 answered on 14 Jul 2021
1 answer
1.9K+ views

I want to reset the filter settings without making the call again. I need to do this because at the change of page I have to set the grid without filters but without call the function again because the data are the same

This is my component:

 
 gridData: GridDataResult;
  state: State = {
    skip: 0,
    take: 25
  };

  clearState: State = {
    skip: 0,
    take: 25
  };

  //DATASOURCE
  products: any[] = [];

  public dataStateChange(state: DataStateChangeEvent): void {
    this.state = state;
    this.gridData = process(this.products, this.state);
  }

public filterChange(filter: CompositeFilterDescriptor): void {
    this.filter = filter;
    this.products = filterBy(this.products, filter);
  }

public clearFilters() {
  this.state = this.clearState;
  this.gridData = process(this.products, this.clearState);
}

public getProducts(){
    this.myService.getData(year).subscribe(data => {
      this.products= data;
      this.gridData = process(data, this.state);
    });
}



                                    

    <kendo-grid
            [data]="gridData"
            [pageSize]="state.take"
            [skip]="state.skip"
            [sort]="state.sort"
            [filter]="state.filter"
            [sortable]="true"
            [pageable]="true"
            [filterable]="true"
            [selectable]="true"
            [resizable]="true"
            (filterChange)="filterChange($event)"
            (dataStateChange)="dataStateChange($event)">
                    <ng-template ngFor [ngForOf]="columns" let-column>
                        <kendo-grid-column
                            width="{{column.width}}"
                            format="{{column.format}}"
                            filter="{{column.filter}}"
                            field="{{column.value}}"
                            title="{{column.title}}">
                        </kendo-grid-column>
                    </ng-template>
   </kendo-grid>

if I call the clearFilters function the filters are reset but the arrows remain on the previously filtered columns. then the data in the table returns as originally but the css part of the table remains filtered (attached img)

 

 

Yanmario
Telerik team
 answered on 25 Jun 2021
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?