Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
172 views
Hi
I need a help for i am unable to get anything to control the visibility for a bar in a bar chart.
Below is my code -
protected void SetAshGraph(RadChart RadChart, string bpAshValue, string apAshValue, string apTotSedi, string bpTotSedi, string ymax, string ymin, string steps, string title, string yaxislabel)
    {
        //------------------------------Setting Rad Chart Properties
        RadChart.Clear();
        RadChart.RemoveAllSeries();
        RadChart.Margins.Left = Unit.Percentage(25);
        RadChart.Margins.Bottom = Unit.Percentage(17);
        RadChart.Margins.Right = Unit.Percentage(10);
        RadChart.Title.Text = title;
        RadChart.Title.TextFont = new System.Drawing.Font("Verdana", 9, System.Drawing.FontStyle.Bold);
        RadChart.Title.Background.MainColor = Color.Transparent;
        RadChart.Title.Background.BorderColor = Color.Transparent;
        RadChart.Title.Background.FillStyle = FillStyle.Solid;
 
        //----------------------setting X porperties
 
        RadChart.XAxis.Clear();
        //RadChart.XAxis.Label.TextFont = new System.Drawing.Font("Verdana", 3, System.Drawing.FontStyle.Regular);
        //RadChart.XAxis.Items.Font = new System.Drawing.Font("Verdana", 2, System.Drawing.FontStyle.Regular);
         
        RadChart.XAxis.AddItem(""); //RadChart.XAxis.Items[0].Visible = false;
        //RadChart.XAxis.Items[0].Value = -1;
         
        RadChart.XAxis.AddItem("BP \nAsh");
        //RadChart.XAxis.Items[1].Value = 0;
 
        RadChart.XAxis.AddItem("AP \nAsh");
        //RadChart.XAxis.Items[2].Value = 1;
 
        RadChart.XAxis.AddItem(""); //RadChart.XAxis.Items[3].Visible = false;
        //RadChart.XAxis.Items[3].Value = -2;
 
        RadChart.XAxis.AddItem("BP \nTSA");
        //RadChart.XAxis.Items[4].Value = 2;
 
        RadChart.XAxis.AddItem("AP \nTSA");
        //RadChart.XAxis.Items[5].Value = 3;
 
        RadChart.BarOverlapPercent = 0; RadChart.BarWidthPercent = 100;
        RadChart.XAxis.AddItem("");
        //RadChart.XAxis.Items[6].Value = -3;
         
        //RadChart.XAxis.Items[6].Visible = false;
        RadChart.XAxis.AxisWidth = 1;
        RadChart.XAxis.AxisColor = Color.Black;
        RadChart.XAxis.Label.TextColor = Color.Black;
 
 
        //----------------------setting y porperties
        RadChart.YAxis.AddRange(double.Parse(ymin), double.Parse(ymax), double.Parse(steps));
        //   RadChart.YAxis.AutoScale = true;
        RadChart.YAxis.Label.Text = yaxislabel;
        RadChart.YAxis.Label.TextFont = new System.Drawing.Font("Verdana", 8, System.Drawing.FontStyle.Bold);
        RadChart.YAxis.AxisColor = Color.Black;
        RadChart.YAxis.Label.TextColor = Color.Black;
        RadChart.YAxis.AxisWidth = 1;
        RadChart.YAxis.DefaultItemColor = System.Drawing.Color.Black;
        //RadChart.YAxis.VisibleValues = ChartAxisVisibleValues.Positive;
        RadChart.XAxis.DefaultItemColor = System.Drawing.Color.Black;
        //RadChart.XAxis.VisibleValues = ChartAxisVisibleValues.Positive;
        //RadChart.XAxis.AutoScale = false;
        //RadChart.XAxis.AutoShrink = true;
         
         
        //------------------------------Adding  Chart series Properties
        ChartSeries s = RadChart.CreateSeries("Series", Color.DarkViolet, ChartSeriesType.Bar);
        s.Items.Series.Appearance.FillStyle = FillStyle.Solid;
        s.Items.Series.Appearance.BorderColor = Color.Black;
 
        ChartSeriesItem items0 = new ChartSeriesItem();
        items0.YValue = double.Parse(ymin); //items0.XValue = -1;
        s.Items.Add(items0);
        s.Items[0].Label = " ";
         
        //-----------------------------first Item i.e Bp/Ap reading
        ChartSeriesItem items1 = new ChartSeriesItem();
        double dd;
        if (double.TryParse(bpAshValue, out dd))
        {
            items1.YValue = dd;
            s.Items.Add(items1);
            //anks
            //s.Items[0].Appearance.MainColor = Color.FromArgb(153, 51, 101);
            //s.Items[0].Appearance.SecondColor = Color.FromArgb(153, 51, 101);
            s.Items[1].Appearance.MainColor = Color.FromArgb(198, 83, 138);
            s.Items[1].Appearance.SecondColor = Color.FromArgb(198, 83, 138);
            s.Items[1].Label = " ";
             
        }
        else
        {
            items1.YValue = dd;
            s.Items.Add(items1);
            s.Items[1].Label = " ";
        }
 
        ChartSeriesItem items2 = new ChartSeriesItem();
        if (double.TryParse(apAshValue, out dd))
        {
            items2.YValue = dd;
            s.Items.Add(items2);
            //anks
            //s.Items[1].Appearance.MainColor = Color.FromArgb(154, 153, 255);
            //s.Items[1].Appearance.SecondColor = Color.FromArgb(154, 153, 255);
            s.Items[2].Appearance.MainColor = Color.FromArgb(180, 179, 255);
            s.Items[2].Appearance.SecondColor = Color.FromArgb(180, 179, 255);
            s.Items[2].Label = " ";
        }
 
        ChartSeriesItem items3 = new ChartSeriesItem();
        items3.YValue = double.Parse(ymin); //items3.XValue = -2;
        s.Items.Add(items3);
        s.Items[3].Label = " ";
 
        ChartSeriesItem items4 = new ChartSeriesItem();
        if (double.TryParse(bpTotSedi, out dd))
        {
            items4.YValue = dd;
            s.Items.Add(items4);
            //anks
            //s.Items[2].Appearance.MainColor = Color.FromArgb(153, 51, 101);
            //s.Items[2].Appearance.SecondColor = Color.FromArgb(153, 51, 101);
            s.Items[4].Appearance.MainColor = Color.FromArgb(198, 83, 138);
            s.Items[4].Appearance.SecondColor = Color.FromArgb(198, 83, 138);
            s.Items[4].Label = " ";
        }
        ChartSeriesItem items5 = new ChartSeriesItem();
        if (double.TryParse(apTotSedi, out dd))
        {
            items5.YValue = dd;
            s.Items.Add(items5);
            //anks
            //s.Items[3].Appearance.MainColor = Color.FromArgb(154, 153, 255);
            //s.Items[3].Appearance.SecondColor = Color.FromArgb(154, 153, 255);
            s.Items[5].Appearance.MainColor = Color.FromArgb(180, 179, 255);
            s.Items[5].Appearance.SecondColor = Color.FromArgb(180, 179, 255);
            s.Items[5].Label = " ";
        }
        ChartSeriesItem items6 = new ChartSeriesItem();
        items6.YValue = double.Parse(ymin); //items6.XValue = -3;
        s.Items.Add(items6);
        s.Items[6].Label = " ";
 
        RadChart.AddChartSeries(s);
        //anks
        ChartSeries s1 = RadChart.CreateSeries("LineSeries", Color.Black, ChartSeriesType.Line);
        s1.Items.Series.Appearance.FillStyle = FillStyle.Solid;
        s1.Items.Series.Appearance.BorderColor = Color.Black;
        s1.Items.Series.ShowLabels = true;
        //RadChart.XAxis.LayoutStyle = ChartAxisLayoutStyle.Between;
        RadChart.XAxis.LayoutStyle = ChartAxisLayoutStyle.Normal;
         
        ChartSeriesItem LineItems0 = new ChartSeriesItem();
        if (double.TryParse(bpAshValue, out dd))
        {
            LineItems0.YValue = 1.5;
            s1.Items.Add(LineItems0);
            s1.Items[0].Appearance.MainColor = Color.Black;
            s1.Items[0].Label = "This is a strip line line li";
            s1.Items[0].Series.LabelAppearance.TextFont = new Font("Times New Roman", 9, FontStyle.Bold | FontStyle.Italic);
            s1.Items[0].Series.LabelAppearance.TextColor = Color.Black;
            //s1.Items[0].Series.LabelAppearance.TextColor = Color.Gold;
        }
        else
        {
            LineItems0.YValue = 1.5;
            s1.Items.Add(LineItems0);
            s1.Items[0].Label = " ";
        }
        ChartSeriesItem LineItems1 = new ChartSeriesItem();
        if (double.TryParse(bpAshValue, out dd))
        {
            LineItems1.YValue = 1.5;
            s1.Items.Add(LineItems1);
            s1.Items[1].Appearance.MainColor = Color.Black;
            s1.Items[1].Label = " ";
        }
        ChartSeriesItem LineItems2 = new ChartSeriesItem();
        if (double.TryParse(apAshValue, out dd))
        {
            LineItems2.YValue = 1.5;
            s1.Items.Add(LineItems2);
            s1.Items[2].Appearance.MainColor = Color.Black;
            s1.Items[2].Label = " ";
        }
        ChartSeriesItem LineItems3 = new ChartSeriesItem();
        if (double.TryParse(bpTotSedi, out dd))
        {
            LineItems3.YValue = 1.5;
            s1.Items.Add(LineItems3);
            s1.Items[3].Appearance.MainColor = Color.Black;
            s1.Items[3].Label = " ";
        }
        ChartSeriesItem LineItems4 = new ChartSeriesItem();
        if (double.TryParse(apTotSedi, out dd))
        {
            LineItems4.YValue = 1.5;
            s1.Items.Add(LineItems4);
            s1.Items[4].Appearance.MainColor = Color.Black;
            s1.Items[4].Label = " ";
        }
        ChartSeriesItem LineItems5 = new ChartSeriesItem();
        if (double.TryParse(apTotSedi, out dd))
        {
            LineItems5.YValue = 1.5;
            s1.Items.Add(LineItems5);
            s1.Items[5].Appearance.MainColor = Color.Black;
            s1.Items[5].Label = " ";
        }
        ChartSeriesItem LineItems6 = new ChartSeriesItem();
        if (double.TryParse(apTotSedi, out dd))
        {
            LineItems6.YValue = 1.5;
            s1.Items.Add(LineItems6);
            s1.Items[6].Appearance.MainColor = Color.Black;
            s1.Items[6].Label = " ";
        }
        RadChart.AddChartSeries(s1);
 
    }
