Hello.
I'm tring to make a custom cell with radtimepickerelement but something is not working in SetContentCore because any value I set in the timepicker editor when i see the value it's always nothing.
And in the other hand I can't use the custom editor in the row witch is used for add new rows in the grid.
I've done a sample code if you could help me
Thx.
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim colnombre As New GridViewTextBoxColumn("nombre")
Dim colHora As New TimePickerColumn("hora")
GVPrueba.Columns.Add(colnombre)
GVPrueba.Columns.Add(colHora)
GVPrueba.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill
End Sub
Private Sub GVPrueba_SelectionChanged(sender As Object, e As EventArgs) Handles GVPrueba.SelectionChanged
If GVPrueba.SelectedRows.Count = 1 Then
If GVPrueba.SelectedRows(0).Cells("hora").Value IsNot Nothing Then
MsgBox(GVPrueba.SelectedRows(0).Cells("hora").Value.ToString)
End If
End If
End Sub
Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
If GVPrueba.Rows.Count > 0 Then
GVPrueba.Rows(0).Cells("hora").Value = Now
End If
End Sub
Public Class TimePickerCellElement
Inherits GridDataCellElement
Public Sub New(ByVal column As GridViewColumn, ByVal row As GridRowElement)
MyBase.New(column, row)
End Sub
Private oRadTimePickerElement As RadTimePickerElement
Protected Overrides Sub CreateChildElements()
MyBase.CreateChildElements()
oRadTimePickerElement = New RadTimePickerElement()
Me.Children.Add(oRadTimePickerElement)
End Sub
Protected Overrides Sub SetContentCore(value As Object)
If Me.Value IsNot Nothing AndAlso Me.Value IsNot DBNull.Value Then
DateTime.TryParse(value, oRadTimePickerElement.Value)
' MyBase.SetContentCore(value)
End If
End Sub
Public Overrides Function IsCompatible(ByVal data As GridViewColumn, ByVal context As Object) As Boolean
Return TypeOf data Is TimePickerColumn AndAlso (TypeOf context Is GridDataRowElement OrElse TypeOf context Is GridNewRowElement)
End Function
End Class
Public Class TimePickerColumn
Inherits GridViewDataColumn
Public Sub New(ByVal fieldName As String)
MyBase.New(fieldName)
End Sub
Public Overrides Function GetCellType(ByVal row As GridViewRowInfo) As Type
If TypeOf row Is GridViewDataRowInfo Then
Return GetType(TimePickerCellElement)
End If
Return MyBase.GetCellType(row)
End Function
End Class
Is there a way to display an encrypted file in PdfViewer ?
I created a file:
formatProvider = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider();
formatProvider.ExportSettings.UserPassword = "xxx";
formatProvider.ExportSettings.IsEncrypted = true;
formatProvider.Export( ...)
And now I want to display it, but haven't found a place to pass a password to the viewer.
It's not displaying any error, it's just displaying - the correct number of - empty pages.
Hi there,
I've been tasked with migrating DataTable functionality to Telerik RadGridView in a C# WinForms app.
DataTable code sample:
var taxColumn = new DataColumn();
taxColumn.DataType = System.Type.GetType("System.String");
taxColumn.ColumnName = "tax";
taxColumn.Expression = "SUBSTRING('ABC',2,3)";
My attempt to do the equivalent using a RadGridView TextBoxColumn fails with "unknown function SUBSTRING()".
Is there any similar functionality in RadGridView to the Substring function in DataColumn please? It's essential to be able to write expressions that do substirng operations in the app I'm working on.
Thanks as ever for your help!
Kind regards, James
I am happy Telerik created these dialogs for aesthetic reasons.
Is there a way to restrict access to file operations (Delete, copy, et. al.)?? I want to restrict file functions that can be performed via these dialogs. For example, I want to prevent someone from copying files from a USB when selecting a folder or selecting a file.
Thanks,
Jim
Hi,
I need to build a solution to export text from PDF including their X,Y cordinates.
Could it be done with PDFViewer or other Telerik product?
Best regards,
André
Hi, i read the documentation for "custom-sorting" and "Setting Sorting Programmatically" but that´s not my case.
i need a possibility to add a custom-sorting only for one column and sort with the data of a hidden column.
What´s the right way to do that?
Best regards
Martin
I am trying to achieve a similar experience as in your CardView demo with the cities. The images are stored as block blobs in an Azure storage account. The blobs have tags, which i want to expose , similar to the meta from the demo where we have city name, population, country).
As far as i saw, there is no direct integration for CloudBlockBlob, so i am trying to place this in a byte array in order to display. Yet the outcome is an empty box in the grid, for each item from the container. the blobs are correctly downloaded, verified by writing the fileContent byte array to disk via filestream.
Any idea on how to achieve this?
Thank you!
public partial class Form1 : Form
{
string sasToken = "?st=2020-02-12T21%3A05%3A08Z&se=2021-02-13T21%3A05%3A00Z&sp=rl&sv=2018-03-28&sr=c&sig=*redacted*";
public Form1()
{
InitializeComponent();
}
public List<IListBlobItem> MainBody3(string id)
{
StorageCredentials accountSAS = new StorageCredentials(sasToken);
// Use these credentials and the account name to create a Blob service client.
CloudStorageAccount account = new CloudStorageAccount(accountSAS, "storage_account_name", endpointSuffix: null, useHttps: true);
CloudBlobClient client = account.CreateCloudBlobClient();
CloudBlobContainer container = client.GetContainerReference("images-analyzed-sampled");
BlobContinuationToken token = null;
List<BlobInfo> blobi = new List<BlobInfo>();
List<IListBlobItem> poze = new List<IListBlobItem>();
BlobRequestOptions options = new BlobRequestOptions();
var myResults = new DataSet();
do
{
var result = container.ListBlobsSegmented(null, true, new BlobListingDetails(), 20, token, null, null);
token = result.ContinuationToken;
var blobs = result.Results;
foreach (IListBlobItem item in blobs)
{
var blob = item as CloudBlockBlob;
long fileByteLength = blob.Properties.Length;
byte[] fileContent = new byte[fileByteLength];
for (int i = 0; i < fileByteLength; i++)
{
fileContent[i] = 0x20;
}
radCardView1.Items.Add(blob.DownloadToByteArray(fileContent, 0));
}
} while (token != null);
return poze;
}
private bool HasMatchingMetadata(CloudBlockBlob blob, string term)
{
foreach (var item in blob.Metadata)
{
if (((item.Key.StartsWith("Tag") || (item.Key.StartsWith("PredictedImageType"))) && item.Value.Equals(term, StringComparison.InvariantCultureIgnoreCase)))
return true;
}
return false;
}
private void radButton1_Click(object sender, EventArgs e)
{
MainBody3("");
}
}
public class BlobInfo
{
public string ImageUri { get; set; }
public string ThumbnailUri { get; set; }
public string Caption { get; set; }
}
}
public RadForm1()
{
RadMapElement.VisualElementFactory = new MyMapVisualElementFactory();
InitializeComponent();
<..filling data and asigning clustering here>
}
public class MyMapVisualElementFactory : MapVisualElementFactory
{
public override MapCluster CreateCluster()
{
System.Diagnostics.Debug.WriteLine("FIRE!");
return new MapCluster();
}
}
Hi,
Can I load pictures via LoadImageFromUrl from a local disk without async methods?
The code below works, but it works poorly and often the images do not load, or not all are loaded.
Uri uri = new Uri(Path.Combine(Holder.TempPath, e.Url), UriKind.Absolute);
WebClient client = new WebClient();
client.OpenReadCompleted += (w, a) =>
{
if(a.Error == null)
{
try
{
e.ImageElement.Init(a.Result, new Telerik.WinControls.RichTextEditor.UI.Size(16, 16), extension);
}
catch
{
//Handle errors
}
}
};
client.OpenReadAsync(uri);
Hi,
i would like to change cursor for data field label in RadDataLayout, to make it work as hyperlink, I set it font as below, but can't find any cursor property, is it possible?
Private Sub RadDataLayout1_ItemInitialized(sender As Object, e As Telerik.WinControls.UI.DataLayoutItemInitializedEventArgs)
Dim ci As DataLayoutControlItem = e.Item
e.Item.Font = New System.Drawing.Font(e.Item.Font.Name, e.Item.Font.Size, FontStyle.Underline)
end sub
Thanks
Alex