Hi, I am using a RadGridView in which some of the cells might be read-only depending on the values of the data in other columns.
To simulate the read-only behavior, I use «CellBeginEdit» event has recommended in some threads of this forum.
My code looks like this:
private void radGridView_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
e.Cancel = !IsCellUpdatable();
}
The «IsCellUpdatable» function seen above returns true or false depending on if the cell has to be modified.
Up to that part, everything works properly.
The problem I encounter is that a user can still paste some data into the cell using the keyboard shortcut «Ctrl-V». The pasting command does not trigger the CellBeginEdit event, so the data is entered in the cell. Thus the read-only behavior can be bypassed. So, I need to prevent the pasting from somewhere else.
I have tried using the grid's KeyDown event but it is not fired. I then tried to override the grid's behavior and the ProcessKey event to catch the «Ctrl-V» command but then I do not have access to my form's «IsCellUpdatable» method (it is not static and cannot be).
Any other suggestions to trap and prevent the paste command?
Thanks for your help
Hi, I have a problem with charts not being displayed properly and being cropped to the left and right edges as the attached picture suggests. The code I use to construct the chart is as follows:
this
.radChart.View.Margin =
new
Padding(15);
ChartTooltipController toolTipController =
new
ChartTooltipController();
toolTipController.DataPointTooltipTextNeeded += toolTipController_DataPointTooltipTextNeeded;
this
.radChart.Controllers.Add(toolTipController);
this
.radChart.ShowToolTip =
true
;
this
.radChart.ShowPanZoom =
true
;
LineSeries dailySeries =
new
LineSeries();
dailySeries.BorderColor = Color.DarkBlue;
dailySeries.BorderWidth = 1;
dailySeries.PointSize =
new
SizeF(5, 5);
dailySeries.ShowLabels =
true
;
foreach
(var r
in
(from q
in
DailyData orderby q.FIXING_DATE select q))
{
dailySeries.DataPoints.Add(
new
CategoricalDataPoint(r.FIXING, r.FIXING_DATE) { Label =
"old"
});
}
DateTimeCategoricalAxis categoricalAxis =
new
DateTimeCategoricalAxis();
categoricalAxis.DateTimeComponent = DateTimeComponent.Date;
categoricalAxis.MajorTickInterval = 21;
categoricalAxis.PlotMode = AxisPlotMode.OnTicks;
categoricalAxis.LabelFitMode = AxisLabelFitMode.MultiLine;
categoricalAxis.LabelFormat =
"{0:MMM-yy}"
;
CartesianArea area =
this
.radChart.GetArea<CartesianArea>();
area.ShowGrid =
true
;
CartesianGrid grid = area.GetGrid<CartesianGrid>();
grid.DrawHorizontalFills =
true
;
grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
//First assign the axis to the VerticalAxis property and then add the series to the chart
dailySeries.HorizontalAxis = categoricalAxis;
this
.radChart.Series.Add(dailySeries);
Can you pleaase suggest a solution to this problem?
Regards,
George
Hi,
I have a general question about what is the best/recomended approach for working on Telrik projects across multiple machines.
For example, I'm developing an application on my main development machine for a client and when I attend site to deploy (and possible modify) the application, I would typically copy the Visual Studio project to my laptop and then edit and deploy the project from there.
I realise to do so on my laptop, I would need to install the Telerik client libarires (which I have), but this approach of copying the solution to my laptop and trying to open/edit there, is not working too well (at all)
What is the approach I should be taking to manage this particular use case?
Thanks,
Damian
When I add a summary row to my grid it works as expected: A summary row is added as a last (visible) line in the grid which remains visible when lines are added and one scrolls the grid.
01.
Private
Sub
AddRadGridView1Summary()
02.
Me
.RadGridView1.SummaryRowsBottom.Clear()
03.
Dim
betaald
As
GridViewSummaryItem =
New
GridViewSummaryItem(
"Betaald"
,
"{0:F2}"
, GridAggregateFunction.Sum)
04.
05.
Dim
summaryRowItem
As
New
GridViewSummaryRowItem()
06.
summaryRowItem.Add(betaald)
07.
08.
Me
.RadGridView1.SummaryRowsBottom.Add(summaryRowItem)
09.
Me
.RadGridView1.MasterView.SummaryRows(0).PinPosition = PinnedRowPosition.Bottom
10.
End
Sub
However I would like to show the summary line at the "true bottom" of the grid, even when the grid contains zero (or just a few) lines as shown in the attached.
How could I achieve this?
Kind regards,
Raoul
I'm trying to have a range of my chart. The range as a slope of y = ax+b, plus a tolerance for the width of the band.
I know that I can draw a line with 2 points, but I'm trying to achieve something like the picture attached knowing that the user will be able to change the slope and tolerance via two spineditor.
Thanks
Hello,
In the provided sample project named BugsTracker, how did the textboxes in the detailPageView bind to a selected row of that bugsGrid?
I mean, there will be corresponding detail message shown in the textboxes when I select one row of bugsGrid.
How was that done?I read the codes but I couldn't find out the entry.
thanks in advance.
Hello,
we have a problem with option AutoDetectMdiChildren. The last created windows is not the active window, but the first
We can not use the radDock.ActiveDocument property, because the forms are not a DockWindow, it's a normal System.Windows.Forms.Form.
It is posible to set the last window as aktive window?
namespace TelerikWinFormsApp1
{
public partial class RadForm2 : Telerik.WinControls.UI.RadForm
{
public RadForm2()
{
InitializeComponent();
this.IsMdiContainer = true;
this.radDock1.AutoDetectMdiChildren = true;
Form1 frm = new Form1(); // this frm is aktive
frm.MdiParent = this;
frm.Text = "Child 1";
frm.Show();
frm = new Form1();
frm.MdiParent = this;
frm.Text = "Child 2";
frm.Show();
frm = new Form1(); // this form should be active
frm.MdiParent = this;
frm.Text = "Child 3";
frm.Show();
}
}
}