Telerik Forums
UI for WinForms Forum
19 answers
877 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
237 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
210 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
121 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
930 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
3 answers
129 views

Maybe I missed the docs for this, but how do we serialize a diagram? Thanks.

Serialization - RadDiagram supports serializing and deserializing diagramming objects into and from XML documents.

Dimitar
Telerik team
 answered on 13 Sep 2017
1 answer
73 views

hello. i am trying to learn export to excel from RadGridView.i am using codes from demo app.

i want to set page orientation.and if possible use HeaderFooterSettings too.

I have been searched and read many topics about that but still cant figure out how to use "Telerik.Windows.Documents.Model.PageOrientation.Landscape;" codes

i need an example for understand this.

also i did read Worksheet PageSetup documention page too.But still need to see that codes on an example.

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

I am binding a radgridview to a datatable the datatable contains a field ‘TankLevel’ that can have one of  5 values ‘1/4’, ‘half’, ¾’ , ‘Full’ or ‘Unknown’ I want to display this column as a GridViewComboBoxColumn and display the value from the underlying datatable and have  each of the 5 values available in the comboboxcolumn dropdown. When I bind to the datatable the combobox is populated with the data but combobox in each row has every row available in the dropdown! How can I make each row show the underlying record but irestrict the dropdown to the 5 values n order that the user can select from the other 4 values.

 

Dim cboCol As GridViewComboBoxColumn = New GridViewComboBoxColumn

                cboCol.Name = "cboCol"

                cboCol.HeaderText = "Fill Level"

                cboCol.DataSource = sVehDT

                cboCol.ValueMember = "TankLevel"

                cboCol.DisplayMember = "TankLevel"

                cboCol.FieldName = "TankLevel"

                Me.RadGridView1.Columns.Add(cboCol)

Dimitar
Telerik team
 answered on 13 Sep 2017
2 answers
132 views

I have a RadMaskedEdit box for phone number entry.

...
    Telerik.WinControls.UI.RadMaskedEditBox editPhone = new Telerik.WinControls.UI.RadMaskedEditBox();
...
    editPhone.Mask = "(000)000-0000";
    editPhone.MaskType = Telerik.WinControls.UI.MaskType.Standard;
    editPhone.Name = "editPhone";
    editPhone.Text = "(___)___-____";
    editPhone.TextMaskFormat = System.Windows.Forms.MaskFormat.IncludeLiterals;

 

I have defined a Customer class (simplified for this example)

public class Customer {
  public string CustomerName { get; set; }
  public string PhoneNumber { get; set; }
}

 

I bind the RadMaskedEditBox Value property to the PhoneNumber property of a Customer object.

  Customer editCustomer = new Customer();
...
  editPhone.DataBindings.Clear();
  editPhone.DataBindings.Add("Value", editCustomer, "PhoneNumber", false, DataSourceUpdateMode.OnPropertyChanged | DataSourceUpdateMode.OnValidation);

 

After this, when editing the phone number, using the "Del" or "Backspace" key will properly remove the character, but will move the caret to the first position of the text box.

If I remove the Data Binding, the "Del" and "Backspace" keys work as expected.  I don't have any event handling code for this control.  Currently we are using version 2016.3.913.40.

Is there a workaround, fix, or other change I can implement that will avoid the behavior as I've described?

 

Larry
Top achievements
Rank 1
 answered on 12 Sep 2017
2 answers
628 views

Hello,

I'm using Telerik version 2017 R2 for Winform app.

I have a gridview with "EnableHeaderCheckBox" option is "True".

When I group the gridview by a column A, then click on the checkbox on gridview header row (I meant "Select All" checkbox), please see the picture 1 below

[Picture 1] Click on Select All checkbox

[Picture 2] The result of click on Select All checkbox

As you can see in the result (Picture 2), the checkboxes of group header row is not checked automatically. When I click on the Select All checkbox, it just affects to the children checkboxes in each groups, not the checkboxes on group header row.

How can I check all the checkboxes on group header row when I click on the Select All checkbox?

Please give me an advice! Thanks so much!

Thanh
Top achievements
Rank 1
 answered on 12 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)
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?