Telerik Forums
UI for WinForms Forum
2 answers
33 views

need programing created structure table and see for winForm.

user need insert any info and saving

Problem for  one column have any typeof.

need used control or what ?

 

--------------------------------------------------------------

DataTable myDataTable = DataSet_PersonData.Tables.Add("PersonalData");            

myDataTable.Columns.Add("id", typeof(string));            

myDataTable.Columns.Add("row", typeof(string));

 

myDataTable.Rows.Add(new object[] { "Name" });      

myDataTable.Rows.Add(new object[] { "Surname" });    

myDataTable.Rows.Add(new object[] { "tel" });            

myDataTable.Rows.Add(new object[] { "date" });          

radGridView2PersonData.DataSource = DataSet_PersonData.Tables["PersonalData"];    

------------------------------------------------------------------------

and exit this:

-------------------------------
column1  | column2     |
-------------------------------
Name       | *String        |
Surname  | *String        |
telephone | *int              |
Date          | *DataTime |
-------------------------------

cell marked * - insert info user for winform.

need in cell  "*DataTime" open radCalendar or set fo ONLY cell [Column2][row'*DataTime'] set typeof(DateTime)

please help changet typeof for ONLY this cell in this table

RIchard
Top achievements
Rank 1
 answered on 18 Aug 2016
1 answer
412 views

When radGridView's data is grouped by a column and the column's HeaderText is empty string then a colon sign (:) is shown on the groups of rows in grid. How can I hide this colon sign? For more details see the attached image please.

Here is shortened code:

1.grid.Columns["Code"].HeaderText = "";
2.grid.GroupDescriptors.Add(new Telerik.WinControls.Data.GroupDescriptor("Code"));

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Aug 2016
22 answers
632 views
If anyone need it, just use the code and drag and drop :) (Based on example code)

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Telerik.WinControls;
using Telerik.WinControls.UI;
using System.Drawing;
 
namespace Project
{
    public partial class RadDataGridViewDragDrop : RadGridView
    {
        public RadDataGridViewDragDrop()
        {
            InitializeComponent();
            SubscribeForGridEvents();
            this.ReadOnly = true;
            this.MultiSelect = true;
            this.MasterTemplate.AllowRowReorder = true;
            this.GridBehavior = new RadGridViewDragDropBehavior();
        }
 
        private void SubscribeForGridEvents()
        {
            RadDragDropService dragDropService = this.GridViewElement.GetService<RadDragDropService>();
            dragDropService.PreviewDragOver += new EventHandler<RadDragOverEventArgs>(dragDropService_PreviewDragOver);
            dragDropService.PreviewDragDrop += new EventHandler<RadDropEventArgs>(dragDropService_PreviewDragDrop);
            dragDropService.PreviewDragHint += new EventHandler<PreviewDragHintEventArgs>(dragDropService_PreviewDragHint);
        }

        private int GetTargetRowIndex(GridDataRowElement row, Point dropLocation)
        {
            int halfHeight = row.Size.Height / 2;
            int index = row.RowInfo.Index;
            if (dropLocation.Y > halfHeight)
            {
                index++;
            }
            return index;
        }
        private void InitializeRow(GridViewRowInfo destRow, GridViewRowInfo sourceRow)
        {
            foreach (GridViewCellInfo s in sourceRow.Cells)
            {
                destRow.Cells[s.ColumnInfo.Name].Value = s.Value;
            }
        }
        private void MoveRows(RadGridView targetGrid, RadGridView dragGrid, IList<GridViewRowInfo> dragRows, int index)
        {
            for (int i = dragRows.Count - 1; i >= 0; i--)
            {
                GridViewRowInfo row = dragRows[i];
                if (row is GridViewSummaryRowInfo)
                {
                    continue;
                }
                GridViewRowInfo newRow = targetGrid.Rows.NewRow();
                this.InitializeRow(newRow, row);
                targetGrid.Rows.Insert(index, newRow);
                row.IsSelected = false;
                dragGrid.Rows.Remove(row);
                index++;
            }
        }
 
        #region Drag & drop logic
 
