Telerik Forums
UI for WinForms Forum
1 answer
893 views

I am using the simple code below to load and image from SQL, then save it back to the Image datatype column.

I am able to load the image, but when I perform ANY edit feature (from the RadImageEditor control) the size of the image (relative size on disk in bytes) increases over 10x the original image.  Eventually it will consume all the memory and crash the application.  This behavior does not happen if I load a fixed image directly from disk.

The two attached images show the size of the image after immediately loading it, then the size of the image after performing a single Rotate 90 degrees.  

I cannot find any example of either loading an image from a DB nor saving to DB. Please review and provide any correction to loading and saving images (blob, image)  from SQL, or please provide a simple example of loading and saving a SQL image.

FYI: objAttach.ImageBlob is defined as Byte()

    Private Sub frmAttachmentViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.lblMessage.Text = ""
        mbImageChanged = False
        Dim ms As MemoryStream = New MemoryStream(objAttach.ImageBlob, 0, objAttach.ImageBlob.Length)
        Dim img As Image = Image.FromStream(ms)
        Me.RadImageEditor1.OpenImage(img)
        lblImgSize.Text = "Size: " & ms.Length & " KB"
    End Sub

    Private Sub RadImageEditor1_CurrentImageChanged(sender As Object, e As ImageChangedEventArgs) Handles RadImageEditor1.CurrentImageChanged
        Dim ms As New MemoryStream()
        Me.RadImageEditor1.SaveImage(ms)
        lblImgSize.Text = "Size: " & ms.Length & " KB"
    End Sub

    Private Sub cmdSave_Click(sender As Object, e As EventArgs) Handles cmdSave.Click
        Dim ms As New MemoryStream()
        Try

            Me.RadImageEditor1.SaveImage(ms)

            Dim iToInt As Integer = Convert.ToInt32(ms.Length)
            Dim imgBinaryData As Byte() = New Byte(iToInt - 1) {}
            imgBinaryData = ms.ToArray()
            objAttach.ImageBlob = imgBinaryData

            objAttach.save()
            Me.lblMessage.Text = "Image Saved"
        Catch ex As Exception
            MessageBox.Show("Error Saving Image: " & vbCrLf & vbCrLf & ex.Message)
        Finally
            ms = Nothing
        End Try
    End Sub

 

Todor
Telerik team
 answered on 20 Oct 2021
2 answers
135 views

Hello,

1. In the attached picture, the localization strings of the items with the red arrow are not in the LocalizationProvider. How can I localize them?
2. How can I turn off the DropDown button shown with the blue arrow in the picture?

Kind regards.

Bekir
Top achievements
Rank 1
Iron
 answered on 19 Oct 2021
1 answer
142 views

It's great being able to set the backcolor for userinfo() values.

However, the ForeColor property is missing or is hidden...
It appears that the "Hidden" Forecolor property is set to White.

Consequently, one cannot set a contrasting forecolor for the given backcolor that is used.

For Example:

Private user1 As UserInfo = New UserInfo()
user1.FirstName = _UserFirstName
user1.LastName = _UserLastName
User1.BackColor = Color.LightYellow

What is needed now for the contrasting ForeColor would be this:
User1.ForeColor = Color.Black

Currently, if the backcolor is set to a very light back color - one cannot read the White ForeColor text

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 19 Oct 2021
1 answer
220 views

Hello  All,

I am trying to enable scroll bar for the radsplitcontainer and I am having hard time. I set autoscroll to true but the scroll bar doesn't show up. I am able to get the scroll bar for the individual split panels. Is there a way I can get the scroll bar for the whole panel instead of the individual splits. basically, I split it into three panels and trying to stretch my controls as the size grows but on higher resolutions I may need scrollbars and that's the reason I want the scrollbars enabled. I have attached my sample application. Can I get some help please.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 19 Oct 2021
1 answer
162 views
RadScheduler: I need to program a room booking system. Is RadScheduler the best tool to do this? Which field should I use to select the rooms "Location" or "Resources"? I am programming in VB.NET.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 19 Oct 2021
1 answer
203 views

Hi,

I am using the radSchduler for a new project. I encountered and error when trying to save a modified appointment.

"Update requires a valid UpdateCommand when passed DataRow collection with modified rows."

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 19 Oct 2021
1 answer
112 views

Hi

is there any way to change the font of the add new row in WinForms grid view

thanks in advance

regards

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 19 Oct 2021
2 answers
205 views

Hi, how do I resolve this error? Please see attachement.

RadScheduler: Error Could not find Schema information for the attribute 'urn:schemas-microsoft.com:xml-msdata:UseCurrentLocale'.

Thanks and best regards,

Dominic

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Oct 2021
1 answer
138 views

I want to implement my own version of load on demand feature for RadCheckedDropDownList (if there's already one that meets my requirements then sorry for posting).

When the RadCheckedDropDownList's  OnKeyUp event happens for alphanumeric char I want to send async request to my ASP.NET Web Service - when webservice's request is completed I want to either (both options are viable for me):

a) add new items (that are not already existing) to the DataSource,

b) save somewhere items that are already checked and load items to the DataSource,

and show Popup scrolled to the item that is matching the text that already user inserted into RadCheckedDropDownList's RadCheckedDropDownListEditableAreaElement.

My code so far:


private void LoadOnDemandCompleted( object sender, GetDropDownMenuItemsPagedCompletedEventArgs e )
{
	//RadCheckedDropDownListOnDemand - my class that inherits RadCheckedDropDownList
	if ( e.Error != null || e.Result == null || (int)e.UserState != this.RadCheckedDropDownListOnDemand.RequestId )
	{
		//WS call errored out, nothing was returned, or the request number is not matching
		return;
	}

	if ( !( this.RadCheckedDropDownListOnDemand.DataSource is List<RadCheckedListDataItem> mainDataSource ) )
		return;

	//Properties explanation:
	//Value == string to display
	//Id == id in database
	//ChoiceOrder - order in which the RadCheckedListDataItem should appear -> lower ChoiceOrder means it is higher on the list

	var itemsFiltered = e.Result.Select( re => new RadCheckedListDataItem( re.Value )
	{
		Value = re.Id,
		Tag = re.ChoiceOrder,
	} )
	.Where( item => !mainDataSource.Any( mainDataSourceItem => (int)item.Value == (int)mainDataSourceItem.Value ) )
	.ToList();

	//don not want to add items that are already existing in 
	if ( itemsFiltered.Count > 0 )
	{					
		mainDataSource.AddRange( itemsFiltered );

		//want to refresh item list for CheckedDropDownListElement
		if ( !( this.RadCheckedDropDownListOnDemand.CheckedDropDownListElement.DataSource is List<RadCheckedListDataItem> listElementDataSource ) )
			return;

		listElementDataSource.AddRange( itemsFiltered );

		//this does not show the newly added items
		this.RadCheckedDropDownListOnDemand.CheckedDropDownListElement.ShowPopup();				
	}
}

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Oct 2021
2 answers
324 views
When I move a TaskBoard card up or down within a TaskBoard Column, how do I get the Index location for the card that was moved?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Oct 2021
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)
Chart (obsolete as of Q1 2013)
Form
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
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?