and here is a graph in the attachment-

 I dont want the small bars that comes in the position 1st , 4th ,7th. But i need the space for them just without the small bars that comes in.
Princy
Top achievements
Rank 2
 answered on 27 Sep 2012
1 answer
109 views
Hello,

I have a telerik grid with 2 phone numbers.  They are the same other than variable name:

<telerik:GridViewDataColumn Width="*"
                                                CellStyleSelector="{StaticResource InvalidHomePhoneStyleSelector}"
                                                DataFormatString="{}{0:(###) ###-####}"
                                                DataMemberBinding="{Binding HomePhone,
                                                                            Converter={StaticResource PhoneNumberNumericConverter}}"
                                                ShowDistinctFilters="False"
                                                UniqueName="Phone" TextAlignment="Right">
                        <telerik:GridViewDataColumn.Header>
                            <TextBlock MaxHeight="32"
                                       Text="{Binding Path=Resource.HomePhone,
                                                      Source={StaticResource Messages},
                                                      Mode=OneTime}"
                                       TextTrimming="WordEllipsis"
                                       TextWrapping="Wrap" />
                        </telerik:GridViewDataColumn.Header>
                        <telerik:GridViewDataColumn.CellEditTemplate>
                            <DataTemplate>
                                <telerik:RadMaskedTextBox EmptyContent="{Binding Path=Resource.EnterPhone,
                                                                                 Source={StaticResource Messages},
                                                                                 Mode=OneTime}"
                                                          FontStyle="Normal"
                                                          IsSpinEnabled="False"
                                                          Mask="(000) 000-0000"
                                                          MaskType="Standard"
                                                          Value="{Binding HomePhone,
                                                                          Mode=TwoWay,
                                                                          Converter={StaticResource PhoneNumberNumericConverter},
                                                                          ConverterParameter=String}" TextAlignment="Right" HorizontalContentAlignment="Right" />
                            </DataTemplate>
                        </telerik:GridViewDataColumn.CellEditTemplate>
                    </telerik:GridViewDataColumn>


