Hi. I am having a problem with converting the RadChart that we used earlier to ChartView. I am using this code to generate the LineSeries with DataTable.
radChart1.Axes.Clear();
radChart1.BackColor = Color.White;
radChart1.ShowPanZoom =
true
;
Telerik.WinControls.UI.LineSeries ls =
new
Telerik.WinControls.UI.LineSeries();
radChart1.Series.Add(ls);
ls.DataSource = dt;
ls.ShowLabels =
true
;
ls.ValueMember =
"Value"
;
ls.CategoryMember =
"Label"
;
ls.CombineMode = Telerik.Charting.ChartSeriesCombineMode.None;
foreach
(DataColumn dc
in
dt.Columns)
{
if
(dc.ColumnName ==
"LSL"
|| dc.ColumnName ==
"USL"
|| dc.ColumnName ==
"LWL"
|| dc.ColumnName ==
"UWL"
)
{
DataTable LSLDt = dt.Copy();
LSLDt.Columns.Remove(
"Value"
);
Telerik.WinControls.UI.LineSeries LSLSeries =
new
Telerik.WinControls.UI.LineSeries();
radChart1.Series.Add(LSLSeries);
LSLSeries.DataSource = dt;
LSLSeries.ShowLabels =
false
;
LSLSeries.ValueMember = dc.ColumnName;
LSLSeries.Name = dc.ColumnName;
LSLSeries.CategoryMember =
"Label"
;
LSLSeries.CombineMode = Telerik.Charting.ChartSeriesCombineMode.None;
if
(dc.ColumnName.Contains(
"SL"
))
{
LSLSeries.BackColor = Color.Red;
}
else
if
(dc.ColumnName.Contains(
"WL"
))
{
LSLSeries.BackColor = Color.Yellow;
}
}
}
// radChart1.ShowSmartLabels = true;
radChart1.Axes.Get<Telerik.WinControls.UI.CategoricalAxis>(0).PlotMode = Telerik.Charting.AxisPlotMode.OnTicksPadded;
radChart1.Axes.Get<Telerik.WinControls.UI.CategoricalAxis>(0).LabelFitMode = Telerik.Charting.AxisLabelFitMode.Rotate;
radChart1.Axes.Get<Telerik.WinControls.UI.CategoricalAxis>(0).LabelRotationAngle = 270;
radChart1.Axes.Get<Telerik.WinControls.UI.CategoricalAxis>(0).ShowLabels =
true
;
radChart1.Axes.Get<Telerik.WinControls.UI.LinearAxis>(1).ShowLabels =
true
;
But I need to show every single detail without grouping the labels. I have attached the way it used to look with RadChart and the new ChartView.
One of my other problems is that, when there is only one category and one Y value, I want to show a dot. But when I give the DataTable(which has 5 rows, all the values and labels are the same) as a source to LineSeries, nothing is shown. It is also attached as a file below. I'd appreciate it if you can help me with these issues.
I'm using 2016 Q1 (Jan) and am dynamically adding RadLabels to a user control. I have converted from .NET Label to RadLabel.
The user control fills a SplitPanel and is currently out of focus when the form first opens.
The form is always visible and is loaded before the RadLabels are dynamically added.
When dynamically adding the RadLabels they are each added to the user control, their text is set and then they are all adjusted and aligned to match the length of the RadLabel with the longest text. Well, that's how it used to work with the normal .NET Label...
Each RadLabel is set correctly but none ever resize to fit their text and instead are always 100 wide even though some should be over 200.
I've tried implementing the AutoSize to false, set text, AutoSize to true workaround but it never works. No combination of AutoSize makes any difference.
I cannot apply these changes in other place due to the nature of the code (plugins, etc.) so they must take effect here.
Is there a way to get the calculated size of the RadLabels and use that width? Is there a way to get the RadLabel to behave as expected?
This snippet takes place after the RadLabels have all been added to the user control and I need to get the longest width.
01.
Int32 loWidth = 0;
02.
03.
foreach
(RadLabel lpLabel
in
loLabels)
04.
{
05.
lpLabel.AutoSize =
false
;
06.
lpLabel.TextWrap =
false
;
07.
lpLabel.Text =
this
.getText();
08.
lpLabel.TextAlignment = ContentAlignment.MiddleRight;
09.
lpLabel.AutoSize =
true
;
10.
11.
if
(lpLabel.Width > loWidth)
12.
{
13.
loWidth = lpLabel.Width;
14.
}
15.
}
Hi
Is it possible to use the data within a datatable as the mail merge fields within a richtecteditor? So the column headings within the datatable will show in the 'Insert merge field' drop down and the rows will be the results.
I have tried (which was a long shot):
Form.RadRichTextEditor.Document.MailMergeDataSource.ItemsSource = DataSet1.Tables("table").AsEnumerable.ToList (doesn't work)
If its not possible could someone please suggest a best method? The data comes from a SQL view, which fills a datatable which then displays in the radgridview (which is awesome). Preferably in VB.net please.
Many thanks
Hi,
I've noticed that a number of properties appear to be changeable in the Visual Studio 2013 designer, but the changes don't actually get persisted to the code-behind for the designer, so they don't actually "stick". For example, I changed the value of the RadDropDownButtonElement.Children(DropDownEditorLayoutPanel).Children(ActionButtonElement).TextWrap from false to true for a button in our ribbon bar, in the Visual Studio designer. It looked like it worked (ie the button appearance updated in the designer to show the text as being wrapped), but when I ran the program the text didn't wrap. I went back and looked at the code and there was no setting for that value in the code-behind for the designer. When I closed and re-opened the designer window, the text had reverted to not being wrapped and the property value had been reset to false. This seems like a bug to me. Is there something I'm missing?
Thank you,
Emily
Hello
How can I trigger RadGrid_CellClick event from code?
Example:
private void button1_Click(object sender, EventArgs e)
{
RadGrid1_CellClick(new object, new GridViewCellEventArgs());
}
I need to achieve a function that when mouse hover over a RadTextBox, it changes its background color. Like what is shown in the demo, text box changed color from gray to white when mouse cursor moves inside the text box.
I tried to use Mouse-Enter event to change the backcolor. However, this event only triggers when the mouse cursor touches exactly at the border of the text box, as soon as it leaves the border, although the mouse cursor stays inside the text box, this event is no longer valid. I also tried Mouse-hover event, which did not give me a good result either.
It seems to me that what I need to achieve is a common issue and must have a relatively easy solution. I am wondering if I missed anything.
Thank you!