Telerik Forums
UI for WinForms Forum
1 answer
224 views

ExportToExcelML exporter = new ExportToExcelML(radgridview);
                exporter.ExportVisualSettings = true;
                string filePath = "c:\test";
                string filename = "myfilename" + ".xls";
                exporter.RunExport(filePath + "\\" + filename);

 

using the above snippet how to insert a custom HEADER rows in Excel 

 

 

Hristo
Telerik team
 answered on 14 Sep 2017
7 answers
291 views

Hi,

 

I would like to change the color of the Axis line, but when I set the BorderColor, I get a border around the label that matches the color I am setting for the Axis line.  I don't want a border around the label, I just want to change the color of the line.  How do I do that?  

This is the code: linearAxis1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(52)))), ((int)(((byte)(143)))), ((int)(((byte)(142)))));

Laura

Dimitar
Telerik team
 answered on 14 Sep 2017
12 answers
437 views

Hello,

I have created RadPivotControl dynamically and added it to a windows form. when i double click on data i cannot see the underlying data.

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

// Added by User
using Telerik.WinControls.UI;
using Telerik.Pivot.Core;
using System.Data;
using System.Windows.Forms;

namespace BusinessLogic
{
    public class RadControl
    {


        public RadPivotGrid fn_CreatePivotControl(DataTable inDt)
        {
            RadPivotGrid pivotGrid = new RadPivotGrid();
            pivotGrid.DataSource = inDt;


            pivotGrid.Name = "pivotFilteredData";
            pivotGrid.ThemeName = "EvalFormTheme";


            pivotGrid.ShowFilterArea = true;
            GroupNameComparer groupNameComparer = new GroupNameComparer();
            foreach (DataColumn col in inDt.Columns)
            {


                List<string> list = new List<string>();
                if (col.ColumnName.ToString().ToUpper() != "PV")
                {
                    list = inDt.AsEnumerable().Select(p => p.Field<String>(col.ColumnName.ToString())).Distinct().ToList();
                }

                string strColumnName = col.ColumnName;

                if (list.Count == 1)
                {
                    PropertyFilterDescription propertyFilterDescription1 = new PropertyFilterDescription();
                    propertyFilterDescription1.Condition = null;
                    propertyFilterDescription1.CustomName = null;
                    propertyFilterDescription1.PropertyName = strColumnName;
                    pivotGrid.FilterDescriptions.Add(propertyFilterDescription1);

                }
                else if (strColumnName.ToUpper() == "PV")
                {
                    PropertyAggregateDescription propertyAggregateDescription1 = new PropertyAggregateDescription();
                    SumAggregateFunction sumAggregateFunction1 = new SumAggregateFunction();
                    propertyAggregateDescription1.AggregateFunction = sumAggregateFunction1;
                    propertyAggregateDescription1.CustomName = null;
                    propertyAggregateDescription1.IgnoreNullValues = false;
                    propertyAggregateDescription1.PropertyName = strColumnName;
                    propertyAggregateDescription1.StringFormat = null;
                    propertyAggregateDescription1.StringFormatSelector = null;
                    propertyAggregateDescription1.TotalFormat = null;
                    pivotGrid.AggregateDescriptions.Add(propertyAggregateDescription1);

                }
                else if (strColumnName.ToUpper() == "PERIOD" || strColumnName.ToUpper() == "TIMESLICE")
                {
                    PropertyGroupDescription propertyGroupDescription = new PropertyGroupDescription();
                    propertyGroupDescription.CustomName = null;
                    // propertyGroupDescription.GroupComparer = groupNameComparer;
                    propertyGroupDescription.GroupFilter = null;
                    propertyGroupDescription.PropertyName = strColumnName;
                    propertyGroupDescription.ShowGroupsWithNoData = false;
                    propertyGroupDescription.SortOrder = Telerik.Pivot.Core.SortOrder.Ascending;
                    pivotGrid.ColumnGroupDescriptions.Add(propertyGroupDescription);
                }
                else if (strColumnName.ToUpper() == "SCENARIO")
                {
                    PropertyFilterDescription propertyFilterDescription1 = new PropertyFilterDescription();
                    propertyFilterDescription1.Condition = null;
                    propertyFilterDescription1.CustomName = null;
                    propertyFilterDescription1.PropertyName = strColumnName;
                    pivotGrid.FilterDescriptions.Add(propertyFilterDescription1);
                }
                else
                {
                    PropertyGroupDescription propertyGroupDescription = new PropertyGroupDescription();
                    propertyGroupDescription.CustomName = null;
                    propertyGroupDescription.GroupFilter = null;
                    propertyGroupDescription.PropertyName = strColumnName;
                    propertyGroupDescription.ShowGroupsWithNoData = false;
                    propertyGroupDescription.SortOrder = Telerik.Pivot.Core.SortOrder.Ascending;
                    pivotGrid.RowGroupDescriptions.Add(propertyGroupDescription);
                }
            }

            pivotGrid.ColumnGrandTotalsPosition = Telerik.WinControls.UI.TotalsPos.None;
            pivotGrid.ColumnsSubTotalsPosition = Telerik.WinControls.UI.TotalsPos.None;
            // row total
            pivotGrid.RowGrandTotalsPosition = Telerik.WinControls.UI.TotalsPos.None;
            pivotGrid.RowsSubTotalsPosition = Telerik.WinControls.UI.TotalsPos.None;


            foreach (PropertyGroupDescriptionBase groupDescription in pivotGrid.RowGroupDescriptions)
            {
                DistinctValuesProvider valuesProvider = ((IDistinctValuesDescription)groupDescription).GetDisctinctValuesProvider();
                List<object> distinctItems = new List<object>(valuesProvider.DisctinctValues);
            }

            pivotGrid.MouseDoubleClick += pivotGrid_MouseDoubleClick;
            return pivotGrid;
        }

