Telerik Forums
UI for WinForms Forum
1 answer
434 views
This is using version 2013 Q1 and also 2013 Q1 SP1:

Dropping a new RadDropDownList on a form sets its size to 125, 20.

This is the auto generated code for the control in the designer code:

this.radDropDownList1.Location = new System.Drawing.Point(591, 28);
this.radDropDownList1.Name = "radDropDownList1";
this.radDropDownList1.Size = new System.Drawing.Size(125, 20);
this.radDropDownList1.TabIndex = 9;
this.radDropDownList1.Text = "radDropDownList1";

Setting the drop down's AutoCompleteMode to 'SuggestAppend' changes the size to 125, 22.

this.radDropDownList1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
this.radDropDownList1.Location = new System.Drawing.Point(591, 28);
this.radDropDownList1.Name = "radDropDownList1";
this.radDropDownList1.Size = new System.Drawing.Size(125, 22);
this.radDropDownList1.TabIndex = 9;
this.radDropDownList1.Text = "radDropDownList1";


The other controls on the form are all at a height of 20, specifically the RadTextbox that is right next to the drop down. This mismatched sizing looks poor.

How can I change the height of my dropdown back to 20. All my attempts at doing so are ignored and the height returns to 22, even when I try to change the size of the DropDownListElement and the RootElement.
Peter
Telerik team
 answered on 10 Apr 2013
2 answers
134 views
I have a nested split container control on a form.  I am able to place a RadDock control into a split container panel but I am not able to place a user control into the RadDock using the designer.  If I try to do this programmatically I get an error saying that only panel controls can be in a split container.

Can a split container panel contain a RadDock?

Thanks.
Mike
Julian Benkov
Telerik team
 answered on 10 Apr 2013
11 answers
126 views
I currently have a treeview bound to a binding list, and have AllowDragDrop and AllowDrop set to true.  However, none of the drag events are firing.  Is there something else I need to set?  The documentation does not seem to be updated for this version.  Thanks!
Jack
Telerik team
 answered on 10 Apr 2013
1 answer
388 views
How I can implement the nested grid in windows application using C#. Please let me know if there is any demo for this.

Thanks in Advance
Kuldeep Dwivedi
Anton
Telerik team
 answered on 10 Apr 2013
3 answers
360 views
Hi all, I have a little bit strange question :)  Is it possible to change filter icon of the column which is filtered ? 
Stefan
Telerik team
 answered on 09 Apr 2013
0 answers
119 views
Hello there,
I've been trying to make a grid as a Hierarchy Tabbed GridView (from Q3-2011-SP1 samples) that works with dynamic update on datasource, but I was unsuccessfull. On my grid's data-source I used a BindingSource binding to my object Employees (struct on memory), and simulated through a Timer (500ms) the parameter "FirstName" to be changed on my object. The value updated on my object was showed correctly on the grid cell, but I had a lot of problems with user events like re-ordering/resizing columns or rows.
I used a AutoResetEvent to prevent those conflicts, but my grid still firing two exceptions:
- When I try to re-order columns's headers by drag and drop and new data come at same time there's a failure on CellHeaderElement.ProcessDragDrop() method;
- When I try to use the columns header's Context Menu and new data comes the grid's method Refresh() closes the menu.
I tried  to use a VirtualMode grid like Performance Sample but that's not what I need, once my grid must implements filtering\ordering and a nice template with details view.
Here's my code (based on yours, differences are highlighted), I would really appreciate if you guys tell me how to implement a  Hierarchy Tabbed GridView without any user events conflicts or context menu closing:

namespace TabbedGridViewSemple
{
    public partial class Form1 : Form
    {
        RadChart chart = new RadChart();
        public PlenaDataSet dataSource = new PlenaDataSet();
        public OrderDataSet orderSource = new OrderDataSet();
        private int count = 0;
        public AutoResetEvent eventsSync = new AutoResetEvent(true);

      

        public Form1()
        {
            InitializeComponent();
        }

        #region Event handlers

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.radGridView1.BeginUpdate();


