Telerik Forums
UI for WinForms Forum
5 answers
320 views
Hello friends,

I need any change in the schedule is saved automatically. I am building the project in vb.net. In my code below that the problem happens when I save a new appointment, the appointment is saved twice. Appear when two close and open again the agenda. Can you help me? Below is the code:

 Private Sub FrmPortal_Load(sender As Object, e As EventArgs) Handles Me.Load
        AddHandler Me.RadScheduler1.Appointments.CollectionChanged, AddressOf Appointments_CollectionChanged
        Me.RadScheduler1.ActiveView.StartDate = Date.Now
End Sub

 Private Function Appointments_CollectionChanged(ByVal sender As Object, ByVal e As NotifyCollectionChangedEventArgs) As String
        Select Case e.Action
            Case NotifyCollectionChangedAction.Add
                CollectionChangedCompleted("Add")
            Case NotifyCollectionChangedAction.Batch
                CollectionChangedCompleted("Batch")
            Case NotifyCollectionChangedAction.ItemChanged
                CollectionChangedCompleted("ItemChanged")
            Case NotifyCollectionChangedAction.ItemChanging
                CollectionChangedCompleted("ItemChanging")
            Case NotifyCollectionChangedAction.Move
                CollectionChangedCompleted("Move")
            Case NotifyCollectionChangedAction.Remove
                CollectionChangedCompleted("Remove")
            Case NotifyCollectionChangedAction.Replace
                CollectionChangedCompleted("Replace")
            Case NotifyCollectionChangedAction.Reset
                CollectionChangedCompleted("Reset")
        End Select
        Return String.Empty
    End Function

    Private Function CollectionChangedCompleted(ByVal action As String) As Boolean
        If RadScheduler1.Appointments.IsUpdated Then
            performAction(action)
            Return True
        Else
            Return False
        End If
        Return False
    End Function

    Private Function performAction(ByVal action As String) As Boolean
        Select Case action
            Case "Add"
                Call SalvarAgenda()
            Case "Batch"
                Call SalvarAgenda()
            Case "ItemChanged"
                Call SalvarAgenda()
            Case "ItemChanging"
                'Call SalvarAgenda()
            Case "Move"
                Call SalvarAgenda()
            Case "Remove"
                Call SalvarAgenda()
            Case "Replace"
                Call SalvarAgenda()
            Case "Reset"
                Call SalvarAgenda()
        End Select
    End Function

 Sub SalvarAgenda()
        AppointmentsTableAdapter.Adapter.AcceptChangesDuringUpdate = False
        Dim deletedChildRecords As ERPDataSet.AppointmentsResourcesDataTable = TryCast(Me.ERPDataSet.AppointmentsResources.GetChanges(DataRowState.Deleted), ERPDataSet.AppointmentsResourcesDataTable)
        Dim newChildRecords As ERPDataSet.AppointmentsResourcesDataTable = TryCast(Me.ERPDataSet.AppointmentsResources.GetChanges(DataRowState.Added), ERPDataSet.AppointmentsResourcesDataTable)
        Dim modifiedChildRecords As ERPDataSet.AppointmentsResourcesDataTable = TryCast(Me.ERPDataSet.AppointmentsResources.GetChanges(DataRowState.Modified), ERPDataSet.AppointmentsResourcesDataTable)
        Try
            If deletedChildRecords IsNot Nothing Then
                AppointmentsResourcesTableAdapter.Update(deletedChildRecords)
            End If
            AppointmentsTableAdapter.Update(Me.ERPDataSet.Appointments)
            If newChildRecords IsNot Nothing Then
                AppointmentsResourcesTableAdapter.Update(newChildRecords)
            End If
            If modifiedChildRecords IsNot Nothing Then
                AppointmentsResourcesTableAdapter.Update(modifiedChildRecords)
            End If
            Me.ERPDataSet.AcceptChanges()
        Catch ex As Exception
            '    MessageBox.Show(String.Format("An error occurred during the update process:" & vbLf & "{0}", ex.Message))
        Finally
            If deletedChildRecords IsNot Nothing Then
                deletedChildRecords.Dispose()
            End If
            If newChildRecords IsNot Nothing Then
                newChildRecords.Dispose()
            End If
            If modifiedChildRecords IsNot Nothing Then
                modifiedChildRecords.Dispose()
            End If
        End Try
    End Sub
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 Feb 2017
6 answers
154 views
In my grid, text is black.  When a row is selected, the text turn to grey  (that's ok).  But when I move the selection to another row, text on previously selected row remains grey (see picture).  How can I make the text turn back to black (its original color).  I looked at the visual designer but haven't find the element or attribute that is responsible for this behavior.
Claude
Top achievements
Rank 1
 answered on 22 Feb 2017
2 answers
1.4K+ views
Is there a clean way to set the line spacing for all text in a document (add both via import and user typed)?

I found the RichTextEditor.Document.LineSpacing property, but this appear to set an absolute of the spacing between the bottom of each instead the of space between each line, which would have to be based on font size.

I assume I could use this property and go through line by line looking at the font size and setting it when anything changed on the document, but that sounds like it would result in an excessive amount of overhead.

I'm not looking to use any special spacing or anything like that, just enforce single line spacing on the document regardless of font size and apply to to both imported text and user typed text.

Any help would be appreciated.
Hristo
Telerik team
 answered on 22 Feb 2017
2 answers
220 views

Hi,

i would like to change the color of my tileElement in runtime (property defined by user), but i would like to keep the effect of the tileElement (another color define  for mouseover)

Is there any way ?

OD
Top achievements
Rank 1
 answered on 22 Feb 2017
2 answers
155 views

Hi, 

i made a custom filtering in my Grid. I have a FilterCell with a "FilterClearButton" and I confirm my FilterCellEntry with the Keys "Enter" or Tab. 

I also set these properties:

            loGridFilterCellElement:FilterButton:Visibility = Telerik.WinControls.ElementVisibility:Collapsed
            loGridFilterCellElement:FilterOperatorText:Visibility = Telerik.WinControls.ElementVisibility:Collapsed

 

When I leave my Filtercell(CellEndEdit Event), I make a new Filterdescriptor.

         loFilterDescriptor = NEW Telerik.WinControls.Data.FilterDescriptor().
         loFilterDescriptor:Operator = Telerik.WinControls.Data.FilterOperator:Contains.
         loFilterDescriptor:PropertyName = poGridViewDataColumn:Name.
         loFilterDescriptor:IsFilterEditor = TRUE.
         loFilterDescriptor:VALUE = poVal.

and add it to the FilterDescriptorCollection of my Grid.

         THIS-OBJECT:FilterDescriptors:BeginUpdate().

         THIS-OBJECT:FilterDescriptors:Add(loFilterDescriptor).
         THIS-OBJECT:FilterDescriptors:EndUpdate().

 

So far, there is no problem but if I filter a column for "Dom" and in my Grid there are two entries in this column with "Zöbl Dominik" and "test user" the Grid is empty. But if I enter "Zöb" in my Filtercell and leave it, the Entry "Zöbl Dominik" is shown in my Grid.

 

I think i have missed some property or other setting. It seems like it is filtering with "Begins" and not contains but I already iterated through oll the FilterDescriptors of my Grid and all are with "Contains". 

I know it is not easy to help me in that case because I made a lot of these extras myself but does anybody have an idea what i have made false?

Sincerely,

Dominik Zöbl

Hristo
Telerik team
 answered on 21 Feb 2017
2 answers
112 views

I need to pivot the the Day View so that my resources show up along the left vertical column and the time of day is horizontal across the top.

Using your example provided here....  http://docs.telerik.com/devtools/winforms/scheduler/views/grouping-by-resources#grouping-by-resources-in-different-views

..as a reference point...

Alan and Ann are stacked along the left side of the view.  And the times  0300-1600 are laid across the top.

Thank you in advance.

-Scott

Scott
Top achievements
Rank 1
 answered on 20 Feb 2017
1 answer
122 views

dear all, i m facing the following issue when i pressed shortcut key which is "Ctrl + F" register in my application using the following code.

[code]

this.grdMain.GridViewElement.Shortcuts.Add(new RadShortcut(Keys.Control, Keys.F));
this.grdMain.GridBehavior = new ModifiedGridActions();

[/code]

and overriding the keyprocess function in grid behaviors using the following code

[code]

public class ModifiedGridActions : BaseGridBehavior
        {
            public override bool ProcessKey(KeyEventArgs keys)
            {
                try
                {
                    if (keys.Control && keys.KeyCode == Keys.F) // issue on this line
                    {
                        this.GridControl.MasterView.TableFilteringRow.Cells["cName"].BeginEdit();
                    }
                }
                catch (Exception ex)
                {
                }
                return base.ProcessKey(keys);
            }
        }

[/code]

when i press ctrl + f above override function triggers but its parameter only contains keys.control is true and keys.keycode property contains 17 which also ctrl code. what i expect is to get keys.control is true and keys.keycode should contains keys.F so that my logic can execute am i implementing somthing wrong.

Dimitar
Telerik team
 answered on 20 Feb 2017
3 answers
157 views
Hello,

I am trying to keep an object in the Tag property of a tool window.
But when I dock the tool window to a position the tag property becomes null.

  

 

ToolWindow window = new ToolWindow();   
_documentTabStrip.Controls.Add(window);  
window.Tag = "Tag";  // Here I assign a tag   
_radDock.DockControl(window, DockPosition.Top, DockType.ToolWindow);  
// The Tag property of the docked toolwindow is null (_radDock.ToolWindows[0].Tag is null)  
 

Is there any way to find the docked window in the _radDock to set its Tag.
Please help.
Burhan Eyimaya

 

 

 

 

 

 

 

 

 

 

Hristo
Telerik team
 answered on 20 Feb 2017
0 answers
105 views

Hi,

I'm creating password with track bar.

I do not know how to write code (TrackBar.Value):

 

Please check my code:

01.int PassLength = 0;
02.static string Shuffle(string input)
03.{
04.    var q = from c in input.ToCharArray()
05.            orderby Guid.NewGuid()
06.            select c;
07.    string s = string.Empty;
08.    foreach (var r in q)
09.        s += r;
10.    return s;
11.}
12.private void CreatePassword_Click(object sender, EventArgs e)
13.{
14.    txt_CreatePass.Text = "";
15.    string text = "aAbBcCdDeEfFgGhHiIjJhHkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ01234567890123456789{,;:!*$@-_=^[}{,;:!*$@-_=^[}";
16.    text = Shuffle(text); //shuffle the above symbols using shuffle() method.
17.    text = text.Remove(PassLength); //cut the string size according to the chosen trackbar value.
18.    txt_CreatePass.Text = text;
19.}
20. 
21.private void TrackBar_ValueChanged(object sender, EventArgs e)
22.{
23. 
24.    this.TrackBarCreatePass.Value = Convert.ToInt32(+1);
25.    lbl_Count.Text = PassLength.ToString();
26. 
27.    //lbl_Count.Text = TrackBarCreatePass.Value.ToString();
28.    //PassLength = this.TrackBarCreatePass.Value;
29.}
30. 
31.private void TrackBar1_CreatePass_ValueChanged(object sender, EventArgs e)
32.{
33.    PassLength = TrackBar1_CreatePass.Value + 1; //trackbar value starts from 0, so I add +1 to make it understandable;
34.    lbl_Count.Text = PassLength.ToString();
35.}
saeid
Top achievements
Rank 1
 asked on 19 Feb 2017
1 answer
213 views

Is there any way to apply a StyleRepository object to a control? I know I can do something like:

         Theme currenTheme = ThemeRepository.FindTheme(ThemeResolutionService.ApplicationThemeName);
         StyleRepository repositoryFromTheme = currenTheme.FindRepository("DisabledForeColor");
         PropertySetting styleForeColor = repositoryFromTheme.FindSetting("ForeColor");
         Color colorToSet = (Color)styleForeColor.Value;
         myTextBox.Forecolor = colorToSet;

However, if I have multiple properties to set (say, multiple colors and maybe some transparency or a background image or something), this can get a bit tedious and it lacks flexibility. So, what I'd like to do is just take the StyleRepository object and apply it directly to the control. Alternately, I'd be fine with looping through the settings collection and applying each of those individually so long as I didn't have to hard code the names of the PropertySettings into my code. Something like:

         foreach (PropertySetting currentPropertySetting in repositoryObjectFromTheme.Settings)
         {
            genericRadControl.SOMETHING = currentPropertySetting;
         }

would work for me fine as well.

Any suggestions?

 

Hristo
Telerik team
 answered on 17 Feb 2017
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?