        private void dragDropService_PreviewDragDrop(object sender, RadDropEventArgs e)
        {
            GridDataRowElement rowElement = e.DragInstance as GridDataRowElement;
            if (rowElement == null)
            {
                return;
            }
            RadItem dropTarget = e.HitTarget as RadItem;
            RadGridView targetGrid = dropTarget.ElementTree.Control as RadGridView;
            if (targetGrid == null)
            {
                return;
            }
            RadGridView dragGrid = rowElement.ElementTree.Control as RadGridView;
            if (targetGrid != dragGrid)
            {
                e.Handled = true;
                RadGridViewDragDropBehavior behavior = (RadGridViewDragDropBehavior)dragGrid.GridBehavior;
                GridDataRowElement dropTargetRow = dropTarget as GridDataRowElement;
                int index = dropTargetRow != null ? this.GetTargetRowIndex(dropTargetRow, e.DropLocation) : targetGrid.RowCount;
                this.MoveRows(targetGrid, dragGrid, behavior.SelectedRows, index);
            }
        }
 
        private void dragDropService_PreviewDragOver(object sender, RadDragOverEventArgs e)
        {
            if (e.DragInstance is GridDataRowElement)
            {
                e.CanDrop = e.HitTarget is GridDataRowElement || e.HitTarget is GridTableElement || e.HitTarget is GridSummaryRowElement;
            }
        }
 
        private void dragDropService_PreviewDragHint(object sender, PreviewDragHintEventArgs e)
        {
            GridDataRowElement dataRowElement = e.DragInstance as GridDataRowElement;
            if (dataRowElement != null && dataRowElement.ViewTemplate.MasterTemplate.SelectedRows.Count > 1)
            {
                //e.DragHint = new Bitmap(this.imageList1.Images[6]);       
                e.UseDefaultHint = false;
            }
        }
        #endregion
    }
 
    public class RadGridViewDragDropBehavior : BaseGridBehavior
    {
        List<GridViewRowInfo> selectedRows = new List<GridViewRowInfo>();
        public List<GridViewRowInfo> SelectedRows
        {
            get { return this.selectedRows; }
        }
 
        public override bool OnMouseDown(MouseEventArgs e)
        {
            selectedRows.Clear();
            bool result = base.OnMouseDown(e);
            if ((Control.ModifierKeys & Keys.Control) == Keys.Control ||
                (Control.ModifierKeys & Keys.Control) == Keys.Shift)
            {
                selectedRows.AddRange(this.GridControl.SelectedRows);
            }
            else
            {
                selectedRows.Add(this.GridControl.CurrentRow);
            }
            return result;
        }
    }
}

Mark
Top achievements
Rank 2
Bronze
Bronze
Veteran
 answered on 17 Aug 2016
2 answers
353 views

Dear All,

Right now, i'm using telerik RadDropdownList 2016 Q1. And ItemList have Icon Image above. It show ok on DropDown list, but not show when I selected one Item.

How can I config for it show icon image both in ItemList and Selected Item.

Thanks so much for all helping!!!

hongnguyenx
Top achievements
Rank 1
 answered on 17 Aug 2016
17 answers
323 views

How can i show the values of an item while double clicking on any of the value.

 

I mean is when we point our mouse pointer to an of the item in grid,then there will be a tooltip showing the current details of that item.How can i show it in message box while double clicking on it?

 

Can anyone help me Please...

Hristo
Telerik team
 answered on 16 Aug 2016
5 answers
394 views

I have a requirement to add a default filter to the my GridView.  Therefore I do this simply using the following code:

            FilterDescriptor filterDescriptor = new FilterDescriptor();
            filterDescriptor.PropertyName = "DistributionStatus";
            filterDescriptor.Value = "Active";
            filterDescriptor.Operator = FilterOperator.IsNotEqualTo;
            filterDescriptor.IsFilterEditor = true;

This is simply code taken from the documentation and modified.

This applies the restriction that I require, but when I open up the filter on screen as a user, I do not see all the values available in the column, so I am unable to remove this filter... Please see attached file (1.png) for an example.

If however, I add a random filter that does not affect the results (2.png), I now see all my available options (3.png).  Can anyone suggest if this is a bug? or maybe a setting I need to update or a forced refresh of some kind?

