Telerik Forums
UI for WinForms Forum
10 answers
434 views
Hi

1. I need to be able to tell from the DragEventArgs arguments in the DragDrop event of the GridView, which row the user is "dropping" on.

I tried:

dgvPlaylistRegionMedia.GetChildAtPoint(new Point(e.X, e.Y));

but it returns null the whole time.

2. Also, it would be nice to give some sort of indication to the user where he would be "dropping", for e.g. a line between row 2 and row 3 if he's "hovering" between those 2 rows, or even a line after the last row to indicate that he would be adding it after the last row if he's "hovering" past the last row.  Any ideas?

Kind regards

Ralph
Hristo
Telerik team
 answered on 19 Aug 2015
1 answer
162 views

Hi.

 I need help, to translate a working C# kode til vb. It's the code highlightet with yellow, that gives me some (all the) troubles:

        private void ReadAppointmentsFromDatabase()

        {

            uiRadSchedulerMain.Appointments.Clear();

            var appointments = new ELHedegaard.BLL.Appointment(); 

            foreach (var appointment in appointments.GetAppointmentsWithResources())

            {

                Appointment schedulerAppointment = new Appointment();

                schedulerAppointment.Summary = appointment.Summary;

                schedulerAppointment.Start = appointment.Start.Value;

                schedulerAppointment.End = appointment.End.Value;

                schedulerAppointment.Location = appointment.Location;

                schedulerAppointment.Description = appointment.Description;

                //schedulerAppointment.BackgroundId = 1;

                schedulerAppointment.StatusId = 2;

                schedulerAppointment.BackgroundId = appointment.ParentID.Value;

                foreach (var x in appointment.ResourceIds.Select(a => new EventId(a)))

                  

                {

                    schedulerAppointment.ResourceIds.Add(x);

                    System.Diagnostics.Debugger.Break();

                }

                uiRadSchedulerMain.Appointments.Add(schedulerAppointment);

               //System.Diagnostics.Debugger.Break();

          }

          }

Kindly Peer​

Stefan
Telerik team
 answered on 18 Aug 2015
3 answers
155 views

How can i generate a custom format of the data that is displayed in the gridview?

for example, i want to generate a timesheet for employees in my organization, the first line of the sheet should be the name of organization, second line should be the name of the employee and then the gridview should be binded with the database.

i also want to export data from this gridview to excel sheet. 

format image is attached bellow

can someone help me?

 

Dimitar
Telerik team
 answered on 18 Aug 2015
1 answer
1.4K+ views

I'm using Telerik WinControls 2014.3.1104.40 in a C# environment.

I have a gridview that has a number of preset columns, as well as zero or more additional, user-defined columns. I need a way to load this data into the grid.

Currently, I am trying to use C# "dynamic" objects, in hope that the FieldName property of each column will access that field of the dynamic object; but the grid does not appear to load anything from a list of dynamic objects.

There should be data loaded into the ​cells, but they show up blank. Here is a sample of the code that is not working:

private void LoadData()
{
    radGridView1.DataSource = new List<dynamic>()
    {
        CreateDynamicObject(1),
        CreateDynamicObject(2),
        CreateDynamicObject(3),
    };
}
 
private dynamic CreateDynamicObject(int id)
{
    dynamic ret = new ExpandoObject();
    ret.Id = id;
    ret.Prop1 = "Property 1: " + id;
    ret.Prop2 = "Property 2: " + id;
    return ret;
}

If List<dynamic> data sources are not supported, what other method would be most similar?

Dimitar
Telerik team
 answered on 18 Aug 2015
3 answers
568 views

Hello

I succeeded to put a listview in a cell ​of a grid. But I have some problems with it.

1. Why the first listview item is always highlighted.
2. How can I add the possibility to work with keyboard to select some listview items instead of mouse.

public class CheckListBoxCellElement : GridDataCellElement
{
    public CheckListBoxCellElement(GridViewColumn column, GridRowElement row)
        : base(column, row)
    {
    }
 
    RadListViewElement radListElement;
 
    protected override void CreateChildElements()
    {
        base.CreateChildElements();
 
        radListElement = new RadListViewElement();
 
        radListElement.ShowCheckBoxes = true;
        radListElement.AllowArbitraryItemHeight = true;
        radListElement.ViewType = ListViewType.IconsView;
        radListElement.VisualItemFormatting += new ListViewVisualItemEventHandler(radListElement_VisualItemFormatting);
 
        radListElement.ItemCheckedChanged += new ListViewItemEventHandler(radListElement_ItemCheckedChanged);
        this.Children.Add(radListElement);
    }
 
