Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
215 views

Hi, I'm using telerik RadHtmlChart column series. I add the series dynamically in the code behind.

In my first screen, after page_load, I have three series, (attachment named 3 series first) but then the user can select more series. When I select more than three series, for example 15 series (attachment named 15 series), the columns, of course, are thinner than the ones in the first screen. After that, if I select to show me 3 series (attachment named 3 series last), the columns width remains the same as when I selected the 15 series. The same happens if I select 30 or any other number with thinner columns than the 3 series case.

I guess that the columns width should have been automatically adjusted according to the series quantity.

Maybe there is a property or something that I could add and solve my problem.

Please, any help would be appreciated.

Here is part of the code:

CliAltBajChart.PlotArea.XAxis.TitleAppearance.Text = "Mes";
CliAltBajChart.PlotArea.XAxis.AxisCrossingValue = 0;
CliAltBajChart.PlotArea.XAxis.MajorTickType = Telerik.Web.UI.HtmlChart.TickType.None;
CliAltBajChart.PlotArea.XAxis.MinorTickType = Telerik.Web.UI.HtmlChart.TickType.None;
CliAltBajChart.PlotArea.XAxis.MajorGridLines.Width = 2;

 

CliAltBajChart.PlotArea.YAxis.TitleAppearance.Text = "Cantidad de clientes";
CliAltBajChart.PlotArea.YAxis.MajorTickType = Telerik.Web.UI.HtmlChart.TickType.Outside;
CliAltBajChart.PlotArea.YAxis.MinorTickType = Telerik.Web.UI.HtmlChart.TickType.Outside;
CliAltBajChart.PlotArea.YAxis.LabelsAppearance.DataFormatString = "{0:N0}";

ColumnSeries TotalClientes = new ColumnSeries();
ColumnSeries Altas = new ColumnSeries();
ColumnSeries Bajas = new ColumnSeries();
List<EntCliente> LstC = new BusCliente().ObtenerClientes(0).ToList();

 

string name = "Total de Clientes" + nombre;

ColumnSeries TotalClientes = new ColumnSeries();
TotalClientes.Name = name;
TotalClientes.LabelsAppearance.Visible = false;
TotalClientes.TooltipsAppearance.Color = System.Drawing.Color.White;
TotalClientes.TooltipsAppearance.DataFormatString = "{0:N0}";

ColumnSeries Altas = new ColumnSeries();
Altas.Name = "Altas" + nombre;
Altas.LabelsAppearance.Visible = false;
Altas.LabelsAppearance.DataFormatString = "{0:N0}";
Altas.TooltipsAppearance.Color = System.Drawing.Color.White;
Altas.TooltipsAppearance.DataFormatString = "{0:N0}";

ColumnSeries Bajas = new ColumnSeries();
Bajas.Name = "Bajas" + nombre;
Bajas.LabelsAppearance.Visible = false;
Bajas.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.BarColumnLabelsPosition.Center;
Bajas.LabelsAppearance.DataFormatString = "{0:N0}";
Bajas.TooltipsAppearance.Color = System.Drawing.Color.White;
Bajas.TooltipsAppearance.DataFormatString = "{0:N0}";

CliAltBajChart.PlotArea.XAxis.Items.Clear();

foreach (EntCliente e in LstC)
{
    string mes = Convert.ToString(e.mes);
    CliAltBajChart.PlotArea.XAxis.Items.Add(mes);
    decimal? cantClientes = Convert.ToDecimal(e.cantClientes);

    TotalClientes.SeriesItems.Add(cantClientes);

    decimal? cantAltas = Convert.ToDecimal(e.cantAltas);
    Altas.SeriesItems.Add(cantAltas);

    decimal? cantBajas = Convert.ToDecimal(e.cantBajas);
    Bajas.SeriesItems.Add(cantBajas);  
}

CliAltBajChart.PlotArea.Series.Add(TotalClientes);
CliAltBajChart.PlotArea.Series.Add(Altas);
CliAltBajChart.PlotArea.Series.Add(Bajas);

HtmlChartHolder.Controls.Add(CliAltBajChart);

Francisco
Top achievements
Rank 1
 answered on 15 Jun 2016
1 answer
116 views
Hi,
I use a radprogressarea within a radwizard step.  In this step  I would like to report the progress of two operations.
How can I get the headertext to change when the second operation starts?
I’ve tried the obvious, by putting the following just before the second operation completes

RadProgressArea3.HeaderText = "Processing Number 2";


Does the control need to be included within the Ajax manager? 
Peter Milchev
Telerik team
 answered on 15 Jun 2016