The point of this web page is for the user to update invalid information for the contact.
The biggest missing info is the area code. 

The InvalidHomePhoneStyleSelector makes the numbers red and italisized if they aren't 10 numbers.
The PhoneNumberNumericConverter takes the input string and replaces all non numbers with ""


There are 2 problems:
1.  Even though I set everything to right alignment, the 7 digit numbers are showing up as (123) 456-7___ instead of (___) 123-4567
2.  Typing new characters overwrites instead of inserts.  If they set the cursor to the beginning and type in the area code, it overwrites the part of the number they already have.  Is there some property I'm missing to make editing insert instead of override?

Fixing the first problem would avoid the second. 

Thank you for your help,

James Trimmier
Tsvetina
Telerik team
 answered on 27 Sep 2012
3 answers
102 views
Hello, everyone.

I'm having an issue with the RadDock and the page's lifecycle.  Using the online demos as a template, I'm trying to load and save some user-requested docks in some different RadDockZones.  The problem I'm having is since I have a couple of other dynamic controls that load during the Page_Load event, I can never seem to get the RadLayout's SaveDockLayout to fire properly.  I'm able to load several docks into a couple of different zones with no problem, but when I go to move one, it reverts back to its original position and the only thing I can think of is because of the postback that's happening. I know that the SaveDockLayout event fires after the Page_Load, but I'm confused as to how I can properly save the layout if it's already rendering back to its prior instance.
Slav
Telerik team
 answered on 27 Sep 2012
