Telerik Forums
UI for WinForms Forum
6 answers
230 views
Hi

I'm having an issue trying to delete appointments programmatically. What I'm doing is handling the AppointmentAdded Event and contrasting the appointment subject (which will contain someones name) against a DB. If the appointment subject (Name) does not appear in the aforementioned DB, then the appointment must be deleted. The problem is that the appointment refuses to be deleted.

Here's the code that I'm using:
Private Sub RadScheduler1_AppointmentAdded(sender As Object, e As Telerik.WinControls.UI.AppointmentAddedEventArgs) Handles RadScheduler1.AppointmentAdded
      Dim app As AppointmentWithPhone = TryCast(e.Appointment, AppointmentWithPhone)
 
      If NameExistsInDB(app.Subject) = False Then
          Debug.WriteLine("Before: " & RadScheduler1.Appointments.Count)
 
          Me.RadScheduler1.Appointments.Remove(app)
 
          Debug.WriteLine("After: " & RadScheduler1.Appointments.Count)
      End If
  End Sub

The output in both debug cases is the same. If I have two appointments and add a third with a name that does not exist in the DB (thus forcing my application to enter inside the "IF") I get this:

Debug output:
Before: 3
After: 3


Can you help me out? Am I doing it the right way or is there some other way to delete an appointment?
Thanks!
Ivan Petrov
Telerik team
 answered on 07 Mar 2013
2 answers
248 views
Hello, 

I'm Using Telerik For WinForms Q1 2013 . i've Filtered GridView with Excel Like Filtering . 

i want send Filtered Rows to a DataTable and After that  send dataTable to StimulReport . 

My Problem is i want send filtered rows exactly not all of rows and records , 

is there possible ? how can i do that ?
Svett
Telerik team
 answered on 07 Mar 2013
1 answer
203 views

I am creating a hierarchy grid using object relational data.  I am adding a GridViewRelation manually to link the two classes together.  The data loads correctly at first, but then selecting a child row will cause all child rows in that position to be duplicated and selected.

After initial data load, everything looks great.

(See dataload.png)


Select Child 2_1 and all first position children are selected.

(see select1.png)


Select Child 3_2 and now all second position children are selected, and the first position children are now duplicates of each other and read Child 4_1.

(see select2.png)


Here is the code:

namespace TestGrid
{
    public partial class Form1 : Form
    {
        private BindingList<MasterObject> data;
 
        public Form1()
        {
            InitializeComponent();
            SetupGrid();
        }
 
        private void SetupGrid()
        {
            LoadMasterTemplate(grid.MasterTemplate);
            GridViewTemplate childTemplate = new GridViewTemplate();
            LoadChildTemplate(childTemplate);
            grid.MasterTemplate.Templates.Add(childTemplate);
 
            GridViewRelation relation = new GridViewRelation(grid.MasterTemplate, childTemplate);
            relation.RelationName = "Children";
            relation.ChildColumnNames.Add("Children");
            grid.Relations.Add(relation);
        }
 
        private void LoadMasterTemplate(GridViewTemplate template)
        {
            template.Columns.Clear();
            template.EnableFiltering = false;
            template.AllowAddNewRow = false;
            template.ShowChildViewCaptions = false;
            template.AutoGenerateColumns = false;
            template.EnableGrouping = false;
 
            GridViewTextBoxColumn colNode = new GridViewTextBoxColumn("NodeDesc");
            colNode.HeaderText = "Node";
            colNode.Name = "Node";
            colNode.ReadOnly = true;
            template.Columns.Add(colNode);
 
            GridViewTextBoxColumn colName = new GridViewTextBoxColumn("Name");
            colName.HeaderText = "Name";
            colName.Name = "Name";
            template.Columns.Add(colName);
 
            template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        }
 
        private void LoadChildTemplate(GridViewTemplate template)
        {
            template.Columns.Clear();
            template.EnableFiltering = false;
            template.EnableGrouping = false;
            template.AllowAddNewRow = false;
            template.AutoGenerateColumns = false;
 
            GridViewTextBoxColumn colNode = new GridViewTextBoxColumn("NodeDesc");
            colNode.HeaderText = "Node";
            colNode.Name = "Node";
            colNode.ReadOnly = true;
            template.Columns.Add(colNode);
 
            GridViewTextBoxColumn colIP = new GridViewTextBoxColumn("Name");
            colIP.Name = "Name";
            colIP.HeaderText = "Name";
            template.Columns.Add(colIP);
 
            template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        }
 
        private void LoadData()
        {
            data = new BindingList<MasterObject>();
 
            for (int i = 1; i < 5; i++)
            {
                MasterObject m = new MasterObject();
                m.Name = "Master " + i;
                for (int x = 1; x < i; x++)
                {
                    ChildObject c = new ChildObject();
                    c.Name = "Child " + i + "_" + x;
                    m.Children.Add(c);
                }
                data.Add(m);
            }
 
            grid.DataSource = data;
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            // Load Data In Grid
            LoadData();
        }
 
