Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
147 views

Hi,

I've a grid, and I want show an associated chart. My code works fine, but when I filter the grid, I want that the Chart is binding with the new grid's data.

 My code:

  <div class="col-md-9">
 
        <telerik:RadGrid ID="gridDatos" runat="server" GroupPanelPosition="Top" AllowPaging="True" ShowGroupPanel="True"
            AllowSorting="True" ShowFooter="True" AllowFilteringByColumn="true"
            OnDataBound="gridDatos_DataBound" CellSpacing="-1" GridLines="Both" OnNeedDataSource="gridDatos_NeedDataSource">
....
 
        </telerik:RadGrid>
     
    <div class="col-md-3">
        <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server">
        </telerik:RadHtmlChart>
    </div>
 

Code Behind

protected void gridDatos_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
       {
           int numeroSemana = 0;
           int estadoOperacion = 0;
           int tipoOperacion = 0;
 
           Int32.TryParse(comboNumeroSemanas.SelectedValue.ToString(), out numeroSemana);
           Int32.TryParse(comboEstadoOperacion.SelectedValue.ToString(), out estadoOperacion);
           Int32.TryParse(comboTipoOperacion.SelectedValue.ToString(), out tipoOperacion);
 
           if (numeroSemana <= 0 || estadoOperacion <= 0 || tipoOperacion <= 0)
               return;
 
           var datos = GetInforme(numeroSemana, tipoOperacion, estadoOperacion);
           gridDatos.DataSource = null;
           gridDatos.DataSource = datos;
 
       }

protected void gridDatos_DataBound(object sender, EventArgs e)
        {
            GenerarGrafico();

        }

        private void GenerarGrafico()
        {
            List<InformeProcesado> ds = gridDatos.DataSource as List<InformeProcesado>;

            if (ds == null)
                return;

            RadHtmlChart1.PlotArea.Series.Clear();

            ColumnSeries serie0 = new ColumnSeries();
            SeriesItem r0 = new SeriesItem();
            r0.YValue = ds.Sum(x => x.Rango0);
            serie0.Items.Add(r0);
            RadHtmlChart1.PlotArea.Series.Add(serie0);

            ColumnSeries serie1 = new ColumnSeries();
            SeriesItem r1 = new SeriesItem();
            r1.YValue = ds.Sum(x => x.Rango1);
            serie1.Items.Add(r1);
            RadHtmlChart1.PlotArea.Series.Add(serie1);

            ColumnSeries serie2 = new ColumnSeries();
            SeriesItem r2 = new SeriesItem();
            r2.YValue = ds.Sum(x => x.Rango2);
            serie2.Items.Add(r2);
            RadHtmlChart1.PlotArea.Series.Add(serie2);

            ColumnSeries serie3 = new ColumnSeries();
            SeriesItem r3 = new SeriesItem();
            r3.YValue = ds.Sum(x => x.Rango3);
            serie3.Items.Add(r3);
            RadHtmlChart1.PlotArea.Series.Add(serie3);

            ColumnSeries serie4 = new ColumnSeries();
            SeriesItem r4 = new SeriesItem();
            r4.YValue = ds.Sum(x => x.Rango4);
            serie4.Items.Add(r4);
            RadHtmlChart1.PlotArea.Series.Add(serie4);

            ColumnSeries serie5 = new ColumnSeries();
            SeriesItem r5 = new SeriesItem();
            r5.YValue = ds.Sum(x => x.Rango5);
            serie5.Items.Add(r5);
            RadHtmlChart1.PlotArea.Series.Add(serie5);

            ColumnSeries serie6 = new ColumnSeries();
            SeriesItem r6 = new SeriesItem();
            r6.YValue = ds.Sum(x => x.Rango6);
            serie6.Items.Add(r6);
            RadHtmlChart1.PlotArea.Series.Add(serie6);

            ColumnSeries serie7 = new ColumnSeries();
            SeriesItem r7 = new SeriesItem();
            r7.YValue = ds.Sum(x => x.Rango7);
            serie7.Items.Add(r7);
            RadHtmlChart1.PlotArea.Series.Add(serie7);
        }​

 

The chart display in bars the summatory values.

 

How can I do it?

 

Manolo
Top achievements
Rank 1
 asked on 07 Sep 2015
