Telerik Forums
UI for WinForms Forum
1 answer
219 views
If I subclass RadButtonElement, the subclass no longer has the same style applied as a pure RadButtonElement.  Here's the simple code snippet:

            ... 
            panel.Children.Add(new RadButtonElement() { Text = "RadButtonElement" }); 
            panel.Children.Add(new MyRadButtonElement() { Text = "MyRadButtonElement" }); 
        } 
 
        class MyRadButtonElement : RadButtonElement 
        { 
        } 
 
 

Can you tell me how to make my RadButtonElement have the same default style (e.g. background color, mouse rollover) as a regular RadButtonElement?

Thanks,
Michael Hewitt
Precision Software Design, LLC

For reference, here is the full body of my Form.OnLoad function:

        void Form1_Load(object sender, EventArgs e) 
        { 
            // Create element container to fill form 
            RadPanel elementsContainer = new RadPanel(); 
            this.Controls.Add(elementsContainer); 
            elementsContainer.Dock = DockStyle.Fill; 
            elementsContainer.BeginInit(); 
            elementsContainer.EndInit(); 
 
            // Create scroll viewer for scrollbar support 
            RadScrollViewer scrollViewer = new RadScrollViewer(); 
            elementsContainer.PanelElement.Children.Add(scrollViewer); 
 
            // Create panel to stack buttons 
            StackLayoutPanel panel = new StackLayoutPanel(); 
            scrollViewer.Viewport = panel; 
            panel.Orientation = Orientation.Vertical; 
            panel.Children.Add(new RadButtonElement() { Text = "RadButtonElement" }); 
            panel.Children.Add(new MyRadButtonElement() { Text = "MyRadButtonElement" }); 
        } 
 
        class MyRadButtonElement : RadButtonElement 
        { 
        } 
 
 

Nikolay
Telerik team
 answered on 10 Apr 2009
1 answer
290 views
Hi again!

Today I was looking for an Solution to update, insert and delete rows in a grid without a Dataadapter.
I found a few threads, but in the most you told us to wait for the next Version of RadGrid an new Handling of events. (My actual version is Q1 2009)

I need a solution where I can user my own statements and parameters in a Radgrid.
I fill the grid with:
RadGridView1.MasterGridViewTemplate.LoadFrom(reader) 

I was logging the RowsChanging and RowsChanged events, but cannot find the right solution for my problem
For example: When I add a new row, the rowChanging event fires with e.action = Telerik.WinControls.Data.NotifyCollectionChangedAction.Add but then no Changing events with Telerik.WinControls.Data.NotifyCollectionChangedAction.ItemChanged is fired for this row

Then I tried to use the CellEndEdit- Event but cannot find a way to know that I'm in a new Row and so on...

Pleas help.

regards
Willi

Nikolay
Telerik team
 answered on 10 Apr 2009
1 answer
177 views
Hello,

Okay I've got a gridview that has 2 levels: parent, child. 
Now in both levels I've got a checkbox column.
So I want to check/uncheck all checkboxes in the child level when I clicked on the parent his checkbox.

I got it working I thought but I'm getting some strange behavior. I think I know why, but I have no idea for the moment how to solve it.

okay my code snippet:

