Telerik Forums
UI for WinForms Forum
0 answers
270 views

Hi ,

I have a grid view with base 64 image from api. Now I am binding the base 64 image by the way:

private void Gridview_CreateCell(object sender, GridViewCreateCellEventArgs e)
        {
            if (e.Column.Index == 0 && e.Row.RowInfo is GridViewDataRowInfo)
            {
                e.CellElement = new CustomGridImageCellElement(e.Column, e.Row);
            }
        }

CustomGridImageCellElement.cs

 public class CustomGridImageCellElement : GridDataCellElement
    {
        ImagePrimitive _imagePrimitive;
        public CustomGridImageCellElement(GridViewColumn column, GridRowElement row)
            : base(column, row)
        {
        }


        public override void Initialize(GridViewColumn column, GridRowElement row)
        {
            //if (_imagePrimitive == null)
            //{
            _imagePrimitive = new ImagePrimitive();
            _imagePrimitive.Margin = new Padding(3);
            this.Children.Add(_imagePrimitive);
            this.AutoSizeMode = RadAutoSizeMode.WrapAroundChildren;
            //}         
            base.Initialize(column, row);
        }

 protected override void SetContentCore(object value)
        {

     if (this.Value != null && this.Value.ToString() != string.Empty
                && (this.Value.ToString().StartsWith("http") || this.Value.ToString().StartsWith("data:image/")) && _imagePrimitive.Image == null)
            {
                var imageData = this.Value.ToString();
                if (!imageData.StartsWith("http"))
                {
                    byte[] imageBytes = Convert.FromBase64String(imageData.Replace("data:image/JPEG;base64,", ""));
                    // Convert byte[] to Image
                    using (var ms = new MemoryStream(imageBytes, 0, imageBytes.Length))
                    {
                        _imagePrimitive.Image = System.Drawing.Image.FromStream(ms, true);
                    }
                }

 

It can display image now., but my problem is when scrolling up and down I see it run the custom cell again and it makes SetContentCore run and display error and slowly. How can I avoid it ?

Bao
Top achievements
Rank 1
 asked on 24 May 2018
1 answer
235 views

hi~~~

 I need your help~

I want GanttViewTextViewElement export to excel file include hierarchy

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 May 2018
2 answers
130 views

I create a radChartView with three bar series and a legend and show it on the form.
Then I change runtime programatically the appearance of the two series (I make them invisible: IsVisible = false), but the legend remains the same.

For comparison - in the MSChart such stupidity is not observed

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 May 2018
1 answer
120 views

I have found a few bugs with the Radtreeview during my recent development.  I have submitted them as tickets and have received suggestions or agreement that it was an issue.  I was wondering if these tickets and resolutions that are suggested and my work arounds that I came up with are posted for others to see or just stay under my tickets and no one else gets to learn from them?

 

Seems like tickets should be shared where resolutions are found for issues.  Not sure if there is a way for the user to make a ticket to share and just make things anonymous or what.  Shame if others are having the same issues as me and don't get to learn from others.  I know I hardly find good solutions in the forums but sure there are good answers out there in other people's tickets.

Thanks

Patrick

 

Dimitar
Telerik team
 answered on 24 May 2018
1 answer
128 views

Hello,

 

If I try to add RadCheckedDropDownList and dock it in TableLayoutPanel in newest version of UI for WinControls it crashes with following error (see code below)

var form = new Form();
var table = new TableLayoutPanel();
var list = new RadCheckedDropDownList();
 
list.Dock = DockStyle.Fill;
// Set dock causes System.ArgumentOutOfRangeException: 'Value of '-2147483648' is not valid for 'LargeChange'. 'LargeChange' must be greater than or equal to 0.
 
table.Controls.Add(list, 1, 0);
form.Controls.Add(table);
form.ShowDialog();

 

The problem is, I have application which has like 40 RadCheckedDropDownList, so any help will be appreciated.

Regards,

Mateusz

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 May 2018
7 answers
361 views

I create a BarSeries where the category is the sequence of integers 1, 2, 3, ...

then I change

MajorTickInterval = 10;

tick labels are drawn as 12 22 32 ...

Why not 10, 20, 30 ...?

Dimitar
Telerik team
 answered on 23 May 2018
5 answers
139 views

If I handle a RadTreeNode in this way:

public partial class RadForm2 : Telerik.WinControls.UI.RadForm
    {
        private RadTreeNode m_myNode1;
        private RadTreeNode m_myNode2;
        public RadForm2()
        {
            InitializeComponent();
 
            m_myNode1 = new RadTreeNode();
            m_myNode2 = new RadTreeNode();
 
            m_myNode1.Nodes.Add(m_myNode2);
 
            radTreeView1.Nodes.Add(m_myNode1);
        }
 
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
 
            var treeview1 = m_myNode1.TreeView;
            if (treeview1 == null)
                throw new InvalidOperationException();
 
            //var x = m_myNode2.TreeViewElement; this solves the problem, by calling FindTreeView internally
            var treeview2 = m_myNode2.TreeView;
            if (treeview2 == null)
                throw new InvalidOperationException();
        }
    }

 

The second Exception is thrown.

The workaround is in the comment, if you call m_myNode2.TreeViewElement or m_myNode2.Nodes before, everything works fine,

anything that causes internally a call to "TreeViewElement" or "FindTreeView" (i digged a bit in the source code).

So this happens only on Nodes, without Childnodes and not for Rootnodes.

It's more a Bug-Report than a Question, but don't know where to Post ist.

If  the TreeView Property is the first Property called, on a RadTreeNode, it always has the value null.

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 May 2018
5 answers
208 views

I create chart as follows:

            var barModel = new BarSeries
            {
                ValueMember = "Model",
                CategoryMember = "N"
            };
            radChartViewGss.Series.Add(_barModel);
            var barWellModel = new BarSeries
            {
                ValueMember = "WellModel",
                CategoryMember = "N"
            };
            radChartViewGss.Series.Add(barWellModel);

...creating and filling a table (DataTable gssTable)

            radChartViewGss.DataSource = gssTable;

... and show table
            radGridViewGss.DataSource = gssTable;

 

Everything works great.

Then I want to change the data:
           radChartViewGss.DataSource = null;

           radGridViewGss.DataSource = null;

            gssTable.BeginLoadData();
            gssTable.Rows.Clear();

... filling a table (gssTable)

            gssTable.EndLoadData();
            gssTable.AcceptChanges();

During the data modification process, the radGridView is not updated, but radChartView constantly tries to update itself. As a result, everything works very slowly.

Why two similar component behave differently when data source disconnected?

I know how programmatically I can disable this behavior of the chart. But this should be done automatically!!! If there is no data source, the chart is not drawn



 

 


Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 May 2018
1 answer
518 views

Hello,

Will I be able to sell my app developed using my Telerik DevCraft Ultimate License

(Complimentary Developer License - Student Edition)?

*Commercial Use

Imer
Telerik team
 answered on 22 May 2018
2 answers
186 views

Hello,

 

I'm developing a new app using telerik radwizard, using the example found at

https://docs.telerik.com/devtools/wpf/controls/radwizard/features/pages

However, when i try to run my application, i get an empty window:

 

I don't know what I'm doing wrong, can someone help me?

 

Source code bellow:

 

<Window x:Class="MainWindow.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                xmlns:wizard="clr-namespace:Telerik.Windows.Controls.Wizard assembly=Telerik.Windows.Controls.Navigation"
                Title="MainWindow"
                WindowState="Normal"
                WindowStartupLocation="CenterScreen"
                WindowStyle="None"
                Background="#dee3e9">
    <telerik:RadWizard x:Name="radWizard" >
        <telerik:RadWizard.WizardPages>
            <telerik:WizardPage Content="My Wizard Page Content" SideHeaderWidth="100" HeaderHeight="100">
                <telerik:WizardPage.HeaderTemplate>
                    <DataTemplate>
                       <Image Source="Images/BrandMark_Telerik_Black.png" Width="200" Height="100" />
                    </DataTemplate>
                </telerik:WizardPage.HeaderTemplate>
                <telerik:WizardPage.SideHeaderTemplate>
                    <DataTemplate>
                        <TextBlock Text="My Side Header" />
                    </DataTemplate>
                </telerik:WizardPage.SideHeaderTemplate>
                <telerik:WizardPage.FooterTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <telerik:RadButton Content="Back"
                                               Width="70" Height="25"
                                               Command="wizard:RadWizardCommands.MoveCurrentToPrevious" 
                                               CommandParameter="{Binding}" />
                            <telerik:RadButton Content="Next" Width="70" Height="25"
                                               Command="wizard:RadWizardCommands.MoveCurrentToNext"
                                               CommandParameter="{Binding}" />
                        </StackPanel>
                    </DataTemplate>
                </telerik:WizardPage.FooterTemplate>
            </telerik:WizardPage>
        </telerik:RadWizard.WizardPages>
    </telerik:RadWizard>
</Window>

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 May 2018
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Form
Chart (obsolete as of Q1 2013)
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
ShapedForm
SyntaxEditor
Wizard
TextBoxControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
SplashScreen
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?