    void radListElement_VisualItemFormatting(object sender, ListViewVisualItemEventArgs e)
    {
        BaseListViewVisualItem lvi = e.VisualItem as BaseListViewVisualItem;
        lvi.DrawBorder = true;
        lvi.DrawFill = true;
        lvi.CanFocus = true;
    }
 
    void radListElement_ItemCheckedChanged(object sender, ListViewItemEventArgs e)
    {
        if (e.Item.CheckState == Telerik.WinControls.Enumerations.ToggleState.On)
        {
            PropertyValue val = (PropertyValue)e.Item.DataBoundItem;
            val.Selected = true;
        }
        else
        {
            PropertyValue val = (PropertyValue)e.Item.DataBoundItem;
            val.Selected = false;
        }
    }
 
    protected override void SetContentCore(object value)
    {
        IList list = (IList)value;
 
        radListElement.DataSource = list;
        radListElement.DisplayMember = "Name";
        radListElement.ValueMember = "ID";
    }
 
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(GridDataCellElement);
        }
    }
 
    public override bool IsCompatible(GridViewColumn data, object context)
    {
        return data is CheckListBoxColumn && context is GridDataRowElement;
    }
}

 

public class CheckListBoxColumn : GridViewDataColumn
{
    public CheckListBoxColumn(string fieldName)
        : base(fieldName)
    {
    }
 
    public override Type GetCellType(GridViewRowInfo row)
    {
        if (row is GridViewDataRowInfo)
        {
            return typeof(CheckListBoxCellElement);
        }
        return base.GetCellType(row);
    }
}

public class Data
{
    public string Name { get; set; }
    public IList Field { get; set; }
}
 
 
public partial class MYForm : Form
{
    public MYForm()
    {
        InitializeComponent();
 
        Init();
    }
 
    private void Init()
    {
        GridViewTextBoxColumn column1 = new GridViewTextBoxColumn("Name");
        ksGrid.Columns.Add(column1);
 
        CheckListBoxColumn column2 = new CheckListBoxColumn("Field");
        ksGrid.Columns.Add(column2);
        column2.Width = 250;
 
        ksGrid.AutoGenerateColumns = false;
 
        ArrayList list = new ArrayList();
 
        IList values1 = new ArrayList();
        values1.Add(new PropertyValue() { ID = 1, Name = "Blue" });
        values1.Add(new PropertyValue() { ID = 2, Name = "Yellow" });
        values1.Add(new PropertyValue() { ID = 3, Name = "Red" });
        Data data1 = new Data { Name = "Color", Field = values1 };
        list.Add(data1);
 
 
        IList values2 = new ArrayList();
        values2.Add(new PropertyValue() { ID = 4, Name = "M" });
        values2.Add(new PropertyValue() { ID = 5, Name = "L" });
        values2.Add(new PropertyValue() { ID = 6, Name = "XL" });
        Data data2 = new Data { Name = "Size", Field = values2 };
        list.Add(data2);
 
        ksGrid.DataSource = list;
 
        object ob = ksGrid.Rows[1];
    }
Hristo
Telerik team
 answered on 17 Aug 2015
2 answers
356 views

Hi,
to facilitate and speed up insert row, when user press enter key all blank cell in current row must be copied from same cell (same column) of previous row.

At the begin the grid is blank, it not have datasource but only template for columns, user can add row by new row grid feature.

I have some problem when the edit row is the new row (not jet added to rows grid collection) and cell is in edit mode.
I try to create a custom GridBehavior to do this, but if row in edit is the new row i can't access it.

Thank you very much.

 

Dimitar
Telerik team
 answered on 17 Aug 2015
1 answer
303 views

Dear Telerik Team,

 It's possible to customize the PDF Navigator icons?

 How can i do to load a PDF that i put inside my solution or inside of a database?

 Kind regards

Stefan
Telerik team
 answered on 17 Aug 2015
7 answers
1.3K+ views

Hi there,

 

i have the following problem:

 

I have a RadScrollablePanel.

 Inside this Panel i added two RadGroupBox-Controls.

The first is positioned in the upper left corner with Anchor = Left Top Right and minimum size of 300

The second is positioned in the upper right corner with Anchor = Top Right.

 Now when resizing my Form, i expected when the Minium size is reached, the Scrollable Panel should show scrollbar. 

I added an example project

Thanks Florian Keller

 

 

Stefan
Telerik team
 answered on 17 Aug 2015
5 answers
516 views
Hi

For the TimePicker editor is there a 'Clear' button or can one be added (similar to that available with the DateTimePicker)?

Thanks

Adrian
Dimitar
Telerik team
 answered on 14 Aug 2015
3 answers
141 views

 

Hello
is there any way to have a rangebar where y_axis is a date (05/25/2015 11:00) and the category is a number ?
If so could I have an example
Thank you for you help

Stefan
Telerik team
 answered on 14 Aug 2015
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?