Telerik Forums
UI for WinForms Forum
1 answer
110 views
Hi,

I am going to explain what I want to achive and what I think is a option, but reaaly whould like to get your opinion.

I want to create a PDF file for every employee with there benefits with our company. The PDF will consist of about 10 pages and there will be Some static text (read from a data base) to print in differnt fonts and colours etc ( that I want to RichTextBox).

I then have a spesific page for every employees info from the payroll.

I also think I can create a report, but there is some things I dont know eg. how do I create differnt a PDF for every employee? and how will I get some RichTextBox text in my report.

Please help me  in the right direction.

regards
Stef
Telerik team
 answered on 17 Jul 2013
9 answers
517 views
Hello,

I've asked this before, and I'm still a bit confused how this all wires up. The confusion is mine, over what the Telerik RadPropertyGrid type checking is actually doing.

Let's say we've got a model that looks like this. These all would implement INotifyPropertyChanged and such, but for example, I'm leaving that off.

class Dog {
  public string Name{get;set;}
}
 
class Shelter {
  public Dog AdoptedDog{get;set;}
  public List<Dog> AvailableDogs{get;set;}
}

Further, I am adapting the model into the view (RadPropertyGrid DropDownList editors) through a view model something like this:

abstract class ModelView<T> {
public T Item{get;set;}
  public ModelView(T item) {
    Item = item;
  }
}
 
class DogModelView : ModelView<Dog> {
  public DogModelView(Dog dog)
    : base(dog) {}
}
 
class ShelterModelView : ModelView<Shelter> {
  public ShelterModelView(Shelter shelter)
    : base(shelter) {}
}

I need to be able to edit the AdoptedDog property from the Shelter (adapter through ShelterModelView) with a DropDownList that shows the AvailableDogs to choose from.

So we set the RadPropertyGrid SelectedObject to the ModelView instance:

//Shelter AvailableDogs might be populated with Dogs of course.
var shelter = new Shelter();
radpgShelter.SelectedObject = new ShelterModelView(shelter)

And when the editor is initialized:

//...
element.DataSource = shelter.AvailableDogs;
//Following which the SelectedValue is indeed selected.

Am I assuming correctly that the RadPropertyGrid type check wants to connect an item from the DataSource, in particular the SelectedValue, to agree in type with the ModelView property being edited?

So in this example, if we want to edit (select from a DropDownList) the AdoptedDog from a list of AvailableDogs, then we should be talking about Dog and Dog? Rather, not, say, Dog and string (Dog.Name)?

Thank you...

Regards,

Michael Powell
Ivan Petrov
Telerik team
 answered on 17 Jul 2013
9 answers
1.4K+ views
Hi,
Is there ways to make RadDropDownList text as "ReadOnly" in Run Time mode?
Richard Slade
Top achievements
Rank 2
 answered on 16 Jul 2013
1 answer
124 views
Hi Telerik support,
When i try to reorder elements in a treeview, everithink works fine, but the droped item allways goes to the bottom of the node, not to the correct place between other two elements .
I saw that this is the same behavior with your demo app in TreeView-->Populate With Data --> Self Reference  section , but need to know is it some way to acheeve correct reorder functionality when bind treeview with some external data.

EDIT: Additionally, SortDescriptors also doesn't work in this scenario.

Regards,
Martin
Dimitar
Telerik team
 answered on 16 Jul 2013
4 answers
510 views
Hi!