            //Fill Data Source objects:
            dataSource.Add(new Employee() { Address = "507 - Ave. E", BirthDate = new DateTime(1948, 12, 08), City = "Seattle", Country = "USA", EmployeeID = 1, FirstName = "Nancy", LastName = "Davolio", Title = "Sales Representative", Photo = new Bitmap(Properties.Resources.stock_logo) });
            dataSource.Add(new Employee() { Address = "908 - Capital", BirthDate = new DateTime(1952, 02,19), City = "Tacoma", Country = "USA", EmployeeID = 2, FirstName = "Andrew", LastName = "Fuller", Title = "Vice President", Photo = new Bitmap(Properties.Resources.stock_logo) });

            
            employeesBindingSource.DataMember = "Employees";
            employeesBindingSource.DataSource = dataSource;
            ordersBindingSource.DataMember = "Orders";
            ordersBindingSource.DataSource = orderSource;
            PrepareChartControl();
            LoadDetailsTable();
            LoadPerformanceTable();
            this.radGridView1.UseScrollbarsInHierarchy = true;
            this.radGridView1.ReadOnly = true;
            radGridView1.MasterTemplate.ChildViewTabsPosition = TabPositions.Bottom;
            this.radGridView1.EndUpdate();
        }

        void radGridView1_ChildViewExpanded(object sender, ChildViewExpandedEventArgs e)
        {
            eventsSync.Reset();

            e.ChildRow.ChildViewInfos[0].ChildRows[0].Height = 152;
            e.ChildRow.ChildViewInfos[2].ChildRows[0].Height = 152;
            e.ChildRow.Height = 224;
            eventsSync.Set();

        }

        void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            eventsSync.Reset();