private void rgvAdserverNetwork_ValueChanged(object sender, EventArgs e) 
    var cell = sender as GridDataCellElement; 
    if (cell == null || ((GridViewDataColumn)cell.ColumnInfo).FieldName != "Add"return
     
    var viewTemp = cell.ViewTemplate; 
    var tempRow = cell.RowElement; 
    var rowinfo = tempRow.RowInfo; 
     
    if (!(bool)cell.Value) 
    { 
        //loop the child items to set the checkbox to true 
        loopChilds(rowinfo);   
        rowinfo.Cells["Add"].Value = true//set the checkbox of the parent to true 
    } 
 
//loop the child items of the given master row 
private void loopChilds(GridViewRowInfo masterrow) 
    var childRows = masterrow.ViewTemplate.ChildGridViewTemplates[0].GetChildRows(masterrow); 
    if (childRows == nullreturn
    var length = childRows.Length; 
 
    var expandedState = masterrow.IsExpanded; 
    masterrow.IsExpanded = true
 
    for (var i = 0; i < length; i++) 
    { 
        childRows[i].Cells["Add"].Value = true//set the checkbox of the parent to true 
    } 
    masterrow.IsExpanded = expandedState; 

Maybe there is a better way to achieve this.

Thanks a lot in advanced.

Jack
Telerik team
 answered on 10 Apr 2009
1 answer
195 views
The default padding on the default theme for the child grid on a heirarchical grid has a padding box that is quite wide. I'd like to to set it to 0, but the child is created at runtime. How do I access this property?
gerbrand
Top achievements
Rank 2
 answered on 10 Apr 2009
2 answers
231 views
Hi all,

   I tried installing RadControl for WinForms Latest Version: 2009.1 311 (Mar 11, 2009) .  My OS is WinXP SP2, and Visual Studio 2008 Pro Version 9.0.21022.8 RTM, .Net 3.5 SP1.  I remember I had a problem with installing RadControl for ASP.net, and was able to install the tools into the toolbox manually.  My skill level: know just enough to break something. 

How do install RadControls for Winform manually, here is a copy of the installer log below.

Thanks,
David

Starting ToolBox install procedure.
Exception: The language specified is not supported by any of the installed packages.
Stack:
    at EnvDTE80.Solution2.GetProjectTemplate(String TemplateName, String Language)
   at ToolBoxInstaller.Init(String dteTypeString)
   at ToolBoxInstaller..ctor(String currentVersion)
   at ToolBoxInstaller.Main(String[] arguments)
Loaded Assemblies

 mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

 ToolBoxInstaller, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
  file:///C:/WINDOWS/Installer/MSIDB.tmp

 EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  file:///C:/WINDOWS/assembly/GAC/EnvDTE/8.0.0.0__b03f5f7f11d50a3a/EnvDTE.dll

 System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

 System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
  file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

 EnvDTE80, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
  file:///C:/WINDOWS/assembly/GAC/EnvDTE80/8.0.0.0__b03f5f7f11d50a3a/EnvDTE80.dll

David
Top achievements
Rank 1
 answered on 10 Apr 2009
2 answers
419 views
is it possible to edit this to allow us to add our own menu items?

also is there an event fired when rightclick happens? i need to check some values outside the sched before allowing access to right click menu

basically i was hoping to use this control to allow admin users to create date range events for a holiday booking website (basically assigning rates & availabilities) where they select the number of days they want. you then right click to get menu to allow you to opens my own popup screen where the user enters the the rates and availability for that date range and then saves. when the form closes then the scheduler will refresh/update with these details

am i asking too much of the control?

Cheers.
Craig
Jordan
Telerik team
 answered on 10 Apr 2009
5 answers
305 views
I am trying to hide row headers by setting ShowColumnHeaders property to false, and it worked, but a thin line remind. Why??
I am hiding all things ShowFilteringRow , ShowGroupedColumn , AllowGrouping ,........ even I hide all cell borders with e.CellElement.DrawBorder and grid borders with GridElement.BorderWidth .
In fact my grid show just Data and thin line at the top of them. How can hide this line?
Nick
Telerik team
 answered on 08 Apr 2009
2 answers
188 views
Hi,

I'm trying to display a 3 level hierarchy into the gridview. I have no problem when I have a 2 level hierarchy. With the 3 level hierarchy I only get the first 2 levels. Now I guess I'm doing something wrong in the relations. But I can't seem to find the mistake or is it something else?

My code:

//add columns and relations 
rgvAdserver.MasterGridViewTemplate.Columns.Add(new GridViewDataColumn { FieldName = "SiteId", HeaderText = "Site Id", HeaderTextAlignment = ContentAlignment.MiddleCenter }); 
rgvAdserver.MasterGridViewTemplate.Columns.Add(new GridViewDataColumn { FieldName = "SiteName", HeaderText = "Site Name", HeaderTextAlignment = ContentAlignment.MiddleCenter }); 
 
var template = new GridViewTemplate { AllowAddNewRow = false, AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill }; 
template.Columns.Add(new GridViewTextBoxColumn { FieldName = "SiteId", IsVisible = false }); 
template.Columns.Add(new GridViewTextBoxColumn { FieldName = "ZoneId", HeaderText = "Zone Id", HeaderTextAlignment = ContentAlignment.MiddleCenter }); 
template.Columns.Add(new GridViewTextBoxColumn { FieldName = "ZoneName", HeaderText = "Zone Name", HeaderTextAlignment = ContentAlignment.MiddleCenter }); 
 
var templateAdslot = new GridViewTemplate { AllowAddNewRow = false, AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill }; 
templateAdslot.Columns.Add(new GridViewDataColumn{FieldName = "ZoneId", IsVisible = false }); 
templateAdslot.Columns.Add(new GridViewDataColumn{FieldName = "Adslot", HeaderText = "Adslot size", HeaderTextAlignment = ContentAlignment.MiddleCenter }); 
 
//add rows template 
rgvAdserver.MasterGridViewTemplate.ChildGridViewTemplates.Add(template); 
rgvAdserver.MasterGridViewTemplate.ChildGridViewTemplates.Add(templateAdslot); 
 
//create relation between both 
var relation = new GridViewRelation(rgvAdserver.MasterGridViewTemplate) 
                   { 
                       ChildTemplate = template, 
                       RelationName = "SiteZonesNetwork" 
                   }; 
 
relation.ParentColumnNames.Add("SiteId"); 
relation.ChildColumnNames.Add("SiteId"); 
rgvAdserver.Relations.Add(relation); 
 
var relation2 = new GridViewRelation(template) 
               { 
                   ChildTemplate = templateAdslot, 
                   RelationName = "zoneAdslot" 
               }; 
relation2.ParentColumnNames.Add("ZoneId"); 
relation2.ChildColumnNames.Add("ZoneId"); 
rgvAdserver.Relations.Add(relation2); 
 
//add data 
rgvAdserver.MasterGridViewTemplate.Rows.Clear(); 
 
GridViewTemplate template = null
GridViewTemplate templateAdslot = null
 
foreach(var data in gridData) 
 
    rgvAdserver.MasterGridViewTemplate.Rows.Add(new object[] { data.siteid, data.sitename }); 
     
    template = rgvAdserver.MasterGridViewTemplate.ChildGridViewTemplates[0]; 
    templateAdslot = rgvAdserver.MasterGridViewTemplate.ChildGridViewTemplates[1]; 
    template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; 
    templateAdslot.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill; 
     
    foreach(var zone in data.dartzones) 
    { 
        template.Rows.Add(new object[] { data.siteid, zone.zoneid, zone.zonename }); 
 
        foreach(var adslot in zone.adslots) 
        { 
            templateAdslot.Rows.Add(new object[] { zone.zoneid, adslot.adslotsize }); 
        } 
    } 
 
 
 
 

Thanks in advanced.


gerbrand
Top achievements
Rank 2
 answered on 08 Apr 2009
3 answers
225 views
on the scheduler, is this possible ? 

Thanks,
Derek.
Derek
Top achievements
Rank 1
 answered on 08 Apr 2009
3 answers
192 views
I have been trying to install the Q1 2009 templates for the windows form controls.  I have followed exactly what the KB article says at http://www.telerik.com/support/kb/winforms/general/installing-telerik-templates-in-visual-studio-2008.aspx, but the templates are not showing when I try
to do a new project. Can anyone shed some light on here as to what I may be missing?

Also, all of this started because I wanted to use the RibbonForm as my starting form. But the problem there is that the default Application.Run won't work
because RibbonForm does not inherit from Windows.Form. So, can someone tell me how to execute and start my applicaiton without this inheritance?

Thanks in advance,
LK
John
Top achievements
Rank 1
 answered on 07 Apr 2009
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
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?