I'm using RadGridView and I need to let the grid ColumnChooser fixed as part of the layout, as it was a component I can attach to another. As I could see and searched, the ColumnChooser is a floating window that is at the top.
Searching, I found out that I probably would get to what I need adding handles to the Shown event of the ColumnChooser (since every time it's shown a new instance is created), and call a move function that I have to implement to set the position of the ColumnChooser. As well, I would have to call this function every time the form is moved or re-sized.
Is there any other way to do something like a fixed ColumnChooser instead doing it?

Thanks in Advance!
Stefan
Telerik team
 answered on 16 Jul 2013
5 answers
234 views
I use 2 DateTimePicker, one for FromDate and one for ToDate.

I like the idea of displaying null text ie: 'From Begining' and 'To End' but my problem is that for some reason whatever I set NullDate for the ToDate, it returns MinDate value.

How can I make it choose the MaxDate when using SetToNullValue. I tried many variations but alas.

PS.: I have one DatePicker on a UserControl and have 2 copies of the user control on a form and I added properties to the usercontrol to set date.value, MinDate, MaxDate, NullText, NullDate, SetToNullValue..
Stefan
Telerik team
 answered on 16 Jul 2013
1 answer
117 views
I have a Telerik Report in a WinForm that randomly fails to release the PDF it has created for viewing. The first time the report will view fine. Changing variables and clicking submit more often results in a 'The process cannot access the file 'C:\Temp...\..PDF' because it is being used by another process. Exiting the report form itself has no effect and the files remain locked until the main program is shut down.
Stef
Telerik team
 answered on 16 Jul 2013
1 answer
379 views
 
this is the demo snipped of code that you provide in winforms Q2 2013 demo for listview -> custom settings. The orientation works fine in the demo app but I have the same snipped of code as the demo app.  I've debugged this multiple times trying to figure out why the orientation is always vertical but there is no clear reason for it at the moment.  

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.QuickStart.WinControls;
 
namespace Telerik.Examples.WinControls.ListView.CustomItems
{
    public partial class Form1 : ListViewExamplesControl
    {
        public Form1()
        {
            InitializeComponent();
 
            this.radListView1.ItemSize = new Size(200, 300);
            this.radListView1.AllowArbitraryItemHeight = true;
            this.radListView1.ItemSpacing = 10;
            this.radListView1.EnableKineticScrolling = true;
 
            this.radListView1.ListViewElement.ViewElement.ViewElement.Margin = new Padding(0, 10, 0, 10);
            this.radListView1.ListViewElement.ViewElement.Orientation = Orientation.Horizontal;
        }
    }
}

This is my code, it is very simple right now because I am still working on the figuring out the functionality 
of RadListView.  I've hard coded the orientation multiple times and printed it out in MessageBox but each time
MessageBox prints out vertical, for each of the 12 items in the Imagelist.  I was hoping you could explain why this
happens all of the time and a way to fix this.  Thank you for your time in this matter.  

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
using System.IO;
using System.Linq;
using Telerik.WinControls.Layouts;
using Telerik.WinControls.UI;
 
namespace testingImageViewer
{
    public partial class RadForm1 : Telerik.WinControls.UI.RadForm
    {
        private int intImageHeight = 0;
        private int intImageWidth = 0;
        private string strFilePath = "";
        StackLayoutPanel stackLayout;
        LightVisualElement imageElement;
 
        Image myImage;
        public RadForm1()
        {
            InitializeComponent();
            radListview.ItemSize = new Size(200, 300);  
            radListview.AllowArbitraryItemHeight = true;
            radListview.EnableKineticScrolling = true;
            radListview.ListViewElement.ViewElement.Orientation = Orientation.Horizontal;
            MessageBox.Show(radListview.ListViewElement.ViewElement.Orientation.ToString());
        }
 
        public void fillImageList()
        {
            OpenFileDialog ofd = new OpenFileDialog();
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                myImage = Image.FromFile(ofd.FileName);
                strFilePath = ofd.FileName;
            }
            else
            {
                MessageBox.Show("open dialog didn't open");
            }
        }
 
        private void RadForm1_Load(object sender, EventArgs e)
        {
            fillImageList();
            imagelistPictures.Images.Add(myImage);            
            showImages();
        }
 
        private void showImages()
        {
            if (imagelistPictures.Images.Empty)
            {
                MessageBox.Show("list image preview is empty");
            }
            else
            {
                for (int i = 0; i < imagelistPictures.Images.Count; i++)
                {
                    if (imagelistPictures.Images[i] != null)
                    {
                        // radListview.Items.Add(listImagePreview.Images[i]);
                        //intImageWidth = listImagePreview.Images[i].Width;
                        //intImageHeight = listImagePreview.Images[i].Height;
                        // pictureBox1.Image = listImagePreview.Images[i];  // adds it to picture box, adjust height/width
 
 
                        // show the image
                        // radListview.Height = imagelistPictures.Images[i].Height;
                        // radListview.Width = imagelistPictures.Images[i].Width;
 
                        ListViewDataItem lvdi = new ListViewDataItem("Go Hokies");
                        lvdi.Image = imagelistPictures.Images[i];
                        lvdi.ImageAlignment = System.Drawing.ContentAlignment.MiddleCenter;
                        //lvdi.Size.
 
                        radListview.Items.Add(lvdi);
 
                        radListview.ListViewElement.ViewElement.Orientation = Orientation.Horizontal;
                        MessageBox.Show(radListview.ListViewElement.ViewElement.Orientation.ToString());
                    }
                    else
                    {
                        MessageBox.Show("contents of list are null, break");
                        break;
                    }
                }
            }
        }
 
 
 
    }
}

      
Stefan
Telerik team
 answered on 16 Jul 2013
2 answers
103 views
Hi,

I have a gridview that is hooked up to a web service, when you edit a cell and move to another cell it calls an update on the web service to update the DB, all works very well.

However, I can't seem to get this functionality working with the 'add new row' row. How do I know when a user has moved away from teh add new row row, so I can then construct an entity object to send to the web services Add method?

Thanks in advance
M
Matthew
Top achievements
Rank 1
 answered on 15 Jul 2013
1 answer
208 views

Hope the below button click methods can help someone in implementing records navigation (backward and forward) in RadGridView.

private void btnPrev_Click(object sender, EventArgs e)
        {
            if (gridview1.CurrentRow.Index > 0)
            {
                gridview1.ChildRows[gridview1.CurrentRow.Index - 1].IsCurrent = true;
            }
        }
        private void btnNext_Click(object sender, EventArgs e)
        {           
            if (gridview1.CurrentRow.Index < gridview1.ChildRows.Count - 1)
            {               
                gridview1.ChildRows[gridview1.CurrentRow.Index + 1].IsCurrent = true;            
                 
            }
        }

Stefan
Telerik team
 answered on 15 Jul 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?