Telerik Forums
UI for WinForms Forum
1 answer
181 views
I have a hierachical grid with several generations of children and syblings. How do I define in an add, update, delete event of the current row which table is to be updated? 

Although there is  a command UserAddingRow, but how do I define that I am in a certain child to update that child?

Thankfull for directions and a fast response...

Karl 
 
Martin Vasilev
Telerik team
 answered on 15 Jul 2010
2 answers
171 views
Hi,

I have a hierarchical dataset being bound to the gridview and the binding works well.  The challenge I am running into is how to format the child gridview (child template).  I am formatting the parent row format (hiding columns, setting their widths, etc...) via the grid's DataBindingComplete event handler, but how do I format the children rows format?  As an example, I need to hide the first two columns in the child dataset.

Thanks
Ali M.


MORE INFO:  I am getting two datasets and binding the grid to them as shown in the code below.  I then depend on the DataBindingComplete event handler to control the visibility and size of the columns which works for the master dataset but don't know how to implement that for the child dataset.  I would change the formatting logic if this is the wrong way to do it.
Thanks

_adapter = New SqlDataAdapter()
_adapter.SelectCommand = _cmdSelect
_adapter.Fill(Me.dsSync, "Transactions")        ', "MBDeviceAuthorization")
_adapter.SelectCommand = _cmdSelect2
_adapter.Fill(Me.dsSync, "Details")
 
grdTransactionDetails.Tag = "checkouts"
grdTransactionDetails.DataSource = Me.dsSync.Tables("Transactions") ' Me.BindingSource1
Dim template As GridViewTemplate = New GridViewTemplate
template.DataSource = Me.dsSync.Tables("Details")
template.AllowAddNewRow = False
template.AllowEditRow = False
template.AllowDeleteRow = False
template.EnableGrouping = False
grdTransactionDetails.MasterGridViewTemplate.ChildGridViewTemplates.Add(template)
Dim relation As GridViewRelation = New GridViewRelation(grdTransactionDetails.MasterGridViewTemplate)
relation.ChildTemplate = template
relation.RelationName = "CheckoutItems"
relation.ParentColumnNames.Add("rowid")
relation.ChildColumnNames.Add("rowid")
grdTransactionDetails.Relations.Add(relation)
Martin Vasilev
Telerik team
 answered on 14 Jul 2010
1 answer
184 views

Please point me to (a) sample(s) to distinguish in the insert or update between a master / child the current selection is on.

        private void radGridView1_RowsChanged(object sender, GridViewCollectionChangedEventArgs e)  
        {  
            case ... I'm changing in the master... // what is the selection
            this.t_FilmTableAdapter.Update(this.pAS2DataSet.T_Film);  
            case .... I'm changing a child    //how do you select it
            case .... another child
            end case
        } 

Now, if I have scenes (as a child) and the child template works and I just wanted to update the scene row - where or how do I differentiate that?

Thanks in advance,
Karl
Alexander
Telerik team
 answered on 14 Jul 2010
2 answers
128 views
Hi,

Does the Winform Telerik Grid Supports displaying hierachial data from object collection.

I can give you a simple example in our application we have a Customer class which has Firstname and Surname and a List of Address details. The Address is a separate class which have properties like Town,Postcode and all

Customer
{
    string FirstName;
    string Surname;
    List<Address> Addresses;
}

the requirement is to display the customer forename and surname only in the main row and the list of address in the child table.

Does the winform grid supports displaying the above scenario?
Julian Benkov
Telerik team
 answered on 14 Jul 2010
1 answer
118 views

Hi,

I'm working radGridView control for displaying self referencial and hierarchal data, i'm using the latest telerik binaries (i.e.WPF Q1 2010 SP2).

With my current code, this displays as:

Task 1
-- Task101
-- Task102
Task 2
-- Task201
-- Task202
Task101
Task102
Task201
Task202

I dont want to display Task101,Task102,Task201,Task202 in the main hirerarchy list, as those are the childs to Task1 and Task2

Code Pasted Below:

XAML:

 <Grid>
        <telerik:RadGridView x:Name="RadGridView1"
             DataLoading="RadGridView1_DataLoading" RowLoaded="RadGridView1_RowLoaded" GridLinesVisibility="Horizontal"
            CanUserFreezeColumns="False" IsReadOnly="True" AutoGenerateColumns="False"  >

            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn  DataMemberBinding="{Binding TaskId}"  />
               
                <telerik:GridViewDataColumn Header="Task Name" DataMemberBinding="{Binding TaskName}" />

                <telerik:GridViewDataColumn Header="Read">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="checkBoxRead" IsChecked="{Binding Read}" />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewDataColumn>

                <telerik:GridViewDataColumn Header="Write">
                    <telerik:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox x:Name="checkBoxWrite" IsChecked="{Binding Write}" />
                        </DataTemplate>
                    </telerik:GridViewColumn.CellTemplate>
                </telerik:GridViewDataColumn>

            </telerik:RadGridView.Columns>

            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition>
                    <telerik:GridViewTableDefinition.Relation  >
                        <telerik:TableRelation IsSelfReference="True" >
                            <telerik:TableRelation.FieldNames>
                                <telerik:FieldDescriptorNamePair
                                    ParentFieldDescriptorName="TaskId"
                                    ChildFieldDescriptorName="ParentTaskId" />
                            </telerik:TableRelation.FieldNames>
                        </telerik:TableRelation>
                    </telerik:GridViewTableDefinition.Relation>
                </telerik:GridViewTableDefinition>
            </telerik:RadGridView.ChildTableDefinitions>

        </telerik:RadGridView>
    </Grid>

 

 

 

 

 

 

 

 

 

