Hi,
I want to call DesktopAlert as ShowDialog instead of show. if any solution available ?
Thanks
Hello Telerik,
How could I play with margin and padding to add some spacing between image, texte and certainly my checkboxe ?
Thank you in advance for your support !
I want to execute some code when a user types and then uses the Mouse to click on an item in the list.
I will need to access the item selected.
I am having a hard time to find the correct event to capture this.
Thanks.
Hi.
As is known, Ctrl + A selects all cells in the spreadsheet. Can we change this to only select cells that are full?
Hi,
I don't know if this is the correct forum for this question but I couldn't find an Excel export/import forum which might be more suitable.
I'm using GridViewSpreadStreamExport to export RadGridViews to Excel which works fine and I can open the generated spreadsheet in Excel without any issues.
The issue comes when I try to open/read the generated spreadsheet in code using OleDbCommand with the following connection string:
@"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + path + "; Extended Properties = " + @"""Excel 12.0 Xml;HDR=YES;IMEX=1"";";
I get an "External table is not in the expected format" error message on opening the connection.
If I first open the generated spreadsheet in Excel and just save it, without making any changes to it,the issue does not occur and I can open the spreadsheet in code without any issues.
The spreadsheet does have multiple worksheets, each one from a new instance of a RadGridView, but I don't think that is the issue because generating a spreadsheet with a single worksheet has the same issue.
The RadGridView is in memory, not on the UI, and I just set some of the column headers, width and text alignments.
Export format is SpreadStreamExportFormat.Xlsx and the export of individual RadGridViews are done via:
spreadStreamExport.RunExport(path, new SpreadStreamExportRenderer());
Although I have tried not creating a new instance of SpreadStreamExportRenderer as well.
I've reduced the export to its bare minimum (removed column header and text alignment settings) but nothing has helped.
Any ideas what the issue could be?
Thanks,
Arash
Good day,
I have a radpivotgridview with a custom calculated field, 2 questions:
First one I see in https://docs.telerik.com/devtools/winforms/controls/pivotgrid/calculated-fields to make the custom calculated field from just a value column named ExtendedPrice if I want column a from database div column b from database how could I implement that.
Second I have a calculated field like this:
Public Class TelerikPivotCalculatedFieldDirua
Inherits CalculatedField
Private denboraEuroakField As RequiredField
Public Sub New()
Me.Name = "TotalEuro"
Me.denboraEuroakField = RequiredField.ForProperty("zenbatSeg")
End Sub
Protected Overrides Function RequiredFields() As IEnumerable(Of RequiredField)
Return New List(Of RequiredField) From {denboraEuroakField}
End Function
Protected Overrides Function CalculateValue(aggregateValues As IAggregateValues) As AggregateValue
Dim aggregateValue = aggregateValues.GetAggregateValue(Me.denboraEuroakField)
If aggregateValue.IsError() Then
Return aggregateValue
End If
Dim denboraEuroak As Integer = 0 '= aggregateValue.ConvertOrDefault(Of Integer)()
denboraEuroak = CInt(aggregateValue.GetValue)
If denboraEuroak >= 0 Then
Dim gEurosSeg As Decimal = 0
gEurosSeg = CDec(gEurosHora) / CDec(3600)
Dim gGuztira As Decimal = 0
gGuztira = CDec(denboraEuroak) * CDec(gEurosSeg)
gGuztira = Math.Round(gGuztira, 2, MidpointRounding.AwayFromZero)
Return New DoubleAggregateValue(gGuztira)
End If
Return Nothing
End Function
End Class
In the vb file:
Me.provider = New LocalDataSourceProvider()
'Using rpgestadistica.PivotGridElement.DeferRefresh()
Using provider.DeferRefresh()
Dim calculatedField As New TelerikPivotCalculatedFieldDirua()
calculatedField.Name = "TotalEuro"
calculatedField.DisplayName = Func_nombre(3372)
provider.CalculatedFields.Add(calculatedField)
End Using
'DirectCast(Me.rpgestadistica.DataProvider, LocalDataSourceProvider).CalculatedFields.Add(calculatedField)
'rpgestadistica.DataProvider = provider
Me.provider.RowGroupDescriptions.Add(New PropertyGroupDescription() With {.PropertyName = "globalNombre", _
.GroupComparer = New GroupNameComparer(), _
.CustomName = Func_nombre(3370)})
Me.provider.RowGroupDescriptions.Add(New PropertyGroupDescription() With {.PropertyName = "tipogasin", _
.GroupComparer = New GroupNameComparer(), _
.CustomName = Func_nombre(160)})
Me.provider.RowGroupDescriptions.Add(New PropertyGroupDescription() With {.PropertyName = "suscripcion", _
.GroupComparer = New GroupNameComparer(), _
.CustomName = Func_nombre(250)})
Me.provider.RowGroupDescriptions.Add(New PropertyGroupDescription() With {.PropertyName = "razon", _
.GroupComparer = New GroupNameComparer(), _
.CustomName = Func_nombre(174)})
Me.provider.AggregateDescriptions.Add(New PropertyAggregateDescription() With {.PropertyName = "total", _
.AggregateFunction = AggregateFunctions.Sum})
Me.provider.AggregateDescriptions.Add(New PropertyAggregateDescription() With {.PropertyName = "denbora", _
.AggregateFunction = New TelerikPivotAggregateFunctionEstTiempo()})
'Me.provider.AggregateDescriptions.Add(provider.CalculatedFields.Item(11))
Me.provider.AggregateDescriptions.Add(New PropertyAggregateDescription() With {.PropertyName = "TotalEuro", _
.AggregateFunction = AggregateFunctions.Sum})
'This last line appears like "error".
Me.cargaridiomarpg()
provider.AggregatesPosition = PivotAxis.Columns
provider.AggregatesLevel = 2
Me.provider.ItemsSource = ldt
rpgestadistica.DataProvider = provider
cargaridiomarpg()
For Each rd As RadElement In Me.rpgestadistica.PivotGridElement.ColumnDescriptorsArea.Children
Dim pgde As PivotGroupDescriptorElement = TryCast(rd, PivotGroupDescriptorElement)
If Not IsNothing(pgde) Then
Me.rpgestadistica.PivotGridElement.BestFitHelper.BestFitRowHeaders(pgde.Level)
End If
Next
For Each element As RadElement In Me.rpgestadistica.PivotGridElement.RowDescriptorsArea.Children
Dim pgde As PivotGroupDescriptorElement = TryCast(element, PivotGroupDescriptorElement)
If Not IsNothing(pgde) Then
Me.rpgestadistica.PivotGridElement.BestFitHelper.BestFitRowHeaders(pgde.Level)
End If
Next
Me.rpgestadistica.PivotGridElement.BestFitHelper.BestFitColumns()
See Attach file 1, CustomAggregatev1:
If I rightClick and deattach TiempoEuro column and reattach it. I see it ok:
See Attach file 2 and Attach file 3.
How can I achive it like in attach file 3 from the beginning instead of having errors.
Thanks in advance,
Xabi
I want to temporarily disable the arrow keys in the grid. When a row is selected, I do some image processing for that row, which typically takes .25 to 2 seconds. During that processing time, I want to disable the arrow keys during processing and then enable them when done. I created a bool isBusy Flag for the processing, but I cannot add that to the below custom behavior. Any suggestions? Is there a way to toggle the Custom behavior?
public class CustomGridBehavior : BaseGridBehavior
{
public override bool ProcessKey(KeyEventArgs keys__1)
{
switch (keys__1.KeyCode)
{
case Keys.Up:
case Keys.Down:
case Keys.Left:
case Keys.Right:
{
return false;
}
default:
{
return base.ProcessKey(keys__1);
}
}
}
}
I have a win form on which I have a radribbon component which was working fine.
After I processed an update to Telerik UI components, the form could no longer open in design mode and attached are the error messages.
It looks like a bug, maybe not.
Could anyone assist?
Ekoue
001.
internal
class
NotificationA : INotification {
002.
public
string
Name {
get
;
set
; }
003.
public
string
Type => nameof(NotificationA);
004.
}
005.
006.
internal
class
NotificationB : INotification {
007.
public
int
Degree {
get
;
set
; }
008.
public
string
Type => nameof(NotificationB);
009.
}
010.
011.
internal
class
NotificationAListItem : RadListVisualItem {
012.
private
LightVisualElement notificationTitleElement;
013.
private
StackLayoutPanel stackLayout;
014.
015.
protected
override
void
CreateChildElements()
016.
{
017.
base
.CreateChildElements();
018.
019.
stackLayout =
new
StackLayoutPanel();
020.
stackLayout.Orientation = System.Windows.Forms.Orientation.Vertical;
021.
022.
notificationTitleElement =
new
LightVisualElement();
023.
notificationTitleElement.TextAlignment = ContentAlignment.MiddleLeft;
024.
notificationTitleElement.Margin =
new
Padding(10);
025.
notificationTitleElement.ForeColor = Color.Black;
026.
stackLayout.Children.Add(notificationTitleElement);
027.
028.
this
.Children.Add(stackLayout);
029.
}
030.
031.
public
override
void
Synchronize()
032.
{
033.
base
.Synchronize();
034.
Text =
string
.Empty;
035.
if
(Data.DataBoundItem
is
not NotificationA n)
return
;
036.
notificationTitleElement.Text = Convert.ToString(n.Name);
037.
}
038.
}
039.
040.
internal
class
NotificationBListItem : RadListVisualItem
041.
{
042.
private
LightVisualElement notificationTitleElement;
043.
private
StackLayoutPanel stackLayout;
044.
045.
protected
override
void
CreateChildElements()
046.
{
047.
base
.CreateChildElements();
048.
049.
stackLayout =
new
StackLayoutPanel();
050.
stackLayout.Orientation = Orientation.Vertical;
051.
052.
053.
notificationTitleElement =
new
LightVisualElement();
054.
notificationTitleElement.TextAlignment = ContentAlignment.MiddleLeft;
055.
notificationTitleElement.Margin =
new
Padding(10);
056.
notificationTitleElement.ForeColor = Color.Black;
057.
stackLayout.Children.Add(notificationTitleElement);
058.
059.
Children.Add(stackLayout);
060.
061.
Padding =
new
Padding(5);
062.
Shape =
new
RoundRectShape(3);
063.
BorderColor = Color.FromArgb(255, 110, 153, 210);
064.
BorderGradientStyle = GradientStyles.Solid;
065.
DrawBorder =
true
;
066.
DrawFill =
true
;
067.
BackColor = Color.FromArgb(255, 230, 238, 254);
068.
GradientStyle = GradientStyles.Solid;
069.
}
070.
071.
public
override
void
Synchronize()
072.
{
073.
base
.Synchronize();
074.
Text =
string
.Empty;
075.
if
(Data.DataBoundItem
is
not NotificationB n)
return
;
076.
notificationTitleElement.Text = Convert.ToString(n.Degree);
077.
}
078.
}
079.
080.
public
partial
class
TestForm : RadForm {
081.
public
TestForm() {
082.
InitializeComponent();
083.
InitializeViewAppearance();
084.
}
085.
086.
private
void
InitializeViewAppearance() {
087.
var notifications =
new
List<INotification> {
088.
new
NotificationA {Name =
"Foo"
},
089.
new
NotificationA {Name =
"Bar"
},
090.
new
NotificationB { Degree = 180 }
091.
};
092.
for
(var i = 0; i < 100000; i++) {
093.
notifications.Add(
new
NotificationA { Name = $
"test item {i}"
});
094.
}
095.
lcNotifications.CreatingVisualListItem += OnNotificationItemCreating;
096.
lcNotifications.DataSource = notifications;
097.
}
098.
099.
private
void
OnNotificationItemCreating(
object
sender, CreatingVisualListItemEventArgs args)
100.
{
101.
args.VisualItem = args.DataItem.DataBoundItem
switch
{
102.
NotificationA _ =>
new
NotificationAListItem(),
103.
NotificationB _ =>
new
NotificationBListItem(),
104.
_ => args.VisualItem
105.
};
106.
}
107.
}