            GridViewDataColumn column = e.CellElement.ColumnInfo as GridViewDataColumn;
            if (column != null && column.OwnerTemplate.Caption == "Details")
            {
                if (column.FieldName == "FirstName")
                {
                    e.CellElement.Text = "<html><b>Name:</b> " + e.CellElement.RowInfo.Cells["LastName"].Value + ", " +
                        e.CellElement.RowInfo.Cells["FirstName"].Value;
                }
                if (column.FieldName == "BirthDate")
                {
                    e.CellElement.Text = string.Format("<html><b>Birth Date:</b> {0:d}", e.CellElement.RowInfo.Cells["BirthDate"].Value);
                }
                if (column.FieldName == "Title")
                {
                    e.CellElement.Text = "<html><b>Title:</b> " + e.CellElement.RowInfo.Cells["Title"].Value;
                }
                if (column.FieldName == "Address")
                {
                    e.CellElement.Text = "<html><b>Address:</b> " + e.CellElement.RowInfo.Cells["Address"].Value;
                }
                if (e.CellElement is GridImageCellElement)
                {
                    ((GridImageCellElement)e.CellElement).ImageLayout = ImageLayout.Zoom;
                }
            }
            if (column != null && column.OwnerTemplate.Caption == "Performance")
            {
                if (e.CellElement.RowInfo.Tag == null)
                {
                    chart.Series.Clear();
                    chart.Series.Add(GetRowData((GridViewRowInfo)e.CellElement.RowInfo));
                    e.CellElement.RowInfo.Tag = chart.GetBitmap();
                }
                e.CellElement.Image = e.CellElement.RowInfo.Tag as Image;
                e.CellElement.DrawBorder = false;
                e.CellElement.DrawFill = false;
                e.CellElement.Text = "";
                e.CellElement.Padding = new Padding(10, 0, 0, 0);
            } 
            eventsSync.Set();

        }

        void radGridView1_CreateCell(object sender, GridViewCreateCellEventArgs e)
        {
            eventsSync.Reset();

            if (e.CellType == typeof(GridDetailViewCellElement))
            {
                e.CellElement = new CustomDetailViewCellElement(e.Column, e.Row);
            }
            eventsSync.Set();

        }

        #endregion

        void PrepareChartControl()
        {
            chart.Size = new Size(600, 150);
            chart.Chart.ChartTitle.Visible = false;
            chart.Legend.Visible = false;
            chart.Appearance.Border.Visible = false;
            chart.Appearance.FillStyle.MainColor = Color.White;
            chart.AutoLayout = true;
            chart.ChartTitle.Visible = false;
            chart.ChartTitle.TextBlock.Text = "";
            chart.PlotArea.Appearance.Border.Visible = false;
            chart.PlotArea.Appearance.FillStyle.FillType = FillType.Solid;
            chart.PlotArea.Appearance.FillStyle.MainColor = Color.Transparent;
            chart.PlotArea.Appearance.FillStyle.SecondColor = Color.Transparent;
            chart.PlotArea.YAxis.Appearance.CustomFormat = "C0";
            chart.PlotArea.YAxis.LabelStep = 2;
            chart.PlotArea.XAxis.Appearance.ValueFormat = ChartValueFormat.ShortDate;
            chart.PlotArea.XAxis.Appearance.CustomFormat = "dd/MM";
        }

        void LoadDetailsTable()
        {
            DataTable table = new DataTable("Details");
            table.Columns.Add("EmployeeID", typeof(int));
            table.Columns.Add("Photo", typeof(Bitmap));
            table.Columns.Add("FirstName", typeof(string));
            table.Columns.Add("LastName", typeof(string));
            table.Columns.Add("Title", typeof(string));
            table.Columns.Add("Address", typeof(string));
            table.Columns.Add("City", typeof(string));
            table.Columns.Add("BirthDate", typeof(DateTime));
            table.Columns.Add("Country", typeof(string));
            foreach (Employee row in dataSource.Employees)
            {
                table.Rows.Add(row.EmployeeID, row.Photo, row.FirstName,
                    row.LastName, row.Title, row.Address, row.City, row.BirthDate, row.Country);
            }

            GridViewTemplate template = new GridViewTemplate();
            template.Caption = "Details";
            template.DataSource = table;
            template.AllowRowResize = false;
            template.ShowColumnHeaders = false;
            template.Columns["Photo"].Width = 125;
            template.Columns["City"].Width = 70;
            template.Columns["Country"].Width = 70;
            template.Columns["FirstName"].DisableHTMLRendering = false;
            template.Columns["Title"].DisableHTMLRendering = false;
            template.Columns["BirthDate"].DisableHTMLRendering = false;
            template.Columns["Address"].Width = 200;
            template.Columns["Address"].DisableHTMLRendering = false;
            this.radGridView1.Templates.Insert(0, template);


            GridViewRelation relation = new GridViewRelation(this.radGridView1.MasterTemplate);
            relation.ChildTemplate = template;
            relation.ParentColumnNames.Add("EmployeeID");
            relation.ChildColumnNames.Add("EmployeeID");
            this.radGridView1.Relations.Add(relation);

            HtmlViewDefinition viewDef = new HtmlViewDefinition();
            viewDef.RowTemplate.Rows.Add(new RowDefinition());
            viewDef.RowTemplate.Rows.Add(new RowDefinition());
            viewDef.RowTemplate.Rows.Add(new RowDefinition());
            viewDef.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Photo", 0, 1, 3));
            viewDef.RowTemplate.Rows[0].Cells.Add(new CellDefinition("FirstName", 0, 1, 1));
            viewDef.RowTemplate.Rows[0].Cells.Add(new CellDefinition("BirthDate", 0, 2, 1));
            viewDef.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Title", 0, 3, 1));
            viewDef.RowTemplate.Rows[2].Cells.Add(new CellDefinition("Address", 0, 1, 1));
            viewDef.RowTemplate.Rows[2].Cells.Add(new CellDefinition("City", 0, 1, 1));
            viewDef.RowTemplate.Rows[2].Cells.Add(new CellDefinition("Country", 0, 1, 1));
            template.ViewDefinition = viewDef;
        }

        void LoadPerformanceTable()
        {
            Random r = new Random();
            DataTable chartTable = new DataTable();
            chartTable.Columns.Add("EmployeeID", typeof(int));
            for (int i = 0; i < 12; i++)
            {
                chartTable.Columns.Add("Month" + (i + 1), typeof(int));
            }
            foreach (Employee row in dataSource.Employees)
            {
                DataRow dataRow = chartTable.NewRow();
                dataRow["EmployeeID"] = row.EmployeeID;
                for (int i = 0; i < 12; i++)
                {
                    dataRow[i + 1] = r.Next(1000) * 10;
                }
                chartTable.Rows.Add(dataRow);
            }
            GridViewTemplate template2 = new GridViewTemplate();
            template2.Caption = "Performance";
            template2.DataSource = chartTable;
            template2.AllowRowResize = false;
            template2.ShowColumnHeaders = false;
            template2.ShowRowHeaderColumn = false;
            template2.Columns[0].Width = 600;
            for (int i = 1; i < template2.Columns.Count; i++)
            {
                template2.Columns[i].IsVisible = false;
            }
            this.radGridView1.Templates.Add(template2);

            GridViewRelation relation2 = new GridViewRelation(this.radGridView1.MasterTemplate);
            relation2.ChildTemplate = template2;
            relation2.ParentColumnNames.Add("EmployeeID");
            relation2.ChildColumnNames.Add("EmployeeID");
            this.radGridView1.Relations.Add(relation2);
        }

        Telerik.Charting.ChartSeries GetRowData(GridViewRowInfo row)
        {
            Telerik.Charting.ChartSeries series = new Telerik.Charting.ChartSeries();
            series.Type = ChartSeriesType.Bar;
            series.Name = "Sales";
            series.Appearance.LabelAppearance.Visible = false;
            for (int i = 0; i < 12; ++i)
            {
                series.Items.Add(new ChartSeriesItem((int)row.Cells[i + 1].Value));
            }
            return series;
        }

        protected string GetExampleDefaultTheme()
        {
            return "ControlDefault";
        }

        private void timerTick_Tick(object sender, EventArgs e)
        {
            try
            {
                eventsSync.WaitOne();
                dataSource.Employees[0].FirstName = "test " + count;
                count++;
                radGridView1.MasterTemplate.Refresh();
                eventsSync.Set();
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }

    }
}