Mohammed
Top achievements
Rank 1
 answered on 16 Aug 2016
1 answer
646 views

Hi folks, this is not a Telerik bug specifically - its a bug (I think) with the underlying base Checkbox and Radiobutton controls that I believe the Telerik controls inherit.  Anyway let me describe the issue and maybe someone out there knows why this is...It's not super important its just one of those things that's bugged me for years (this bug has been around since the very first release of Visual Studio.)

 

I build business to business desktop applications.  That means there are a ton of data-entry forms and if you pay any attention at all to quality UI (if you didn't you wouldn't be using Telerik controls!) you like to have your data-entry form elements line up.  It's easier on the eyes and far easier for Data-Entry people to keep track of their place. Anyway lets pretend you have a form with Last Name, First Name text boxes and Are you a Supervisor checkbox.

You're not going to just dump the text boxes on the form - you'll have a label preceding the text boxes and a lot of folks (myself included) you'll use a colon to separate the label from the Textbox and to give you something to align to like this:

First Name: [__________]

Last Name: [__________]

Supervisor: [X]

 

FYI.  What I've done in text above isn't possible with two labels, two text boxes and one check box.  Don't believe me?  Try it.

See the default (for whatever reason) for Checkboxes (and radios for that matter) is to put the data-input portion of the control BEFORE the text so your checkbox would look like this:  [X] Supervisor:

So now your data-inputs no longer line up...no problem!  Just change the RightToLeft property from false to true right? *wrong!*

That's the bug.  If you set RightToLeft = True your checkbox would like exactly like this:

:Supervisor [X]

 

Yup...that's not a type.  The colon gets shoved in front of the text for some odd reason and this is the thing that's been bugging me for over a decade and I've never found anyone who can give me a reasonable answer as to why in the heck Microsoft would do that.  BTW the Colon doesn't matter.  You can use any punctuation mark or multiple combinations of them - if they're at the END of your "Text" property, they'll get shoved to the front of the line.

 

I've long ago given up trying to do the above.  Instead I use THREE labels, two text boxes and a Checkbox with no Text property then I add the code in for clicks and mouse-overs etc on the label to trigger the same event for the check box.

 

Again, its silly I know!  I'm a new, huge fan of Telerik and thought maybe someone out there knows whats up with this and can reply.

Thanks everyone :)

 

-C

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 16 Aug 2016
2 answers
166 views

Hi!

I'm trying to add a context menu for the RadTokenizedTextItem items in the RadAutoCompleteBox.Items collection. Something like the mockup-image i attached to this post.

The RadAutoCompleteBox itself has both a ContextMenu and a RadContextMenu property, but the RadTokenizedTextItem have none of these.To be clear: I want to be able to right-click an individual token in the RadAutoCompleteBox, click an option in the menu, and then catch some kind of event that includes information about that token in the eventargs. Is this even possible? If so, how would I go about doing this?

I'm using UI for WinForms.

 

Thanks,

Aleksander

Aleksander
Top achievements
Rank 1
 answered on 16 Aug 2016
11 answers
562 views
I have set my Docking.ToolWindow.Text to nothing and the ToolCaptionButtons to None. How can I hide the toolbar altogether? Ideally I would like to be able to programmatically make it reappear on mouse over. Is there a property for this somewhere?

Thanks,

G
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 15 Aug 2016
8 answers
776 views
Hello,

In an application I need to enter some large numbers and the client wants to format the number as he types (add currency, thousands separator,etc). I tried to use RadMakedEditBox with the "f" mask, it does not respect culture, I tried using "c" mask, it kinda works but I need to get rid of the currency symbol. With the "c" mask I can change the currency symbol but I am unable to change it to String.Empty as I wish - the control crashes (the closest thing is to set " " - a single space - but it's not very pretty, the client does not accept that).

Is there any way to format the value using culture parameters without currency sign? I also tried working with "p" format but I didn't find a way to hide the percent sign. I seen another thread with a suggestion for using a spinner, that is not good for me.

Thank you.

Hristo
Telerik team
 answered on 15 Aug 2016
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
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
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
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?