3 answers
486 views
Hi,

    FileUploaded event is not firing in any browser. I have a page named CustomerCare.aspx which is assciated with master page. I have the RadTabStrip & RadMultipage control to bind the tab dynamically on CustomerCare Page and load the user control dynamicaaly onclick of tabs.

    In this case Fileuploaded event is not firing also the look of RadAsyncUpload control is not proper.

    Waiting for the reply. I need the response ASAP.


    Thanks & Regards,

    Om Prakash
Ivan Danchev
Telerik team
 answered on 15 Jun 2016
2 answers
108 views

You can delete the other thread, it was improperly titled. 

 

I've created a menu with a horizontal root that displays child elements vertically. Works fine on my and the other dev boxes we have. When we deploy to the server however, the root menu displays vertically. I've added the x-ua-compatibale meta tag with content="ie-edge" to no avail. I also added the Flow Horizontal attribute on the actual control even though it's the default. 

Is there some css property I'm missing? Thanks in advance. 

Peter Milchev
Telerik team
 answered on 15 Jun 2016
3 answers
261 views

Hello,

I want to show grid header always,even there is no datasource or records,here is the code I tried,but the header did't show:

<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"  AllowFilteringByColumn="True" CellSpacing="0" ShowHeader="true">
         <MasterTableView AutoGenerateColumns="false" ShowHeader="true" ShowHeadersWhenNoRecords="true">
                        <Columns>
                            <telerik:GridBoundColumn DataField="BrandName" HeaderText="Brand Name" UniqueName="BrandName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Model" HeaderText="Model" UniqueName="Model">
                            </telerik:GridBoundColumn>
                            </Columns>
             </MasterTableView>
         </telerik:RadGrid>

 

what should I do?

Pavlina
Telerik team
 answered on 15 Jun 2016
1 answer
266 views

Hi,
I’m trying to export a radgrid using this code:

RadGrid1.ExportSettings.Word.Format = Telerik.Web.UI.GridWordExportFormat.Docx;
RadGrid1.ExportSettings.UseItemStyles = true;
RadGrid1.MasterTableView.ExportToWord();


This works but I’m trying to do the following unsuccessfully

1. Make the word file landscape mode
2. Add a header and footer

Please can you clarify how to accomplish these things please?

Kostadin
Telerik team
 answered on 15 Jun 2016
4 answers
245 views

Hi,

The "Apply CSS class" dropdown won't load if the css file uses Google fonts Eg.:

