Telerik Forums
Kendo UI for Angular Forum
0 answers
33 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
90 views

hi,

I am trying to sort and display Stacked Bar chart where by the the chart should display in descending order of USD (US Dollars) with 'Others' displayed at the rightmost. Please see the StackBlitz example below.

https://stackblitz.com/edit/angular-10-thmpbt-onpvwr?file=src%2Fapp%2Fapp.component.ts,src%2Fapp%2Fapp.component.html

But it is not working as expected as I see 'Others' and few other items with Zero values displayed in the middle of the chart. Any thoughts on whats wrong here. Please note, the 'chartDataSource' has data sorted and fed to chart.

 

Yanmario
Telerik team
 answered on 15 Dec 2022
1 answer
143 views

I am using "filterBy" function from Kendo-data-grid in my Angular app.

I have a data  where column names consists of special characters such as 'Product. Name'. I able to filter all the columns(which has names without special characters). I am not able to filter the columns(which has name with special characters).

How can i filter the columns even with specialcharactes in its names.

Example: Example

Please help me regarding this.

 

Yanmario
Telerik team
 answered on 06 Dec 2022
1 answer
124 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
91 views

Noticed today, while using the toDataSourceRequestString method in @progress/kendo-data-query, that when passing in the SortDescriptor's, although dir? is an optional property, if you leave it null, the SortDescriptor will be excluded from processing and not included in the resultant string. We had to look really closely at the documentation of the property to see that it explicitly tells us that's the case, but seems odd that the dir? is set as optional. Just trying to understand the logic behind this decision... Why is the property optional, if its required?

 

(Ignore the tag, couldn't find an appropriate tag to use...)

Svet
Telerik team
 answered on 03 Dec 2021
0 answers
81 views

Hello, 

This one is tough. 

I want to build something like this:

or:

An Alternative to Tree-Maps

 

This is my code:

<kendo-chart>
        <kendo-chart-series>
          <kendo-chart-series-item class="negative-toDo"
          type="bar"
          [gap]="0.5"
          [stack]="true"
          *ngFor="let item of negativeWorkflowsBarchartData"
          [data]="item.items"
          [name]="item.value"
          aggregate="count"
          field="workflowName"
          categoryField="project"
          >
          </kendo-chart-series-item>
          <kendo-chart-series-item class="positive-inProgress"
          type="bar"
          [stack]="true"
          *ngFor="let item of positiveWorkflowsBarchartData"
          [data]="item.items"
          [name]="item.value"
          aggregate="count"
          field="workflowName"
          categoryField="project"
          >
          </kendo-chart-series-item>
          <kendo-chart-series-item-tooltip format="Tasks count: {0}">
          </kendo-chart-series-item-tooltip>
        </kendo-chart-series>
        <kendo-chart-legend position="bottom" orientation="horizontal">
        </kendo-chart-legend>
      </kendo-chart>

 

And this is my output:

As you see I am duplicating series, I want to have one set (<kendo-chart-series-item class="negative-toDo") negative/ in the left side of the 0.

 

How I can make the count negative? can you help me, please, with the aggregate function that can make this happen?

 

 

Best regards,

Nazareth

 

Nazareth
Top achievements
Rank 1
 asked on 25 Aug 2021
1 answer
77 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
264 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.8K+ 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
1 answer
108 views

Hi,

 

Can I use groupBy for a column of boolean datatype?

like this:

const datasource = groupBy(s.value, [{field: 'MyBoolProperty'}]);

 

I am trying to pass this to a Dropdownlist and it works if the column is a string typed column.

 

Best regards

Flemming Christiansen

Alexander Valchev
Telerik team
 answered on 24 May 2019
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?