Telerik Forums
UI for WinForms Forum
10 answers
229 views
The column changes and has a date format.
how to hang an event is not a change to ValueChanged?
I want to apply this code:
private void dateTime_ValueChanged (object sender, EventArgs e)
         {
             SendKeys.Send (".");
         }
Hristo
Telerik team
 answered on 12 Mar 2018
1 answer
191 views

I need to find the selected range of cells in a radPivotGridView. 

After I load the radPivotGrid with appropriate DataSources' binding, I need to find when the user has made a selection(i.e. once he releases the left mouse button) on the data displayed under it. I tried to use the MouseCapture event but was unable to access the selected info. in any way.

Kindly help.

Hristo
Telerik team
 answered on 12 Mar 2018
1 answer
129 views

i have autocompletebox that is connected to a database to get autocomplete items

 

the problem is that i can't search with what i type unless i start with the the first letters of the value as an example :

hot tea

i have to type hot to find the value what i want is that i type tea or even 2 letters ea to find the value

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Mar 2018
1 answer
869 views

Dear support,

i my application in use two classes who implements  INotifyPropertyChanged to reflect the changes on them automaticly in gridview.

These is working quit nice, when using the gui thread.

my application is listening to multiple comports and starts adding new entry's from another thread to this classes.

INotifyPropertyChanged of courses raises an update for the gridview, so that the grid raises an exception because of the wrong thread

where must in place the invoke to make this call thread safe. in the form itself or on the gridview.

Thank you

Martin Gartmann

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Mar 2018
1 answer
105 views

Hi,

I have RadPageView with a lot of items, which are organized by categories.

 

I'd like that when I click on a category title (PageViewItemType.GroupHeaderItem?) I display the pages which are related to this GroupHeaderItem.

 

Eg.

Organisation (GroupHeaderItem)

 - Page1

 - Page 2

 

Administration (GroupHeaderItem)

 - Admin 1

 - Admin 2

 

I don't see how to accomplish that with RadPageView. 

I chose RadPageView over RadTreeView because the management of the forms that are shown are managed perfectly with RadPageView.

 

Thank you for your help.

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Mar 2018
9 answers
1.2K+ views

Hey guys,

My issue is to show some field value (readonly) from parent object in child view template, so that the first comes parent's field value and below it goes detail rows as usual. 

In my example I had to add unnecessary public List<string> Details { get; } = new List<string>(); property to make second tab. 

Is it possible to add some control to GridViewTemplate without using multiple child views? 

Prepared example:

public sealed class Student
    {
        public int Id { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public string AdditionalInfo { get; set; }
        public List<Award> Awards { get; } = new List<Award>();
        public List<string> Details { get; } = new List<string>();
 
        public static List<Student> GenerateList()
        {
            var students = new List<Student>();
            for (int studentIndex = 1; studentIndex <= 5; studentIndex++)
            {
                var student = new Student()
                {
                    Id = studentIndex,
                    FirstName = $"FirstName {studentIndex}",
                    LastName = $"LastName {studentIndex}",
                    AdditionalInfo = $"blah blah blah....  {studentIndex}"
                };
 
                for (int awardIndex = 1; awardIndex <= 5; awardIndex++)
                {
                    var award = new Award()
                    {
                        FundName = $"FundName {awardIndex}",
                        Amount = studentIndex * 100 + awardIndex,
                    };
 
                    student.Awards.Add(award);
                     
                }
 
                student.Details.Add($"unused text {studentIndex}");
 
                students.Add(student);
            }
 
            return students;
        }
    }
 
    public sealed class Award
    {
        public string FundName { get; set; }
        public double Amount { get; set; }
    }
 
public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
 
            radGridView1.ReadOnly = true;
            radGridView1.Columns.Add(new GridViewTextBoxColumn("FirstName"));
            radGridView1.Columns.Add(new GridViewTextBoxColumn("LastName"));
 
            GridViewTemplate childTemplate2 = CreateChildTemplate2();
            GridViewRelation relation2 = new GridViewRelation(this.radGridView1.MasterTemplate, childTemplate2);
            relation2.ChildColumnNames.Add("Details");
            this.radGridView1.Relations.Add(relation2);
 
            GridViewTemplate childTemplate1 = CreateChildTemplate1();
            GridViewRelation relation = new GridViewRelation(this.radGridView1.MasterTemplate, childTemplate1);
            relation.ChildColumnNames.Add("Awards");
            this.radGridView1.Relations.Add(relation);
 
             
 
            this.radGridView1.DataSource = Student.GenerateList();
            radGridView1.AutoGenerateColumns = false;
 
            radGridView1.CellFormatting += RadGridView1_CellFormatting;
            this.radGridView1.TableElement.PageViewMode = PageViewMode.ExplorerBar;
            var aa = this.radGridView1.TableElement.PageViewProvider;
             
        }
 
         
        private void RadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridViewDataColumn column = e.CellElement.ColumnInfo as GridViewDataColumn;
             
            if (column != null && column.OwnerTemplate.Caption == "aa")
            {
                e.CellElement.TableElement.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
                RadPageViewContentAreaElement content = e.CellElement.TableElement.Parent as RadPageViewContentAreaElement;
 
                RadLabelElement radLabelElement = new RadLabelElement();
 
                if (content.FindDescendant<RadLabelElement>() == null)
                {
                    content.Children.Add(radLabelElement);
                    var row = (GridViewHierarchyRowInfo)e.CellElement.RowInfo.Parent;                         
                           var student = (Student)row.DataBoundItem;
                           radLabelElement.Text = student.AdditionalInfo;
                }
            }
            else
            {
                e.CellElement.TableElement.Visibility = Telerik.WinControls.ElementVisibility.Visible;
                RadPageViewContentAreaElement content = e.CellElement.TableElement.Parent as RadPageViewContentAreaElement;
 
                if (content != null)
                {
                    RadLabelElement el = content.FindDescendant<RadLabelElement>();
 
                    if (el != null)
                    {
                        content.Children.Remove(el);
                        el.Dispose();
                    }
                }
            }
        }
        private GridViewTemplate CreateChildTemplate1()
        {
            GridViewTemplate childTemplate = new GridViewTemplate();
            this.radGridView1.Templates.Add(childTemplate);
            GridViewTextBoxColumn column = new GridViewTextBoxColumn("FundName");
            childTemplate.Columns.Add(column);
            column = new GridViewTextBoxColumn("Amount");
            childTemplate.Columns.Add(column);
            childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            childTemplate.Caption = "11";
            return childTemplate;
        }
        private GridViewTemplate CreateChildTemplate2()
        {
            GridViewTemplate childTemplate = new GridViewTemplate();
            this.radGridView1.Templates.Add(childTemplate);
            GridViewTextBoxColumn column = new GridViewTextBoxColumn();
            childTemplate.Columns.Add(column);
            childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            childTemplate.Caption = "aa";
            return childTemplate;
        }
    }

 

