Telerik Forums
UI for WinForms Forum
1 answer
113 views
Simple question that I was not quite able to find an answer to...
I have a binding list collection of Person objects.  Each Person object has a collection of Person objects.  For example, everyone is a person.  Some persons have children.  They are persons.  They can have kids, and so on and so on.

I bound this to a tree view but only got the first level of items.  I then added ParentMember and ChildMember values - these are used for a simple collection as compared to my hierarchy of same nodes thus it did not work.  I then tried to use the Object Relation mode and specified a display value that hit the first level of nodes and then went to the second level - "PersonName\\PersonName".  I did the same with the ValueMember.  Great, I now got two levels of tree control. 

The question is how to get N levels?  Do I do something like "PersonName\\*" in an attempt to tell it to repeat?  Do I need to do this manually rather than binding?

And lastly, I did read that Drag And Drop will NOT work with bound Trees.  If that is the case then I will do all of this work manually - I would think that you could support drag and drop but would have to rely on my code to actually do the movement of the actual data structure.
Peter
Telerik team
 answered on 22 Nov 2012
4 answers
777 views
I have a RadGridView with a GridViewDecimalColumn.  A row has the value of 51.34.  I set the DecimalPlaces property to 0 but the value still displays as 51.34.  Should this not display as 51?
Jippy
Top achievements
Rank 1
 answered on 22 Nov 2012
2 answers
203 views
I have set my RadDock MainDocumentContainerVisible = false and BorderStyle = none. But there is still a borderline on the left and top. If I set the BorderStyle to FixedSingle, the whole thing has a border, but the Left and Top still have an extra wide border. What is causing this?

Thanks,

G
Glenn
Top achievements
Rank 1
 answered on 21 Nov 2012
1 answer
104 views
I have radgridview with data written in design time i.e, code
this.radGridView1.Rows.Add("Jjkh", 19, 2, 9, 12, 21,52, 44, 63,56, System.DateTime.Now);
            this.radGridView1.Rows.Add("Jjkh", 10, 2, 9, 12, 21, 52, 44, 63, 87, System.DateTime.Now);
            this.radGridView1.Rows.Add("eur", 16, 2, 9, 12, 21, 52, 44, 63, 34, System.DateTime.Now);
            this.radGridView1.Rows.Add("usd", 14, 2, 9, 12, 21, 52, 44, 63, 23, System.DateTime.Now);
            this.radGridView1.Rows.Add("Jjkh", 67, 81, 33, 4, 55, 66, 7, 7, 11, System.DateTime.Now);
After this i've written code for forecolor:
for (int i = 0; i < radGridView1.Rows.Count; i++)
            {
                for (int j = 1; j < 4; j++)
                    this.radGridView1.Rows[i].Cells[j].Style.ForeColor = System.Drawing.Color.White;
                this.radGridView1.Rows[i].Cells[4].Style.ForeColor = System.Drawing.Color.Blue;
                this.radGridView1.Rows[i].Cells[5].Style.ForeColor = System.Drawing.Color.Red;

            }
But for back color, i've written in radGridView1_CellFormatting,
e.CellElement.BackColor = Color.Blue;
But the event radGridView1_CellFormatting is not binding with any method..
Anton
Telerik team
 answered on 21 Nov 2012
5 answers
534 views
Prior to using RadGridView, i made use of the new DataGridView in .NET 2.0.

consider the code below, where i successfully populate the row headers:

string[] userInputParams = new string[] {"apples","oranges",
                                                              "mangos",
                                                              "guanĂ¡bana"}
 for (int i = 0; i < userInputParams.Length; i++)
 {
                gridRows.Add();
                gridRows[i].HeaderCell.Value = userInputParams[i];
}

How would i acheive this with the telerik RadGridView winform control?

thank you
Jack
Telerik team
 answered on 21 Nov 2012
1 answer
278 views
Hi,

I've noticed that you can check whether the selected font in the richtextbox is bold or italic, but not whether it is both bold and italic. Checking for bold or italic can be done likeso:

Dim style As StyleDefinition = SelectedEditor.CurrentEditingStyle
      Dim fontWeight As TextStyle = DirectCast(style.GetPropertyValue(Span.FontStyleProperty), TextStyle)
 
      btnFontBold.Checked = fontWeight = TextStyle.Bold
      If fontWeight = TextStyle.Bold Then
          btnFontBold.Checked = True
      ElseIf fontWeight = TextStyle.Italic Then
          btnFontItalic.Checked = True
      End If

However, I cannot seem to find a way to check for both bold and italic text, as the only members of TextStyle are Bold, Italic, and Regular. Is there a way to do this?
Plamen
Telerik team
 answered on 21 Nov 2012
1 answer
191 views
Hi,

I have several grids on RadForm. I want to resize grids and columns for the next time.
How I can do it.

Thank you for advance
Stefan
Telerik team
 answered on 21 Nov 2012
5 answers
173 views
Hi, I'm starting developing with Telerik WinForms and WebForms controls. First of all, I'm changin' a System TreeView for a Telerik TreeView. I wasn't hard, but, in my last Tree, I had one property for sort a custom level of the tree. I'd make a class NodeComparer that implements IComparer. Now, in Telerik, I read that this property is called RadTreeNodeComparer, and needs a class that implements IComparer<RadTreeNode>.