Thanks a lot! 
Vinicius
Top achievements
Rank 1
 asked on 06 Apr 2013
1 answer
160 views

Hello,

when I load a dock layout from xml, one toolwindow is not visible.
If I drag out the ToolTabStrip and redock it or resize the ToolTabStrip, the ToolWindow "ZoomView" will be visible.
Where is the bug?

I used this http://www.telerik.com/help/winforms/dock-loading-and-saving-layouts-tutorial-saving-and-loading-layout-content.html example as startup.

<?xml version="1.0" encoding="utf-8"?>
<RadDock Orientation="Vertical" CausesValidation="False" TabIndex="0" TabStop="False">
  <Controls>
    <Telerik.WinControls.UI.RadSplitContainer IsCleanUpTarget="True" Orientation="Horizontal" SplitterWidth="4" CausesValidation="False" Location="5, 5" Name="" Size="200, 842" TabIndex="1" TabStop="False" Padding="5, 5, 5, 5">
      <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />
      <Controls>
        <Telerik.WinControls.UI.Docking.ToolTabStrip SelectedIndex="0" CanUpdateChildIndex="True" Size="200, 419" Location="0, 0" CausesValidation="False" Name="DockTabStrip1" TabIndex="1" TabStop="False">
          <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />
          <Controls>
            <Telerik.WinControls.UI.Docking.HostWindow PreviousDockState="Docked" Name="ItemsOverview" Size="198, 393" Location="1, 24" Text="Stapelansicht" />
          </Controls>
        </Telerik.WinControls.UI.Docking.ToolTabStrip>
        <Telerik.WinControls.UI.Docking.ToolTabStrip SelectedIndex="0" CanUpdateChildIndex="True" Size="200, 419" Location="0, 423" Name="DockTabStrip2" TabIndex="2" TabStop="False">
          <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />
          <Controls>
            <Telerik.WinControls.UI.Docking.HostWindow PreviousDockState="Docked" Name="ItemInfoView" Size="198, 369" Location="1, 24" Text="Informationen" />
            <Telerik.WinControls.UI.Docking.HostWindow PreviousDockState="Docked" Name="ZoomView" Size="198, 369" Location="1, 24" Text="Zonenansicht" />
          </Controls>
        </Telerik.WinControls.UI.Docking.ToolTabStrip>
      </Controls>
    </Telerik.WinControls.UI.RadSplitContainer>
    <Telerik.WinControls.UI.Docking.DocumentContainer IsMainDocumentContainer="True" Orientation="Vertical" Name="">
      <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" SizeMode="Fill" />
      <Controls>
        <Telerik.WinControls.UI.Docking.DocumentTabStrip SelectedIndex="0" CanUpdateChildIndex="True" Size="1706, 842" Location="0, 0" Name="DockTabStrip3" TabIndex="0" TabStop="False">
          <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />
          <Controls>
            <Telerik.WinControls.UI.Docking.HostWindow PreviousDockState="Docked" Name="PageView" Size="1694, 807" Location="6, 29" Text="Seitenansicht" />
          </Controls>
        </Telerik.WinControls.UI.Docking.DocumentTabStrip>
      </Controls>
    </Telerik.WinControls.UI.Docking.DocumentContainer>
  </Controls>
