Telerik Forums
UI for WinForms Forum
7 answers
238 views
I need to modify the style of the group header but can't seem to do it. I can modify the font, but it also seems to modify the font of the appointments as well.
Dim SchedElement As SchedulerDayViewGroupedByResourceElement = RadScheduler1.GetDayView.Scheduler.SchedulerElement.ViewElement
SchedElement.Font = New Font("Segoe UI", 10, FontStyle.Regular, GraphicsUnit.Point)
SchedElement.ForeColor = Color.White
SchedElement.ResourceHeaderHeight = 35
SchedElement.ResourcesHeader.BackColor = Color.FromArgb(0, 159, 60)
SchedElement.ResourcesHeader.BackColor2 = Color.FromArgb(0, 159, 60)
 
Anything that sets a "ResourceHeader" doesn't seem to do what I am expecting. The attached picture shows the header I am trying to modify as well as what RadControlSpy says about it.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Jun 2017
7 answers
900 views

I have a gridview with a gridviewcheckboxcolumn and an enabled headercheckbox as well.  I have Excel type filters enabled along with grouping.  What I want to do is get a running count of how many items are checked (say out of 1,000).

Currently I am using a loop to get the checked cells by iterating through the RadGrid.MasterTemplate.DataView.ItemCount and checking each row checkbox value.  This works ok, but where I have a problem is with the header check/uncheck all button.  When I check the header button it will trigger the CellValueChanged event every time a cell changes.  For 1,000 records this gets pretty slow.

So my questions are;

  1. Is there a CheckedCount method instead of iterating?  would have to work on Excel filtered grid
  2. Is there a way to 'wait' for the header toggle to finish so that the CellValueChanged could be set not to trigger until done?
  3. Is there a simpler, better way to get a count of Checked rows in a grid?
Private Sub grdSales_CellValueChanged(sender As Object, e As GridViewCellEventArgs) Handles grdSales.CellValueChanged
    'count checked rows, enable process, set label
    If e.ColumnIndex > 0 Then Return    'only want checked col [0]
    Dim iCnt As Integer = fCountCheckedRows()
    btnProcess.Enabled = iCnt > 0
    lblCheckedRecords.Text = CStr(lblCheckedRecords.Tag) & iCnt
End Sub
 
Private Function fCountCheckedRows() As Integer
    Dim iCount As Integer = 0
    For i = 0 To grdSales.MasterTemplate.DataView.ItemCount - 1
        If Not IsDBNull(grdSales.Rows(i).Cells(0).Value) Then
            If grdSales.Rows(i).Cells(0).Value = True Then iCount += 1
        End If
    Next
    Return iCount
End Function
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Jun 2017
2 answers
144 views

In VB.net please,

 

I need to open the default edit form for a an appointment in MyRadScheduler.Appointments, so I just need to simulate the double click on an appointment, but using only code.

Bassel
Top achievements
Rank 1
 answered on 14 Jun 2017
3 answers
561 views
Hello

Help me!

I have a RadSplitContainer, on RadSplitContainer located 5 splitPanels.
When the program starts user resizes on RadSplitContainer, splitPanels.

How can i save the settings, that are made by the user?
Dimitar
Telerik team
 answered on 14 Jun 2017
7 answers
1.2K+ views

I have an application with multiple PDF viewers and the user can switch between the viewers on demand.

When switching between viewers I do the following:

  • Reset the viewer by displaying a dummy document (so that the previous PDF is no longer visible and so that a template, etc. could be displayed as a placeholder if something goes wrong - previous developer's choice). This is done by calling LoadDocument() with the placeholder's physical file path
  • I then do a bunch of things and get the new desired content as a MemoryStream from the database and load it. This is done by calling LoadDocument() with the MemoryStream variable

When this happens, the content of the MemoryStream is not displayed, instead only the placeholder content is shown. It's as though the load of the MemoryStream was never loaded (but I have confirmed that line of code is always reached).

If I remove the placeholder code so that I'm only working with a MemoryStream then it works correctly.

Calling UnloadDocument() before loading from the MemoryStream has no effect.

What can be done to fix this?

Dimitar
Telerik team
 answered on 13 Jun 2017
1 answer
386 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
638 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
91 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
262 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
86 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
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
CheckedDropDownList
ProgressBar
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
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?