Telerik Forums
UI for WinForms Forum
3 answers
381 views
Hi,

I have a hierarchical gridview with checkbox column. I have a checkbox in header as well.
When the header checkbox is checked/unchecked all other rows gets checked/unchecked accordingly.
But when i do the same in Child it is not working properly.
When i check/uncheck header of Child then the child rows of only expanded row should get checked/unchecked but not all the child rows.
Right now its applying changes for all child rows but i want it only for expanded row.

Below is my code:
<
private void AddCheckColumn(fc_rad_dataGridView dataGridView)
        {
            CustomCheckBoxColumn checkColumn = new CustomCheckBoxColumn();
            checkColumn.Name = "IsActive";
            checkColumn.FieldName = "Active";
            if (!dataGridView.Columns.Contains("IsActive"))
                dataGridView.Columns.Insert(dataGridView.Columns.Count - 1, checkColumn);
        }

public class CustomCheckBoxColumn : GridViewCheckBoxColumn
    {
        public override Type GetCellType(GridViewRowInfo row)
        {
            if (row is GridViewTableHeaderRowInfo)
            {
                return typeof(CheckBoxHeaderCell);
            }
            return base.GetCellType(row);
        }
    }

    public class CheckBoxHeaderCell : GridHeaderCellElement
    {
        RadCheckBoxElement checkbox;

        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(GridHeaderCellElement);
            }
        }

        public CheckBoxHeaderCell(GridViewColumn column, GridRowElement row)
            : base(column, row)
        {

        }

        public override void Initialize(GridViewColumn column, GridRowElement row)
        {
            base.Initialize(column, row);
            column.AllowSort = false;
            column.TextAlignment = ContentAlignment.MiddleRight;
        }

        public override void SetContent()
        {
        }

        protected override void DisposeManagedResources()
        {
            checkbox.ToggleStateChanged -= new StateChangedEventHandler(checkbox_ToggleStateChanged);
            base.DisposeManagedResources();
        }

        protected override void CreateChildElements()
        {
            base.CreateChildElements();
            checkbox = new RadCheckBoxElement();
            checkbox.ToggleStateChanged += new StateChangedEventHandler(checkbox_ToggleStateChanged);
            this.Children.Add(checkbox);
        }

        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            SizeF size = base.ArrangeOverride(finalSize);

            RectangleF rect = GetClientRectangle(finalSize);
            this.checkbox.Arrange(new RectangleF((finalSize.Width - this.checkbox.DesiredSize.Width) / 2, (rect.Height - 20) / 2, 20, 20));

            return size;
        }

        public override bool IsCompatible(GridViewColumn data, object context)
        {
            return data.Name == "IsActive" && context is GridTableHeaderRowElement
                && base.IsCompatible(data, context);
        }

        private void checkbox_ToggleStateChanged(object sender, StateChangedEventArgs args)
        {  
            if (this.ColumnInfo is GridViewCheckBoxColumn)
            {
                bool valueState = false;

                if (args.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
                {
                    valueState = true;
                }
                for (int i = 0; i < this.ViewTemplate.Rows.Count; i++)
                {
                    this.ViewTemplate.Rows[i].Cells[this.ColumnIndex].Value = valueState;
                }
            }
        }
    }
>

Thanks,
Pinaki
Svett
Telerik team
 answered on 11 Oct 2010
2 answers
116 views
What is the equivalent to use?:

Grid.MasterTemplate.GroupByExpressions (i). SelectFields.Count
  
Dim col As New Telerik.WinControls.UI.GridViewDataColumn()
  
Grid.MasterView.TableHeaderRow.Cells(i).CellElement
  
ByVal Group As Telerik.WinControls.UI.AggregateCollection
  
Dim headerCell As GridCellElement = grid.MasterView.TableHeaderRow.Cells(i).CellElement

In the new version.

Thanks.
Martin Vasilev
Telerik team
 answered on 11 Oct 2010
2 answers
120 views
After opening a new form and return to the window where the grid, this can not change the column size as normal

Video show error Filename "Error Grid":
Error grid.swf

RobertoCorona
Top achievements
Rank 2
 answered on 11 Oct 2010
2 answers
169 views
Hi,
I'm trying to set the tooltiptext of the radbutton with a title (first row in bold style) and a second part where write the description,
for instance like the microsoft word 2010 style.
First of all, I would like to know if is it possible to do, and if yes, how ?

thank you so much
Jean-Marc Windholz
Top achievements
Rank 1
 answered on 11 Oct 2010
1 answer
90 views
Hi All,
I have been working on WebApplication for some time and now I have to work on Windows application..So I installed telerik controls for windows application.But after installation once I opened the VS 2008 IDE,Telerik tool box controls are not getting enabled.

Please help me to solve this.

I have the telerik controls web application still in my machine.Is ther any problem if we have both forms of telerik controls in one machine.

Thanks,
A2H
Richard Slade
Top achievements
Rank 2
 answered on 11 Oct 2010
1 answer
234 views
Hi,

I have a query on the DataBinding of DataGridView to BindingList object.

I have a Class called Customer having a structure decribed as Below.

 

public class Customer

 

{

 

public int CutomerType { get; set; }

 

 

public string CustomerName { get; set; }

 

}

 


public
class LookupData

 

{

 

public int Key

 

{

 

get;

 

 

set;

 

}

 

public string Value

 

{

 

get;

 

 

set;

 

}

 

public override string ToString()

 

{

 

return this.Value;

 

}

}

I have created a BindingList<Customer> and binded with the DataGrid. The Grid has 2 columns

1) GridViewComboBoxColumn - with Data source as List of Lookup data and the FieldName as CustomerType
2) GridViewTextBoxColumn - for CustomerName

Everything works fine , I am able to Add, Update and Delete entries.

But my problem is When I add a new row the , the new customer object is added to the BindingList only after I come out of the Grid row.
 
I want to add a new Customer Item to my BindingList when the user adds a new row and selects a CustomerType.

Note : I checked with Normal Winform Grid and It adds an entry if I select Customer Type alone.

Can you please let me know if there is any option available for this..

Thanks
Abhilash

Emanuel Varga
Top achievements
Rank 1
 answered on 11 Oct 2010
1 answer
151 views
Hi mates,
We are at the end of developing a client application in winforms (of course using Telerik Winforms controls). But application is going to be large and I want to see opportunities to separate in "modules". 
I am interested to know if I can implement MEF (Managed Extensibility Framework) with telerik winforms controls, and if exist any sample out there?

*We are using rad dock as parent for our mdi forms display.
Richard Slade
Top achievements
Rank 2
 answered on 10 Oct 2010
1 answer
179 views
Dear Admin,

I need to change the height of navigation bar property of the calendar. Also, I need to change the navigation bar images.
I program an application that will be used in a touch screen computer. So, I have to change the size of navigation bar and its images.

Could you please help me?

Thank you in advanced.

Best regards.

Kian
Emanuel Varga
Top achievements
Rank 1
 answered on 10 Oct 2010
1 answer
79 views
Hi ,

     Good morning, Here i am used radgridview for display name,phone,address and so on. Now i need cell or coloumn span for particular cells or coloumns. Please kindly inform me.

 Its very urgent

Selvasundar.M
Richard Slade
Top achievements
Rank 2
 answered on 10 Oct 2010
3 answers
84 views
Keep getting exception has been thrown by the target of an invocation.

Is there any way of doing this?
Richard Slade
Top achievements
Rank 2
 answered on 08 Oct 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)
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
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?