So, the code is like this:
    UIPresentationTree.RadTreeNodeComparer = new NodeSorter();

Nothing happens, and the tree don't sort anything. What's wrong?

thanks.
Stefan
Telerik team
 answered on 21 Nov 2012
1 answer
344 views
I am binding objects to a hierarchy grid in code and when a change is made a child row the change is shown in the grid, however, the underlying data object is not updated.  I can manually apply the new value after edit to the object, but it seems like grid should be doing this for me.

public partial class Form1 : Form
    {
        private BindingList<Node> AllNodes = new BindingList<Node>();
 
        public Form1()
        {
            InitializeComponent();
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            LoadData();
        }
 
        public void LoadData()
        {
            LoadAllNodes();
            grid.DataSource = AllNodes;
            LoadAllObjectColumns(grid.MasterTemplate);
            // Load child template
            GridViewTemplate template = new GridViewTemplate();
            LoadAllObjectColumns(template);
            grid.MasterTemplate.Templates.Add(template);
 
            GridViewRelation r = new GridViewRelation(grid.MasterTemplate, template);
            r.ChildColumnNames.Add("Children");
 
            grid.Relations.Add(r);
        }
 
        public void LoadAllNodes()
        {
            Node p1 = new Node("Parent 1", ItemStatus.None);
            Node n1 = new Node("Child 1", ItemStatus.None);
            Node n2 = new Node("Child 2", ItemStatus.None);
            p1.Children.Add(n1);
            p1.Children.Add(n2);
            AllNodes.Add(p1);
            Node p2 = new Node("Parent 2", ItemStatus.None);
            AllNodes.Add(p2);
        }
 
        public static void LoadAllObjectColumns(GridViewTemplate template)
        {
            template.Columns.Clear();
            template.EnableFiltering = true;
            template.AllowAddNewRow = false;
            template.AutoGenerateColumns = false;
 
            GridViewTextBoxColumn colName = new GridViewTextBoxColumn("Name");
            colName.HeaderText = "Name";
            colName.Name = "Name";
            template.Columns.Add(colName);
 
            GridViewComboBoxColumn colStatus = new GridViewComboBoxColumn("Status");
            colStatus.HeaderText = "Status";
            colStatus.Name = "Status";
            colStatus.DataSource = Enum.GetValues(typeof(ItemStatus)).Cast<ItemStatus>();
            template.Columns.Add(colStatus);
 
            template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
        }
 
        public enum ItemStatus { None, New, Test, Complete };
 
        public class Node : INotifyPropertyChanged
        {
            public event PropertyChangedEventHandler PropertyChanged;
            protected void NotifyPropertyChanged(String info)
            {
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs(info));
                }
            }
 
            private string name;
            private ItemStatus status;
            private BindingList<Node> children;
 
            public string Name
            {
                get
                {
                    return name;
                }
                set
                {
                    if (name != value)
                    {
                        name = value;
                        NotifyPropertyChanged("Name");
                    }
                }
            }
 
            public ItemStatus Status
            {
                get
                {
                    return status;
                }
                set
                {
                    if (status != value)
                    {
                        status = value;
                        NotifyPropertyChanged("Status");
                    }
                }
            }
 
            public BindingList<Node> Children
            {
                get
                {
                    return children;
                }
                set
                {
                    children = value;
                }
            }
 
            public Node(string name, ItemStatus status)
            {
                this.name = name;
                this.status = status;
                children = new BindingList<Node>();
            }
        }
    }


Julian Benkov
Telerik team
 answered on 21 Nov 2012
1 answer
127 views
i have 2 ddls and i want to populate the second one based on the value of the first one. so i went on to use a row filter to filter the data view to get the data i need on the second ddl but when the page loads i get the error operator & not defined for string "Select distinct Zones....." and data row view. i click ok on the dialog error box to close it and it goes on to open the form and the code actually works. so how do i get rid of the error

cmd.CommandText = "Select Distinct Zones.ZoneID,CustomerItems.CustomerID as CustomerID,Zones.Zone " & _
"From CustomerItems Inner Join Zones On Zones.ZoneID=CustomerItems.ZoneID " & _
"Inner Join StockItems On StockItems.StockID=CustomerItems.StockID Where CustomerItems.CustomerID='" & ddlCustomers.SelectedValue & "'"
da = New SqlDataAdapter(cmd)
da.Fill(ds, "Zones")

'Populate Zones
ddlZone.DisplayMember = "Zone"
ddlZone.ValueMember = "ZoneID"
ddlZone.DataSource = ds.Tables("Zones")


setup = False
If Not setup Then
Dim dv As DataView
dv = New DataView(ds.Tables("Zones"))
'dv.RowFilter = "CustomerID = '" & ddlCustomers.SelectedValue & "'"
dv.RowFilter = "[CustomerID] = " & ddlCustomers.SelectedValue
ddlZone.DataSource = dv
ddlZone.ValueMember = "ZoneID"
ddlZone.DisplayMember = "Zone"
setup = False
End If
Stefan
Telerik team
 answered on 21 Nov 2012
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
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
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?