        private void button2_Click(object sender, EventArgs e)
        {
            // Add Child to 1
            MasterObject m = data[0];
            ChildObject c = new ChildObject();
            c.Name = "Child " + "1_" + (m.Children.Count + 1);
            m.Children.Add(c);
        }
 
        private void button3_Click(object sender, EventArgs e)
        {
            // Add Child to 2
            MasterObject m = data[1];
            ChildObject c = new ChildObject();
            c.Name = "Child " + "2_" + (m.Children.Count + 1);
            m.Children.Add(c);
        }
    }
 
    public class MasterObject
    {
        private string name;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                if (name != value)
                {
                    name = value;
                }
            }
        }
 
        public string NodeDesc
        {
            get
            {
                return "MasterObject";
            }
        }
 
        private BindingList<ChildObject> children;
        public BindingList<ChildObject> Children
        {
            get
            {
                return children;
            }
            set
            {
                children = value;
            }
        }
 
        public MasterObject()
        {
            children = new BindingList<ChildObject>();
        }
    }
 
    public class ChildObject
    {
        private string name;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                if (name != value)
                {
                    name = value;
                }
            }
        }
 
        public string NodeDesc
        {
            get
            {
                return "ChildObject";
            }
        }
 
        public ChildObject() { }
    }
}
Svett
Telerik team
 answered on 07 Mar 2013
2 answers
212 views
I'm following the example in the attached file here to drag and drop rows. In the PreviewDragDrop() event, the example casts e.DragInstance to a GridDataRowElement.

var rowElement = e.DragInstance as GridDataRowElement;
if (rowElement == null)
    return;

However, I never get a GridDataRowElement, I always get a SnapshotDragItem, so rowElement is always null.

How do I get the row element?
Jay
Top achievements
Rank 1
 answered on 07 Mar 2013
4 answers
332 views
Hello,
I have a datagridview and this have a imagecolumn and that image came from file. i can display image in grid but when i want to export datagrid value to pdf image doenst display in pdf.
Can you help me?
i attached example image from my grid and pdf.


Ivan Petrov
Telerik team
 answered on 07 Mar 2013
5 answers
284 views
I inherited a project from someone that used telerik 2010 q1.  I purchased the 2011 q3 version to upgrade it as part of the work i'm doing for them.  I see that there are several old controls that aren't part of 2011 and there's a conversion wizard that will upgrade them.  It seems to only be in 2011 q2 though.  Where can i download this?  In my account downloads, i can only get 2011 q3.

Thanks.
Nikolay
Telerik team
 answered on 07 Mar 2013
1 answer
150 views
Here is an easy one that has me stumped and I'm sure it will be very simple.

I use a Property Grid to display all the information about a selected record. ( displayed in a rad grid)

As the user selects records in the grid , I populate the property grid by defining a new PropertyStore based on the record selected and then setting this as the SelectedObject. Works well and thanks to your great support, its also Multi Language as well.

The glitch I have is if a user  selects a property ,( Which displays  the Property Description text at the bottom) and then selects a new line, the process of loading a new PropertyStore does not clear the  Property Description text at the bottom. 

How can I clear the  Property Description text?

See easy.. :)

Thanks as always

Rob
 


Stefan
Telerik team
 answered on 07 Mar 2013
1 answer
160 views

The title says everything - I am deploying an application and there are two files that are being created upon setup and load event. I am encrypting the app.config connection string using MSDN code that I found. However, when I deploy and run the program it creates two folders in my AppData/2.0/ folder structure with two ApplicationName.exe.config files. One of them is encrypted as you would expect, the other is not. I am not sure what is going wrong or how to prevent the application from creating two app.config files but especially the one that is not encrypted. Thank you!
Jack
Telerik team
 answered on 06 Mar 2013
23 answers
612 views
In my sample grid, I would like to allow grouping by the user, but add a count(fieldname) aggreagate to the groupbyexpression.
I found examples for the ASP.NET Grid but could not directly apply these to the WinForms Grid.

regards
erwin
Julian Benkov
Telerik team
 answered on 06 Mar 2013
1 answer
156 views
I use the RadDock.LoadFromXml(file), it works fine for all visible tool and document windows for the exception of hidden tab document windows.

When I hide all tab document windows, save to xml then restart my app and load from xml, they remain hidden but if at least one tab document window is not hidden, none of them remain hidden, they are all docked tab document again.

Looking at the xml file, it shows the DesiredDockState="Hidden" correctly on all tab documents that should remain hidden.
Anton
Telerik team
 answered on 06 Mar 2013
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
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?