</RadDock>


Best Regards
Marco
Julian Benkov
Telerik team
 answered on 05 Apr 2013
3 answers
129 views
What event is fired for these actions as I need to capture them and do something when they fire
Thanks
Anton
Telerik team
 answered on 05 Apr 2013
1 answer
180 views
Hello,

I am using ThemeResolutionService to apply theme of entire application.
But there is a special area on certain form of my application and I want to use a custom theme for that special area (RadPanel).

But when I use a ThemeResolutionService, this approach overrides my custom theme for that RadPanel.
Is there any way to achieve this goal? 
Thanks.
Stefan
Telerik team
 answered on 05 Apr 2013
5 answers
192 views
Hello,

I have made a custom GridDataCellElement, following the custom cell documentation. I wish to change the color of the indicator when the value of my Cell is set (SetContentCore) but the theme (Office2010Silver) value are always here.

I think I miss something but what ?
Private Class ProcessProgressionColumn
            Inherits GridViewDataColumn
 
            Public Sub New(ByVal UniqueName As String, ByVal fieldName As String)
                MyBase.New(UniqueName, fieldName)
            End Sub
 
            Public Overrides Function GetCellType(row As Telerik.WinControls.UI.GridViewRowInfo) As System.Type
                If TypeOf row Is GridViewDataRowInfo Then
                    Return GetType(ProcessProgressionCellElement)
                End If
                Return MyBase.GetCellType(row)
            End Function
        End Class
 
        Private Class ProcessProgressionCellElement
            Inherits GridDataCellElement
 
            Public Sub New(ByVal column As GridViewColumn, ByVal row As GridRowElement)
                MyBase.New(column, row)
            End Sub
 
            Protected Overrides ReadOnly Property ThemeEffectiveType As System.Type
                Get
                    Return GetType(GridDataCellElement)
                End Get
            End Property
 
            Public Overrides Function IsCompatible(data As Telerik.WinControls.UI.GridViewColumn, context As Object) As Boolean
                Return TypeOf data Is ProcessProgressionColumn AndAlso TypeOf context Is GridDataRowElement
            End Function
 
            Private StateProgress As RadProgressBarElement
 
            Protected Overrides Sub CreateChildElements()
                MyBase.CreateChildElements()
 
                StateProgress = New RadProgressBarElement() With {.Maximum = 4}
                Me.Children.Add(StateProgress)
            End Sub
 
            Protected Overrides Sub SetContentCore(ByVal value As Object)
                If value IsNot Nothing AndAlso value IsNot DBNull.Value Then
                    Me.StateProgress.Value1 = If(value > 0, value, 0)
                    Me.StateProgress.Value2 = If(value < 0, Me.StateProgress.Maximum, 0)
                    Me.StateProgress.Text = helper.GetDescription(CType(value, Process_Prospection.StatuProspection))
                    Me.StateProgress.IndicatorElement1.BackColor = If(value <> 4, Color.FromArgb(153, 238, 158), Color.FromArgb(153, 225, 238))
                    Me.StateProgress.IndicatorElement1.BackColor2 = If(value <> 4, Color.FromArgb(8, 208, 4), Color.FromArgb(4, 187, 208))
                    Me.StateProgress.IndicatorElement1.BackColor3 = If(value <> 4, Color.FromArgb(4, 208, 51), Color.FromArgb(4, 159, 208))
                    Me.StateProgress.IndicatorElement1.BackColor4 = If(value <> 4, Color.FromArgb(160, 238, 153), Color.FromArgb(153, 219, 238))
                End If
            End Sub
        End Class
Ivan Petrov
Telerik team
 answered on 05 Apr 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)
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
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?