        private void pivotGrid_MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                RadPivotGrid pivotGrid = (RadPivotGrid)sender;
                PivotCellElement cell = pivotGrid.ElementTree.GetElementAtPoint(e.Location) as PivotCellElement;
                if (cell != null)
                {
                    IGroup row = cell.Row.Group; IGroup column = cell.Column.Group;
                    LocalDataSourceProvider localProvider = pivotGrid.DataProvider as LocalDataSourceProvider;
                    localProvider.GetUnderlyingData(row, column);
                }
            }
        }
    }
}

Hristo
Telerik team
 answered on 14 Sep 2017
1 answer
131 views

I have an issue with the DateTimePicker.
I'm using this control mainly for keyboard entry.
I live in The Netherlands and our date format is "dd-mm-yyyy".

The issue is as follows: 
If the current month has less than 31 days (like this month september for example), we are not able to enter a date that starts with 31 (like 31-08-2017).
This happens because as soon as I start typing, todays date appears in the editor. This means the day is validated as a day in the month september.
We would have to change the month first, than move back to the day portion and correct it. But, as you would admit, this is unnecessary cumbersome.

Is it possible to not have a default date appear as soon as the user starts typing?
If not, is it possible to have a default date like 01-01-2017 when the user starts typing?

Tnx for your help

Hristo
Telerik team
 answered on 13 Sep 2017
1 answer
129 views

I am extremely busy developing a WinForms application and do not have the time to learn how to use the theme builder. Telerik has some themes that I really like but I want to make some small modifications to them and also create one new theme based on Telerik's new material theme.

If someone has experience creating themes who could help me, I will compensate you for your time.

 

Thanks,
Mike

Email: mike-moreno@outlook.com

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Sep 2017
19 answers
1.0K+ views
Hi,

I have the following:

A Grid View populated by DataSet_A (Columns are Username, Exec_Code, Exec_Name)
Within the Grid View a Combo box column which is populated by DataSet_B (Exec_Code, Exec_Name)  Exec_Code would be a ValueMember and Exec_name would be the DisplayMember