.CS Code:

/// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            //RadGridView1. .MasterTableView.FilterExpression = "ParentID = 0";
            RadGridView1.ItemsSource = GetTasks();
           
        }

 

        private List<Task> GetTasks()
        {
            List<Task> tasks = new List<Task>();

            tasks.Add(new Task { TaskId = 1, TaskName = "Task1", Read = true, Write = true, ParentTaskId = 0 });
            tasks.Add(new Task { TaskId = 2, TaskName = "Task2", Read = false, Write = true, ParentTaskId = 0 });

            tasks.Add(new Task { TaskId = 101, TaskName = "Task101", Read = true, Write = true, ParentTaskId = 1 });
            tasks.Add(new Task { TaskId = 102, TaskName = "Task102", Read = false, Write = false, ParentTaskId = 1 });

            tasks.Add(new Task { TaskId = 201, TaskName = "Task201", Read = true, Write = true, ParentTaskId = 2 });
            tasks.Add(new Task { TaskId = 202, TaskName = "Task202", Read = false, Write = false, ParentTaskId = 2 });

            //tasks.Add(new Task { TaskId = 1011, TaskName = "Task1011", Read = true, Write = false, ParentTaskId = 101 });

         
            return tasks;
        }

        private bool HasSubTasks(Task currentTask)
        {
            return
            (from task in (IEnumerable<Task>)this.RadGridView1.ItemsSource
             where task.ParentTaskId == currentTask.TaskId
             select task).Any();
        }

        private void RadGridView1_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {

            GridViewRow row = e.Row as GridViewRow;
            Task currentTask = e.DataElement as Task;

            if (row != null && currentTask != null)
            {
                row.IsExpandable = this.HasSubTasks(currentTask);
            }
        }

        private void RadGridView1_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            GridViewDataControl dataControl = (GridViewDataControl)sender;

            if (dataControl.ParentRow != null)
            {
                dataControl.ShowGroupPanel = false;
                dataControl.AutoGenerateColumns = false;
                dataControl.CanUserFreezeColumns = false;
                dataControl.IsReadOnly = false;
                dataControl.ChildTableDefinitions.Clear();

                GridViewDataColumn column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("TaskId");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("TaskName");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("Read");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("Write");
                dataControl.Columns.Add(column);
            }

        }
    }

    public class Task
    {
        public int TaskId { get; set; }
        public string TaskName { get; set; }
        public bool Read { get; set; }
        public bool Write { get; set; }

        public int ParentTaskId { get; set; }

    }

 

Thanks,
-Narendra

Veselin Vasilev
Telerik team
 answered on 14 Jul 2010
1 answer
73 views
In Step-by-step Tutorial – RadControls for WinForms
I open Telerik_RadControls_for_WinForms_VS_Projects\RealEstate\CS\UserDock\UserDock project
Why can't I add the usercontrl ,CalendarPanel, to toolbox?
Nikolay
Telerik team
 answered on 13 Jul 2010
8 answers
339 views
Can I create to EditAppointmentDialog for me ?


Dobry Zranchev
Telerik team
 answered on 13 Jul 2010
1 answer
146 views
Hi,

We are using Telerik Version 2009.3.9.1203. In that, We are also using the Scheduler control in our project. As per our requirement, the user can block some particular time in the day. In that case, we need to highlight that time in different color in the Scheuduler Calendar. But, right now, the scheduler allows me to differentiate only the Working time and Non Working time in the day.

Can you please help us on solving this.

Dobry Zranchev
Telerik team
 answered on 13 Jul 2010
1 answer
82 views
i have a c# project , i need to modify the entire project to the telerik visual style controls.
please help me...
Boryana
Telerik team
 answered on 13 Jul 2010
1 answer
126 views
Hi,
I have hosted the create/edit  appointment telerik control in window form. I want to display the popup at the center of the screen when it opens but i am unable to do so.
Please provide any assistence

Thanks & Regards,
Rahul
Dobry Zranchev
Telerik team
 answered on 13 Jul 2010
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
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
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
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?