Telerik Forums
UI for WinForms Forum
1 answer
394 views

How can I limit the length of characters user can enter on a particular gridview column?

I tried this code but I got an error saying that there is no definition for MaxLength?

 

void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)     
{     
    if (e.ColumnIndex == 1)  
    {  
        if (e.Column is GridViewTextBoxColumn)     
        {     
            ((RadTextBoxEditorElement)((RadTextBoxEditor)this.radGridView1.ActiveEditor).EditorElement).MaxLength = 30;     
        }     
    }  

Dimitar
Telerik team
 answered on 13 Jun 2017
29 answers
646 views

I am new to Telerik controls and am attempting setting up a Scheduler control on a windows form. I have followed the web based sample and am attempting to bind to your sql based sample data using as the ScheduleBindingDataSource data setting the settings as your sample

Does the datasource need to be initiated when the form loads as I am returning no records?

 

ResourceProvide

Allownew         True

Datamember      Appointments

DataSource         SchedulerDataDataSet

 

If I comment out the if statement in the data binding event and force a new instance of the SchedulerDataDataSet then the records are returned!

 

'If Me.SchedulerDataDataSet Is Nothing Then

            Me.SchedulerDataDataSet = New SchedulerDataDataSet()

 

            Dim appointmentsAdapter As New AppointmentsTableAdapter()

            appointmentsAdapter.Fill(Me.SchedulerDataDataSet.Appointments)

 

            Dim resourcesAdapter As New ResourcesTableAdapter()

            resourcesAdapter.Fill(Me.SchedulerDataDataSet.Resources)

 

            Dim appointmentsResourcesAdapter As New TransientAppointmentsResourcesTableAdapter()

            appointmentsResourcesAdapter.Fill(Me.SchedulerDataDataSet.TransientAppointmentsResources)

            ' End If

Alejandro
Top achievements
Rank 1
 answered on 12 Jun 2017
1 answer
97 views

Hello, Telerik!

For some reason I cannot find my previous thread.

Here is your answer for my previous question:

*****************

Hello Alexander, 

Thank you for writing.  

Due to the UI virtualization in RadGridView, cell elements are created only for currently visible cells and are being reused during operations like scrolling, filtering, grouping and so on. The CellFormatting event is fired only for the visible cells in the grid. That is why you obtain this unexpected behavior. Note that the CellFormatting event is purposed to customize the cells' style and it is not recommended to change the cell's value in this event. Changing the value of a cell will trigger an update of the current view and thus the CellFormatting event will be fired again. This may lead to any other unexpected behavior. I would recommend you to update the cells' values outside the CellFormatting event handler, e.g. in a RadButton.Click event. Thus, you can iterate the desired rows and for each row, you can change the value for the specific cell.

If it doesn't suit your scenario, it would be greatly appreciated if you can provide additional information about the exact goal that you are trying to achieve. Thus, we would be able to think about a suitable solution and assist you further. Thank you.

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess 
Progress Telerik

*************************

My further questions:

What other events during gridview load you can advise to compute values? RowFormatting will not work too?

If you recommend to compute after gridview load, can you tell me even and should I use Rows collection for iteration?

Hristo
Telerik team
 answered on 12 Jun 2017
2 answers
276 views

Greetings. We're considering to adopt your suite of components as a standard for our future applications.

At the moment, I'm trying to understand if your WinForms GridView component behavior suits our current workflow.

 

Consider the following class structure (Master -> each master has "n" Slaves -> each slave has "k" SubSlaves):

   public class MasterEntity

    {
        public Int32 Id { get; set; }
        public String Name { get; set; }

        public IList<SlaveEntity> Slaves { get; set; }
    }

    public class SlaveEntity
    {
        public Int32 Id { get; set; }
        public String PropA { get; set; }
        public Decimal PropB { get; set; }

        public IList<SubSlaveEntity> SubSlaves { get; set; }
    }

    public class SubSlaveEntity
    {
        public Int32 Id { get; set; }
        public String PropC { get; set; }
    }

I assign the dataSource of the grid to an IList<MasterEntity>: as you can see all the lists involved are generic ILists (not BindingLists) and each class doesn't implement the INotifyPropertyChanged interface.

Following the instructions in this page (http://docs.telerik.com/devtools/winforms/gridview/hierarchical-grid/binding-to-hierarchical-data-automatically), I'm able to display the rows in a proper hierarchical grid (through AutoGenerateHierarchy property). I'm also able to properly configure the layout of each column at each hierarchy level.

Now, what I want to achieve is the following:

When I add/delete/edit a row (at each hierarchy level, Master, Slave or SubSlave) I need the changes to be reflected in the grid, without it scrolling to the top or losing the column layout settings. Of course, since we're using normal Lists (not BindingLists) and the entities doesn't implement INotifyPropertyChanged, I know that the grid must be notified of each operation performed on its datasource. At the moment I've only managed to achieve this when I change a property of an entity at the first hierarchy level (Master):

1.(radGrid.Datasource as IList<MasterEntity>)[0].Name = "NEW NAME";
2.radGrid.TableElement.Update(GridUINotifyAction.DataChanged);

 

but I also need this to work when I do the following:

1.(radGrid.Datasource as IList<MasterEntity>).Add(new MasterEntity(){ .. });
2.-> how to notify the grid about the new master entity?
1.
 (radGrid.Datasource as IList<MasterEntity>)[0].Slaves[0].PropA = "NEW PROP A VALUE";
2.-> how to notify the grid about the change in a property value in that slave entity?
1.(radGrid.Datasource as IList<MasterEntity>)[0].Slaves.Add(new SlaveEntity(){ .. });
2.-> how to notify the grid about the new slave entity in the first master entity?

 

..and so on, I need to be able to perform ADD / DELETE / CHANGE ENTITY PROPERTIES at each hierarchy level and properly notify the grid about each operation, while keeping the current column layout (at each hierarchy level) and without the grid scrolling to the top.

Thanks for the kind help.

 

Carlo
Top achievements
Rank 1
 answered on 12 Jun 2017
1 answer
89 views

Hi

I used a rad shaped form in my app, and then removed the title bar. but still I'm able to move form (which is totally great; since I don't have to reproduce form movement by mouse events). then I add a label to top of the form to show the 'subject'. when user click and hold to mouse button to move the form, if the label is clicked, form won't move, but if other parts of form get clicked, form will move. my question is How I can set the label button mousedown event (or any other event) to be able to move the form?

Thanks

Dimitar
Telerik team
 answered on 12 Jun 2017
1 answer
588 views

Hi,

I need to make OCR recognition from a picture taken from a video camera (license plate) is there a tool in telerik winforms that can do OCR?

 

Thanks!

Dimitar
Telerik team
 answered on 12 Jun 2017
9 answers
231 views

Hi I'm Saeid. Programer in Iran.

Q:

How to Right To Left All Items in radMessageBox?

radMessagebox.Show("Text","Caption Message", MessageBoxIcon.Ok, radMessageIcon.Info, ::::::RightToLeft:::::);

saeid
Top achievements
Rank 1
 answered on 09 Jun 2017
11 answers
1.1K+ views
I'm trying to convert for DockingManager to RadDock.

As the user adds new dynamically created Tab pages to a base page, we create a DockingManager dynamically on the tab.  Into this Docking manger, the user then drags pre-defined UserDockPanels or UserDockForms onto them.  We create the dockpanel or dockform by modifying a standard Windows form, for example by :
 
Partial Class CustomerForm 
  Inherits Telerik.WinControls.Docking.UserDockForm 
.... 
or
Partial Class ProductsPanel 
    Inherits Telerik.WinControls.Docking.UserDockControl 
..... 
These we can then dynamically add to the DockingManager when the user selects the option from a menu.  But I can find no equivalent way of pre-defining the DockWindows or DockPanels which can then be dynamically added to  the RadDock.

My idea for a solutuon was to dynamically create a DockWindow or DockPanel, then add the pre-defined panels (now redefined as RadForms) into the  DockWindow or Dockpanel.   

Your code sample suggests I can create DockWindows with this code
            Dim docWindow As DockWindow = New DockWindow() 
 
gives the warning: 
The designer must create an instance of type 'Telerik.WinControls.UI.Docking.DockWindow' but it cannot because the type is declared as abstract. 
 

If I ignore the warning (which I don't want to do) , I can find no way of adding a standard windows or radform into the contents of this DockWindow.  Have I missed the plot entirely?  How do I (Can I?) add an existing form by code into a Docking Window or Docking Panel?  Or should I continue using the Docking Manager?

Hristo
Telerik team
 answered on 09 Jun 2017
2 answers
221 views

I have a grid with a checkbox column. If a user marks the checkbox and then clicks on the "Save" button, I'm pulling the value of the checkbox, but it returns FALSE. It seems like the row is not being committed even when I have left the grid. What is trick for this?

(see screenshot)

 

Gone2TheDogs
Top achievements
Rank 2
Iron
Veteran
 answered on 09 Jun 2017
2 answers
128 views

Hi All,

 

Good day!

I have a RadForm which shows 6 or more RadChart in it.

Now, I want to export these chart in to powerpoint. 

Can you help me out on how to achieve this? Is this possible?

 

Thanks.

Regards,

Meo

Wonder
Top achievements
Rank 1
 answered on 09 Jun 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
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
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
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
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?