2 answers
82 views
This is a half-baked inquiry - I have a grid that has columns that resize at runtime. I recently grouped a few of the columns. Now the columns don't resize anymore. I'm using build 2.918, I haven't used the feature prior to this build so I don't know if this was a regression.

Is this a known issue? Anyone else seeing it? Can Telerik test/confirm one way or the other?

I'll provide more detail and open a ticket if required, but I hope I don't need to go through the full diagnostic, confirming which browser exhibits this behavior, or maybe sending in a sample project - I just don't have time for that right now.

Thanks!
Marin
Telerik team
 answered on 27 Sep 2012
4 answers
154 views
Hello

How can I aling  numbers to the rightside of box ?
Vasil
Telerik team
 answered on 27 Sep 2012
3 answers
77 views
dear
 
i need an example about  Rad grid has inline edit and in same time has tow rows Drop Down (country, city)
i need to make in edit mode the fields country & city Drop Down to allow chose from them and all that inline edit and in same time this grid allow Sorting & paging & grouping & filtering


Regard
Ahmed Salem
Radoslav
Telerik team
 answered on 27 Sep 2012
17 answers
271 views
Hello,

I've followed your example for dragging and dropping the contents of a RadTreeView node into an input box, like this:
function droppedOnInput(args) {
 var target = args.get_htmlElement();
 if (target.tagName == "INPUT") {
     target.style.cursor = "INPUT";
     target.value += args.get_sourceNode().get_text();
     args.set_cancel(true);
     return true;
 }
the target.value is the textbox's text field, and I'm able to append to it the name of the node using += .

Is there a similar way I can append it to the Content of a RadEditor??

Thanks in advance
RJ
Top achievements
Rank 1
 answered on 27 Sep 2012
1 answer
78 views
Hi,
Is there any samples for bind RadGridView based on selected RadTreeView

Princy
Top achievements
Rank 2
 answered on 27 Sep 2012
3 answers
106 views
Hi,

Image Attached.
Below mentioned code working fine with IE8 or above but with IE7 it throwing an alignment issues. OutPut attached in image format.

<telerik:RadToolBar id="RadToolBar1" runat="server" EnableRoundedCorners="true" EnableShadows="true">
                <Items>
                    <telerik:RadToolBarButton Text="Button" />
                    <telerik:RadToolBarButton IsSeparator="true" />
                    <telerik:RadToolBarButton Text="Toggle button" CheckOnClick="true" Checked="true" AllowSelfUncheck="true" />
                    <telerik:RadToolBarButton IsSeparator="true" />
                    <telerik:RadToolBarButton Text="Button" />
                </Items>
            </telerik:RadToolBar>


Pls do the needful. 
Alok
Top achievements
Rank 2
 answered on 27 Sep 2012
1 answer
99 views
Scheduler doesn't seem to support MetroTouch.  Is it coming?

Thanks.
Shinu
Top achievements
Rank 2
 answered on 27 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?