1 answer
63 views
It looks like a typo in the method name. Should that T really be there?
Hristo Valyavicharski
Telerik team
 answered on 07 Sep 2015
2 answers
306 views
I recently tried to use the CheckList filtering on a ​RadGrid but i havn't manage to put my buttons language in french.
I would like to translate the "Chek All", "Apply" and "Cancel" buttons into french. How is it possible?
I don't find these elements in the RadFilter.Main.resx or RadGrid.Main.resx.
jeremy
Top achievements
Rank 1
 answered on 07 Sep 2015
2 answers
1.8K+ views

Hi 

Is there an easy way to style a LinkButton as a regular hyperlink? I would like the visuals of a HyperLink but have the event handling of the button

Al
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 07 Sep 2015
0 answers
435 views

I really don't know this question belongs to this category. But I think this will be most suitable place for this question.

Here is my situation.

I am making a dynamic form with a help of this article article.

Here you can see it use kendo template . 

      <script id="fieldsTemplate" type="text/x-kendo-template">
            <li>
                 <label data-bind="attr: { for: name}, text: label"></label>
                 <input data-bind="attr: { type: type, name: name, class: css}" # if (get("required")) {# required #} # />
           </li>
      </script>

 

After form generated this form is just use HTML5 make the form. It does't have kendo attribute. for a example if I bound data-role attribute and value is numerictextbox It doesn't give me a numeric text box(Think  its' type is number). It doesn't have those properties.( if I type a number it doesn't show the default decimal point. It only shows that number.)

But in this example says if we add data-role attribute and value as numerictextbox it will be a numeric text box.

But in documentation or in this , it seems I have to call kendoNumericTextBox method to make a numeric text box.

Even I try to add this code to template but it doesn't work(Please assume that I add this correctly with this ).

 

          $("#mytextboxid").kendoNumericTextBox();​

 

So what option do I left ??
Thank you very much.

Rasika
Top achievements
Rank 1
 asked on 07 Sep 2015
1 answer
91 views
Hi, 

We've had a bug come back from UAT that the Edit Appointment menu has no Save and Cancel button. I've just tested this on an iPhone 6 and it's true, on small screens the edit appointment popup has no save and cancel. I also tested your demo, is there a work around / plans to fix this in the near future?
Dimitar
Telerik team
 answered on 07 Sep 2015
1 answer
85 views

Hi,

I have one appointment for two time slots on same day for example

Subject : Appointment 1

Id : 1218

Start time : 8 AM

Date : 09/03/2015

Subject : Appointment 1
Id : 1218
Start time : 11 AM

Date : 09/03/2015

when I try to delete 11 AM appointment, scheduler is deleting 8 AM appointment. Even in AppointmentDelete event am getting start time as 8 AM.

Can any one please help me out to resolve this issue. 

Regards,

Maddela

 

 

Plamen
Telerik team
 answered on 07 Sep 2015
1 answer
93 views

I'm using the scheduler with webservice databinding.

Is it possible to enable the context menu for some appointments, but not for all? If so, how could that be accomplished?

Plamen
Telerik team
 answered on 07 Sep 2015
2 answers
112 views
Here I add custom validation. Here is the code. But it don't give error message.
What should I do for it ??
Rasika
Top achievements
Rank 1
 answered on 07 Sep 2015
2 answers
212 views

RadImageGallery is not  displaying any image. 

<telerik:RadImageGallery ID="rigRMA" runat="server" OnNeedDataSource="rigRMA_NeedDataSource" DataImageField="FILE_PATH" DataThumbnailField="FILE_PATH" DataKeyNames="FILE_PATH" Visible="false"
              DataTitleField="FILE_NAME" Width="647px" Height="480px" LoopItems="true">
              <ThumbnailsAreaSettings ThumbnailWidth="120px" ThumbnailHeight="80px" Height="80px" />
              <ImageAreaSettings Height="400px" />
              </telerik:RadI
protected void rigRMA_NeedDataSource(object sender, ImageGalleryNeedDataSourceEventArgs e)
    {
           rigRMA.DataImageField = "FILE_PATH";
            rigRMA.DataSource = GetView();
}
mageGallery
>

Atif
Top achievements
Rank 1
 answered on 05 Sep 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?