Hello.
I have the following code that used to work:
private void cellFormatting(object sender, CellFormattingEventArgs e)
{
if (chkHighlight.Checked && e.RowIndex < grid.RowCount - 1 &&
e.Column.FieldName != nameof(Audited.ValidFromTime) &&
e.CellElement.Value?.Equals(grid.Rows[e.RowIndex + 1].Cells[e.ColumnIndex].Value) != true)
e.CellElement.Font = new Font(e.CellElement.Font, FontStyle.Bold);
else
e.CellElement.ResetValue(LightVisualElement.FontProperty, ValueResetFlags.Local);
}
For some reason none of the cells comes up bold anymore (I set a breakpoint to make sure the code that sets the Font was being executed).
Any ideas?
Hey there!
I wanted to be able to Show the 'AutoCompleteDropDown' after having already used it, or having text behind the cursor. I wanted to use a space to separate such usage but I can't quite control this functionality in this object (RadTextBoxControl).
This is usefull to help the user to write complex formulas without having to check for specific names or values. And these formulas can have more than 300 characters so i want to 'help' the user on his "journey".
Ex: vQuant * 300 - (vValue - 66) -> The 'vQuant' and 'vValue' are variables or constants that the user doesn't know by memory because there are more than 1000. He may know the first 2 letters or so tho.
I was able to show the object by doing 'THIS-OBJECT:radTextBoxControl1:TextBoxElement:AutoCompleteDropDown:Show().' but it has 0 items (even by having text in the object and 'THIS-OBJECT:radTextBoxControl1:TextBoxElement:AutoCompleteItems:Items:count' being > 0).
I'm open to any ideas.
JP
There seems to be a random issue when invoking the UnloadDocument method. The method blocks and locks up the application.
It happens with random PDF forms. I have tried testing with different PDF forms and it seems completely random.
I upgraded from a trial version to a paid version. In doing so Telerik put my WinForms project thru an upgrade process. Most of my forms make use of the RadForm. In those cases I can tell that the formatting is slightly different ... but nothing that causes pain.
In contrast, I have a RadTabbedForm that I have invested much time in. It has many controls on various tabs. (Kinda the point of such a control.)
This "upgrade" has:
I'm far from new to the software development game and understand some pains with upgrades. Unless there is a relatively simple adjustment that can be made to resolve this form, this "upgrade" will have been a waste of my time and my client's money.
Does anyone have any direction as to how best resolve these type of issues without throwing the work away?
Hi.
I want to know if there is a way to NOT execute the code in "SelectedIndexChanged" when the form loads the first time
Regards
Kobus
is it posssible to add a button to the header of a radcollapsiblepanel from the designer code ,if so can a anyone please guide me.
Hi,
I've followed the instructions for creating a custom visual Item, but I need some direction on how to make that example more useful and attractive.
What I need is the item image shown (a thumbnail image, it's an image gallery listview), and under that I need two buttons with transparent png images, side by side. 32x32 icons (and the listview item itself is big, like 180x180.) Under the icons I need the Text of the bound item with 18pt font.
I've tried adding panels with the buttons, adding a lable element with custom font size... it's not really coming along very nicely and I feel like I'm just stumbling along and one day might get it all looking good haha
I added event handlers for the buttons inside my custom item class, is that the righ way to do it?
delBtnElem.Click += delBtnElem_Click;
But now the top-level click event on the item is not firing. Is my panel overlaying it all? I set an huge top margin to try to align the buttons under the Icon View image.
So maybe you can help me figure out the best way to lay it out?
Thank You!
-David
Here is the code in my Custom Item class (GalleryItemView):
public class GalleryItemView : IconListViewVisualItem
{ ...
protected override void CreateChildElements()
{
base.CreateChildElements();
stack.Orientation = Orientation.Vertical;
btnPanel.Margin = new Padding(0, 80, 0, 0);
printBtnElem.Image = Image.FromFile(@"..\..\Resources\print-icon.png");
printBtnElem.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
printBtnElem.Click += printBtnElem_Click;
delBtnElem.Image = Image.FromFile(@"..\..\Resources\delete-icon.png");
delBtnElem.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
delBtnElem.Click += delBtnElem_Click;
titleElem.Margin = new Padding(8);
titleElem.CustomFontSize = 18F;
btnPanel.Children.Add(printBtnElem);
btnPanel.Children.Add(delBtnElem);
stack.Children.Add(btnPanel);
stack.Children.Add(titleElem);
this.Children.Add(stack);
}
Here is some code form my Form:
private void radListViewGallery_VisualItemCreating(object sender, ListViewVisualItemCreatingEventArgs e)
{
if (this.radListViewGallery.ViewType == ListViewType.IconsView)
{
e.VisualItem = new GalleryItemView();
}
}
void radListViewGallery_VisualItemFormatting(object sender, Telerik.WinControls.UI.ListViewVisualItemEventArgs e)
{
e.VisualItem.DrawText = false;
e.VisualItem.ImageLayout = ImageLayout.Zoom;
e.VisualItem.ImageAlignment = ContentAlignment.MiddleCenter;
}
void radListViewGallery_ItemDataBound(object sender, Telerik.WinControls.UI.ListViewItemEventArgs e)
{
var databoundItem = e.Item.DataBoundItem as MyImageObject;
e.Item.Image = databoundItem.Image;
e.Item.Text = databoundItem.FilePath;
}
more details about the ListView
class MyImageObject
{
public Image Image { get; set; }
public string FilePath { get; set; }
public MyImageObject(Image img, string filePath)
{
this.Image = img;
this.FilePath = filePath;
}
}
private void RefreshFileList(string _filePath, FileFilterType _filterType)
{
List<String> fileList = new List<String>();
if (_filterType == FileFilterType.All)
{
var extensionFilter = new String[] { "*.png", "*.bmp", "*.jpg", "*.mp4" };
foreach (String extension in extensionFilter)
{
String[] files = Directory.GetFiles(_filePath, extension, SearchOption.TopDirectoryOnly);
foreach (String file in files)
fileList.Add(file);
}
}
if (_filterType == FileFilterType.Video) fileList = Directory.GetFiles(_filePath, "*.mp4", SearchOption.TopDirectoryOnly).ToList();
if (_filterType == FileFilterType.Images)
{
var extensionFilter = new String[] { "*.png", "*.bmp", "*.jpg" };
foreach (String extension in extensionFilter)
{
String[] files = Directory.GetFiles(_filePath, extension, SearchOption.TopDirectoryOnly);
foreach (String file in files)
fileList.Add(file);
}
}
imageList.Clear();
foreach (var mediaFileName in fileList.OrderByDescending(f => f))
{
var fileNameLowCase = mediaFileName.ToLower();
if (fileNameLowCase.Contains(".png") || fileNameLowCase.Contains(".bmp") || fileNameLowCase.Contains(".jpg"))
{
var tempImage = Image.FromFile(fileNameLowCase);
Bitmap pic = new Bitmap(96, 64);
using (Graphics g = Graphics.FromImage(pic))
{
g.DrawImage(tempImage, new Rectangle(0, 0, pic.Width, pic.Height));
}
imageList.Add(new MyImageObject(pic, fileNameLowCase));
tempImage.Dispose();
}
if (fileNameLowCase.Contains(".mp4"))
{
var thumb = getThumbnail(fileNameLowCase);
if (thumb == null)
{
Bitmap pic = new Bitmap(96, 64);
using (Graphics g = Graphics.FromImage(pic))
{
g.DrawImage(ICUSBCamera.Properties.Resources.play_button, new Rectangle(0, 0, pic.Width, pic.Height));
}
imageList.Add(new MyImageObject(pic, fileNameLowCase));
} else imageList.Add(new MyImageObject(thumb, fileNameLowCase));
}
}
radListViewGallery.DataSource = imageList;
}
I have tried to do this in a few places... but perhaps this is not supported
I'd like to be able to apply HTML formatting to the LegendItem Title so that when the (Datapoint.LegendTitle) in the LabelFormatting routine causes the title to have html applied.
Private Sub LegendElement_VisualItemCreating(sender As Object, e As LegendItemElementCreatingEventArgs)Hello.
I build a Combo from a table
DataTable dt = lb.clsDB_user_store_gen.get_dt_for_all_user_store();
cboReporter.DataSource = dt;
cboReporter.ValueMember = "uid";
cboReporter.DisplayMember = "displayName";
I put the form in ADD MODE, and wand to say in the first record "Select a Reporter"
It works the first time. When I update the record and clear the form, I call the code below. this then add the text again. (sorry wanted to add small video, but mp4 not supported)
// cboReporter
cboReporter.SelectedText = "";
cboReporter.SelectedText = "Select a Reporter";
// cboAssignee
cboAssignee.SelectedText = "";
cboAssignee.SelectedText = "Select a Assignee";
Hello, do you have any quick simple examples of adding a RadDropDownButtonElement to a Listview? I have implemented some of the other controls like a RadDropDownListElement and RadCheckBoxElement but those seem to have synchronize events and this does not? Do you have any examples of this control?
Thank you!