However, the value displayed in the Combo box should be the same value as the Exec_Name from DataSet_A.  When the combo box value is changed the Exec_Code value & Exec_Name value in DataSet_A should be updated.

How can I do this?

Thanks

Barry
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Sep 2017
17 answers
318 views

Hi ,

I am creating the custom checkbox column like this:

public class CustomCheckbox: GridDataCellElement
{

      private RadCheckBoxElement ckbCustom;

      protected override void CreateChildElements()
        {
            base.CreateChildElements();
            ckbCustom = new RadCheckBoxElement();
            ckbCustom.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            ckbCustom.Size = new Size(20, 20);
            this.Children.Add(ckbCustom);            
        }}

 public class CheckboxColumn: GridViewDataColumn
    {
        public CheckboxColumn(string fieldName)
            : base(fieldName)
        {

        }

        public override Type GetCellType(GridViewRowInfo row)
        {
            if (row is GridViewDataRowInfo)
            {
                return typeof(CustomCheckbox);
            }
            return base.GetCellType(row);
        }        
    }

In gridview , i add 2 checkbox columns:

                CheckboxColumn checkboxcol1= new CheckboxColumn("High");
                checkboxcol1.HeaderText = "High";
                checkboxcol1.Width = 100;

                checkboxcol1.checkboxcontrol.text =  "Text 1 " // I want to config here
                // Add Labor Time Custom column
                CheckboxColumn checkboxcol2 = new CheckboxColumn("Custom");
                checkboxcol2.HeaderText = "Custom";

                checkboxcol2.checkboxcontrol.text =  "Text 2 " // I want to config here
                checkboxcol2.Width = 150;

                this.gvUser.Columns.Add(checkboxcol1);
                this.gvUser.Columns.Add(checkboxcol2);

How can i config text for checkbox at the time i add in the gridcolumn. Now I have to loop all of the grid rows to add text for checkbox.

 

Thanks.

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Sep 2017
3 answers
266 views

Hi,

I would like to be able to create a custom pin with a Usercontrol on it. Is this possible and in addition could you suggest a way to do it? How should the control be hosted?

class MyCustomPin : MapVisualElement
{

}

Regards,

Thomas

Hristo
Telerik team
 answered on 13 Sep 2017
3 answers
183 views

Is it possible to have a Toolbox in a RadDock tool window, and (obviously) be useable with a RadDiagram? How would I do this? I tried several things with limited results.

Thanks.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Sep 2017
4 answers
1.0K+ views

Hi.

I'm using 2017 R2. 

want to open new form, when cell double click. but I need to cell NOT on read only.

In other word, I'm need a RadGridView, with a cell edit mode, and double click event to open a new form.

im using snipped code, but this code have a problem, when user click on cell, event counter +1 , and after 2 or 3 One click on cell, and after double click on a cell, event void HostedControl_DoubleClick run for event count. 

 

01.private void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
02.        {
03.            RadTextBoxEditor editor = e.ActiveEditor as RadTextBoxEditor;
04.            RadTextBoxEditorElement element = editor.EditorElement as RadTextBoxEditorElement;
05.            if (e.ColumnIndex == 0 || e.ColumnIndex == 1)
06.            {
07.                if (editor != null)
08.                {
09.                    element.TextBoxItem.HostedControl.DoubleClick += new EventHandler(HostedControl_DoubleClick);
10.                }
11.            }
12.        }
13. 
14.        void HostedControl_DoubleClick(object sender, EventArgs e)
15.        {
16.            if (new FrmGheteDir().ShowDialog() == DialogResult.OK)
17.            {
18.                _gheteId = FrmGheteDir.Gheteid;
19.                var ghete = (from u in _db.GheteStore where u.GheteId == _gheteId select u).First();
20.                radGridView1.CurrentRow.Cells[0].Value = ghete.GheteId;
21.                radGridView1.CurrentRow.Cells[1].Value = ghete.GheteList.Name;
22.                radGridView1.CurrentRow.Cells[3].Value = ghete.LastPriceIn;
23.             
24.            }
25.        }
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 13 Sep 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
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
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?