@import url(https://fonts.googleapis.com/css?family=Alegreya+Sans:400,100,300,500,700,800,900,900italic,800italic,700italic,500italic,400italic,300italic,100italic|Open+Sans:400,400italic);

Anything we can do about this?

Marc

 â€‹

Joana
Telerik team
 answered on 15 Jun 2016
3 answers
435 views

Hi,

I am trying to add tabs, pageviews dynamically, and then iframes  in the pageviews.  However, on postback, the iframes are not persisted.

 

 

HtmlGenericControl iframe = new HtmlGenericControl("iframeA");

 

PageView pageView = new PageView();


pageView.Controls.Add(iframe);
multiPage.PageViews.Add(pageView);

However, if i statically do it (as below), the iframes are persisted.  Can you please show me a way to make this work.

Thanks,
Raj

 

 

<telerik:RadPageView id="Pageview2" runat="server" >
                                <iframe  id="ContentIframe2" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
                            </telerik:RadPageView> 
                            <telerik:RadPageView id="Pageview3" runat="server" >
                                <iframe  id="ContentIframe3" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
                            </telerik:RadPageView> 
                            <telerik:RadPageView id="Pageview4" runat="server" >
                                <iframe  id="ContentIframe4" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
                            </telerik:RadPageView> 
                            <telerik:RadPageView id="Pageview5" runat="server" >
                                <iframe  id="ContentIframe5" width=100% height="600px" frameborder="0" scrolling="auto" runat="server"></iframe>
                            </telerik:RadPageView> 

Patrick
Top achievements
Rank 1
 answered on 15 Jun 2016
9 answers
533 views

Hi,

I need to place an "X" in all cells that have a true value in the export.  I've seen similar posts, but I am using Format="Xlsx" and trying to accomplish this task using the OnInfrastructureExporting event handler as follows:

protected void grdUserAdmin_InfrastructureExporting(object sender, GridInfrastructureExportingEventArgs e)
{
    var colCount = e.ExportStructure.Tables[0].Columns.Count;
    var rowCount = e.ExportStructure.Tables[0].Rows.Count;
    ExportStyle headerStyle = new ExportStyle();
    headerStyle.ForeColor = Color.White;
    headerStyle.BackColor = Color.Blue;
    headerStyle.Font.Bold = true;
 
    // Set the header style for all columns
    for (var i = 1; i <= colCount; i++)
    {
        e.ExportStructure.Tables[0].Cells[i, 1].Style = headerStyle;
        e.ExportStructure.Tables[0].Columns[i].Width = 200; // Would like auto-width !!
    }
 
    // Place an "X" in cells assigned to a boolean data field if value is true
    var headerText = "";
    for (var c = 1; c <= colCount; c++)
    {
        for (var r = 1; r <= rowCount; r++)
        {
            if (r == 1)
            {
                headerText = e.ExportStructure.Tables[0].Cells[c, r].Value.ToString();
                continue;
            }
            if (headerText == "Active")
            {
                var x = e.ExportStructure.Tables[0].Cells[c, r].Value.ToString();
                System.Diagnostics.Debug.WriteLine("Cell Value: " + x);
                if (Convert.ToBoolean(e.ExportStructure.Tables[0].Cells[c, r].Value.ToString()))
                    e.ExportStructure.Tables[0].Cells[c, r].Value = "X";
            }
        }
    }
 
}

The value for the variable x above is always "" or null (hard to tell in the Output section of VS).
I know that my data for column Active should have all true values.
The conversion to boolean fails!
I think I'm close.
What am I doing wrong?
Thanks in advance for any advice.
Jim

jlj30
Top achievements
Rank 2
 answered on 14 Jun 2016
11 answers
939 views
I have a RadGrid that uses an EditForm template in order to lay the controls out according to the wishes of the customer. I have not been able to get the RadTextBox within the template to receive focus when it goes into edit mode.
<telerik:RadGrid ID="rgComments" runat="server" AutoGenerateColumns="False" Width="100%" AllowSorting="True" CellSpacing="0" GridLines="None" Height="455px">
  <MasterTableView CommandItemDisplay="Top" CommandItemSettings-AddNewRecordText="Add Comment" CommandItemSettings-ShowRefreshButton="true" TableLayout="Fixed" EditMode="EditForms" DataKeyNames="iNoteID,qwImageID">
    <EditFormSettings EditFormType="Template">
      <FormTemplate>
        <div style="position: relative; height: 215px; width: 800px;">
          <telerik:RadTextBox ID="rtbComment" runat="server" Width="795px" Height="165px" ClientEvents-OnLoad="taComment_onload" />
          <asp:ImageButton ID="ibSave" runat="server" ImageUrl="~/Images/Save.png" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' style="position: absolute; left: 10px; top: 180px;" />
          <asp:ImageButton ID="ibCancel" runat="server" ImageUrl="~/Images/Cancel.png" CommandName="Cancel" style="position: absolute; left: 70px; top: 180px;" />
        </div>
      </FormTemplate>
    </EditFormSettings>
    <Columns>
      <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center" EditImageUrl="~/Images/Edit.png" UniqueName="gecEdit" />
      <telerik:GridBoundColumn DataField="dtCreateDate" HeaderText="Create Date" HeaderStyle-Width="66" HeaderStyle-HorizontalAlign="Center" DataFormatString="{0:MM/dd/yyyy HH:mm}" ReadOnly="True" UniqueName="gbc_dtCreateDate" />
      <telerik:GridBoundColumn DataField="cLoginName" HeaderText="Create By" HeaderStyle-Width="66" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" ReadOnly="True" UniqueName="gbc_cLoginName" />
      <telerik:GridBoundColumn DataField="cNote" HeaderText="Comment" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="500px" MaxLength="1024" UniqueName="gbc_cNote" />
      <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center" ImageUrl="~/Images/Delete.png" UniqueName="bcDelete" />
    </Columns>
  </MasterTableView>
  <ClientSettings><Scrolling AllowScroll="true" /></ClientSettings>
</telerik:RadGrid>

When the form goes into edit mode I want to put the current Comment text into the RadTextBox and set focus there. I am using this code to try and do that.
void rgComments_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item.IsInEditMode && e.Item is GridEditableItem)
  {
    GridEditableItem item = e.Item as GridEditableItem;
    RadTextBox radTextBox = ((RadTextBox)(((GridEditFormItem)(item)).FindControl("rtbComment")));
   
    // It works if I comment out this line, but then control is not populated with the necessary text
    radTextBox.Text = ((DataRowView)(((GridItem)(item)).DataItem)).Row["cNote"].ToString();
   
    radTextBox.Focus();
  }
}

I have tried adding a client-side onload event handler for the control to set the focus. It gets called but still won't put focus into the control.

Can you help me figure this out?

John
jlj30
Top achievements
Rank 2
 answered on 14 Jun 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?