Thanks

Dilshod
Top achievements
Rank 1
 answered on 12 Mar 2018
9 answers
774 views

Hi,

If I apply a Number Format to aggregate values, e.g. #.00 €, this also applies to Print, but not to Export to xlsx (but applies to export to XML). Is is possible to apply number format to xlsx Export as well?

Thanks,

Alex

 

Alex Dybenko
Top achievements
Rank 2
 answered on 12 Mar 2018
3 answers
179 views
We use a RadGridView on our WinForms application. We are trying to add filtering, but nothing behaves the way we want it to.

When I go to the filter -> Available Filters -> Equals, I would expect it to load the form with the appropriate options prefilled (i.e., equal to today). However, the form lacks values and does not adapt for which filter I select.

Here's my code so far:

Private Sub radGridView1_CreateCompositeFilterDialog(e As GridViewCreateCompositeFilterDialogEventArgs, senderName As String, column As GridViewDataColumn)
    Dim filterDialog As CompositeFilterForm
    Dim compositeFilterDescriptor As CompositeFilterDescriptor
 
    If senderName.ToLower() = "equals" Then
        compositeFilterDescriptor = New CompositeFilterDescriptor()
        compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.Or
        compositeFilterDescriptor.IsFilterEditor = True
        compositeFilterDescriptor.FilterDescriptors.Add(New DateFilterDescriptor("colReceived", FilterOperator.IsEqualTo, Date.Now) With {
                                                        .IsFilterEditor = True,
                                                        .IgnoreTimePart = True
        })
        compositeFilterDescriptor.FilterDescriptors.Add(New DateFilterDescriptor("colReceived", FilterOperator.IsEqualTo, Date.Now) With {
                                                        .IsFilterEditor = True,
                                                        .IgnoreTimePart = True
        })
    ElseIf senderName.ToLower() = "not equal to" Then
        compositeFilterDescriptor = New CompositeFilterDescriptor()
        compositeFilterDescriptor.LogicalOperator = FilterLogicalOperator.And
        compositeFilterDescriptor.NotOperator = True
        compositeFilterDescriptor.IsFilterEditor = True
        compositeFilterDescriptor.FilterDescriptors.Add(New FilterDescriptor("colReceived", FilterOperator.IsEqualTo, Date.Now))
        compositeFilterDescriptor.FilterDescriptors.Add(New FilterDescriptor("colReceived", FilterOperator.None, Nothing))
    ElseIf
        ....
    End If
 
    If compositeFilterDescriptor IsNot Nothing Then
        filterDialog = New CompositeFilterForm(column, compositeFilterDescriptor)
    Else
        filterDialog = New CompositeFilterForm()
    End If
    AddHandler filterDialog.FormClosing, AddressOf test2
    e.Dialog = filterDialog
End Sub

This is subscribed to in the MouseUp event of any of the Available Filter menu items (which has some custom values passed in through a lambda):

Private Sub item_MouseUp(sender As Object, column As GridViewDataColumn)
        AddHandler radGridView1.CreateCompositeFilterDialog, Sub(s As Object, e2 As GridViewCreateCompositeFilterDialogEventArgs)
        radGridView1_CreateCompositeFilterDialog(e2, CType(sender, RadItem).AccessibleName, column)
                                           End Sub
 
    End Sub

How can I load the window with the appropriate filters prefilled to the form?

 

It looks like we're on Telerik version 2017.3.1017.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Mar 2018
1 answer
264 views
How can I hide a floating document window? Right now it seems as though if you right-click, it gives you the option to be able to hide the window, but when you click on it, it doesn't really hide it, it closes it instead. When I switch the closeAction propery to hide, it seems like you can hide the window now. But when it's on the default behavior for closeaction which is closeanddispose, it just closes it. Is that what it's supposed to do? Is there a way to close the window when I hit the x and if I hide it, it actually hides it? I noticed that if I disable the option to hide (which AutoHide is already disabled), it disables the x in the corner of the window too. 
Hristo
Telerik team
 answered on 09 Mar 2018
2 answers
223 views

     Hi,

when I manually resize columns on PivotGrid and then run Export to Excel (or PDF) - row descriptor columns (Day, Aggregates) are same size in Excel, but aggregates columns somehow resized. Is it by design or there is a way to export row descriptor columns width as well?

Alex

 

Alex Dybenko
Top achievements
Rank 2
 answered on 09 Mar 2018
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?