Telerik Forums
UI for WinForms Forum
1 answer
206 views
Here are the steps to reproduce the issue:

1) AutoHide a toolwindow
2) Hover the mouse on top of the toolwindow's tab
3) The AutoHide toolwindow will slide out displaying its content. You may need to do this several times to see it.

In step 3, when displaying the hosted content, the content is not in the correct position or something because there are empty space on the right and bottom of the hosted content. See attached pictures. I have to actually click on the tab for the hosted content to display correctly.

PS: The hosted control is TX Text Control. I don't know if this is caused by the control or raddock! I just tried adding a richtexteditor to a different tool windows and got a different problem. The control is not refresh itself correctly!

Phi
Emanuel Varga
Top achievements
Rank 1
 answered on 05 Nov 2010
5 answers
176 views
How can I change the border back color help please click picrue see
Emanuel Varga
Top achievements
Rank 1
 answered on 05 Nov 2010
7 answers
259 views
Hello,
What would be the best way to programatically define the columns in a ChildGridViewTemplate, when I don't want to auot-generate them from the database?  I have a hierarchical grid set up with two levels, and I would like to define the columns programatically, but when I set AutoGenerateColumns to false and try to add columns to the collection, nothing shows up in the child grid, or the parent grid shows no children.  What is the correct way to do this (should the code be in a particular event of the grid)?  Thanks!
Alexander
Telerik team
 answered on 05 Nov 2010
1 answer
123 views

Hi,

As in topic ... How to manage column size offset ?

Please take a look into attached screen shot, I've marked offsets I'd like to modify with a blue arrows.

Regards.

Richard Slade
Top achievements
Rank 2
 answered on 05 Nov 2010
4 answers
676 views
Telerik.Win.Control.UI.dll version is "2009.3.9.1203"

Hi,
I am running into several behavior problems with the RadGridView control. 
1)  If I set the BeginEditMode to "BeginEditOnF2", the user is still able to get into edit mode by double-clicking on a cell - not what is expected! 
2) once the grid is in edit mode, the user can click on another cell to put it in edit mode regardless of the BeginEditMode setting
3) worst yet, if the user is editing a cell and hit the tab (or shift-tab), the new cell goes into edit mode but the changes to the original cell are not submitted to the bound dataset even though the CellEndEdit event is called (where I update the dataset).  Code is below...

Any help would be greatly appreciated...
Ali M.

In the code below, I was forced to ignore the BeginEditMode property because it is not working and instead implemented a CellDoubleClick event handler that puts the cell into edit mode.  If the user makes a change and hits the Enter key, then changes are submitted to the db in the CellEndEdit event handler.  But, if the user tabs to another cell, the cell is put into Edit mode but the changes he/she made in the previous cell are not submitted...
My preferred solution would be to enforce the F2-only edit mode through the BeginEditMode property...


Public Class RadForm1 
    Private _cellModifyBegin As Boolean 
    Private _currentEditCell As Integer 
 
    Private Sub RadForm1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        _cellModifyBegin = False 
 
        Try 
            grdCustomers.EnterKeyMode = Telerik.WinControls.UI.RadGridViewEnterKeyMode.None 
            Me.CustomerTableAdapter.Fill(Me.CustomerApps.Customer) 
        Catch ex1 As System.Exception 
            Debug.WriteLine(String.Format("Failed in frmMain2.frmMain2_Load - Exception: {0}", ex1.ToString())) 
            My.Application.Log.WriteException(ex1) 
            MessageBox.Show(String.Format("An error has ocurred. Message : {0}", ex1.Message())) 
        Finally 
            Debug.WriteLine("End ---> frmMain2.frmMain2_Load") 
            My.Application.Log.WriteEntry(String.Format("End --->     {0:00}:{1:00}:{2:00}:{3:0000}   frmMain2.frmMain2_Load", Now.Hour, Now.Minute, Now.Second, Now.Millisecond)) 
        End Try 
    End Sub 
 
    Private Sub grdCustomers_CellBeginEdit(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellCancelEventArgs) Handles grdCustomers.CellBeginEdit 
        Debug.Print(String.Format("grdCustomers_CellBeginEdit.  RowIndex={0}, CellIndex={1}", e.RowIndex, e.ColumnIndex)) 
        If _currentEditCell <> e.ColumnIndex Then 
            ' this cell got into Edit mode due to user tabbing away from a previous cell edit 
            e.Cancel = True 
            Return 
        End If 
        _cellModifyBegin = True 
    End Sub 
 
    Private Sub grdCustomers_CellDoubleClick(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles grdCustomers.CellDoubleClick 
        Debug.Print(String.Format("grdCustomers_CellDoubleClick.  RowIndex={0}, CellIndex={1}", e.RowIndex, e.ColumnIndex)) 
        _currentEditCell = e.ColumnIndex 
        e.Row.Cells(e.ColumnIndex).BeginEdit() 
    End Sub 
 
    Private Sub grdCustomers_CellEndEdit(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles grdCustomers.CellEndEdit 
        If grdCustomers.ActiveEditor.IsModified Then 
            Debug.Print(String.Format("grdCustomers_CellEndEdit.  RowIndex={0}, CellIndex={1}", e.RowIndex, e.ColumnIndex)) 
            CustomerTableAdapter.Update(CustomerApps.Customer) 
            grdCustomers.Update() 
        End If 
        _cellModifyBegin = False 
    End Sub 
End Class 

Svett
Telerik team
 answered on 05 Nov 2010
11 answers
352 views

Hi!

 


VERSION: 2010 Q2 SP2

This is my simple application:

 


EditableCheckBoxCellElement:

 

  

namespace GridViewUnboundMode
{
    public class EditableCheckBoxCellElement : GridDataCellElement
    {
        private RadCheckBoxElement _chk;
        private RadTextBoxElement _txtBox;
  
        private CellValue _cellValue;
  
        public EditableCheckBoxCellElement(GridViewColumn column, GridRowElement row)
            : base(column, row)
        {
        }
  
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
  
            _chk = new RadCheckBoxElement();
            _chk.Margin = new Padding(2, 2, 2, 2);
            _chk.MinSize = new Size(10, 10);
            _chk.Text = string.Empty;
            _chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off;
            _chk.ToggleStateChanged += new StateChangedEventHandler(_chk_ToggleStateChanged);
  
            _txtBox = new RadTextBoxElement();
            _txtBox.Margin = new Padding(2, 2, 2, 2);
            _txtBox.MinSize = new Size(10, 10);
            _txtBox.Text = "sss";
  
            this.Children.Add(_chk);
            this.Children.Add(_txtBox);
        }
  
  
        void _chk_ToggleStateChanged(object sender, StateChangedEventArgs args)
        {
            if (_chk.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On)
            { _cellValue.IsAssigned = true; }
            else if (_chk.ToggleState == Telerik.WinControls.Enumerations.ToggleState.Off)
            { _cellValue.IsAssigned = false; }
        }
  
        protected override SizeF ArrangeOverride(SizeF finalSize)
        {
            if (this.Children.Count == 2)
            {
                this.Children[0].Arrange(new RectangleF(2, 2, 10, 10));
                this.Children[1].Arrange(new RectangleF(21, 2, finalSize.Width - 28 - 10, 15));
            }
            return finalSize;
        }
  
        public override object Value
        {
            get { return _cellValue; }
            set
            {
                _cellValue = value as CellValue;
                if (_cellValue != null)
                {
                    _txtBox.Text = _cellValue.Text;
                    this.IsChecked = _cellValue.IsAssigned;
                }
            }
        }
  
        public bool IsChecked
        {
            get
            {
                return _cellValue.IsAssigned;
            }
            set
            {
                if (value)
                { _chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On; }
                else
                { _chk.ToggleState = Telerik.WinControls.Enumerations.ToggleState.Off; }
                _cellValue.IsAssigned = value;
            }
        }
  
    }
}

EditableCheckBoxColumn:

 

 


namespace GridViewUnboundMode
{
    public class EditableCheckBoxColumn : GridViewDataColumn
    {
        public EditableCheckBoxColumn(): base()
        {
        }
   
        public override Type GetCellType(GridViewRowInfo row)
        {
            if (row is GridViewDataRowInfo)
            {
                return typeof(EditableCheckBoxCellElement);
            }        
            return base.GetCellType(row);
        }
    }
}

CellValue:

namespace GridViewUnboundMode
{
    public class CellValue
    {
        public string Text { get; set; }
        public bool IsAssigned { get; set; }
    }
}

Form1:

namespace GridViewUnboundMode
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            radGridView1.MultiSelect = true;
            radGridView1.AllowColumnChooser = false;
  
            GridViewDataColumn columnCSname = new GridViewTextBoxColumn();
            columnCSname.HeaderText = "Standard column";
            radGridView1.Columns.Add(columnCSname);
            columnCSname.Width = 160;
            columnCSname.ReadOnly = true;
  
            this.AddCustomColumns(4);
            this.AddNewRow();
            this.AddNewRow();
  
            columnCSname.IsPinned = true;
        }
  
        private void AddNewRow()
        {
            GridViewRowInfo rowInfo = this.radGridView1.Rows.AddNew();
            int columnIndex = 0;
            foreach (GridViewCellInfo cellInfo in rowInfo.Cells)
            {
                if (cellInfo.ColumnInfo.Index == 0)
                {
                    cellInfo.Value = string.Format("Standard column, Col: {0}, Row: {1}", cellInfo.ColumnInfo.Index, rowInfo.Index);
                }
                else
                {
                    CellValue cellValue = new CellValue();
                    cellValue.Text = string.Format("Col: {0}, Row: {1}", cellInfo.ColumnInfo.Index, rowInfo.Index);
  
                    cellInfo.Tag = cellValue;
                }
                columnIndex++;
            }
        }
  
        private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            EditableCheckBoxCellElement cellElement = e.CellElement as EditableCheckBoxCellElement;
            if (cellElement != null)
            {
                CellValue val = e.CellElement.RowInfo.Cells[e.CellElement.ColumnIndex].Tag as CellValue;
                cellElement.Value = val;
            }
        }
  
        private void AddCustomColumns(int count)
        {
            for (int index = 0; index < count; index++)
            {
                GridViewDataColumn newColumn = new EditableCheckBoxColumn();
                newColumn.HeaderText = "Col" + (radGridView1.Columns.Count + 1).ToString();
                newColumn.Name = newColumn.HeaderText;
                newColumn.Width = 120;
                if (radGridView1.Columns.Count == 0)
                { newColumn.IsPinned = true; }
                radGridView1.Columns.Add(newColumn);
            }
        }
    }
}

 

 

 

 


When I run application I see form from attachment viewAfterStartup.JPG. “Standard column” is pinned at left.

 


FIRST PROBLEM

 

If I resize window to smaller size then I have scroll bar on the bottom.

When I start scrolling to right I have problem with text box from custom cells – it overlaps on “Standard column”. This is weird because this problem is only for text box, for check box it is ok (check box does not overlap pinned column) – please check attachments “scrollingCheckBox-OK.JPG” and “scrollingTextBox-NOTok.JPG”. What is wrong in my source code?

 



SECOND PROBLEM

 

When I unpin “Standard column” I see in this column cells of class EditableCheckBoxCellElement. How it is possible? Name of column is correct but cells change type. Check attachment “unpinnedFirstColumn.JPG”.

 



Regards

Raymond
Top achievements
Rank 1
 answered on 05 Nov 2010
3 answers
167 views
Hi there,

Just a quick question for you all:  How can I get access to the SystemRows or the header row/cells of a child collection that's empty?  Generally if I wanted to access those guys for a row that already exists I'd go

((GridViewDataRowInfo)row).ViewInfo.SystemRows

or

((GridViewDataRowInfo)row).ViewInfo.TableHeaderRow

respectively, but I can't figure out how to get access to those guys for an empty child collection because there's no "row" object I can latch onto if the parent's ChildRows is empty.  I know they exist somewhere though because they're sitting there on my screen.  I just feel like I must be missing something simple.

For reference, I'd like to set the child NewRow as the currently selected row when a new hierarchy row is created (so insertion would drill through the hierarchy, following the way my users would prefer to enter data) and I need to force an InvalidateRow on a child HeaderRow so that it fires the ViewCellFormatting event when the value of a certain cell is changed (so I can set the header text of the child view even if there are no children yet).

As an aside, in an attempt to solve the second issue I've tried to fire the grid.TableElement.Update() method with a parameter of GridUINotifyAction.Reset and GridUINotifyAction.DataChanged in my grid_CellValueChanged event, and it's throwing exceptions up to my Main method (bypassing my try/catch around the actual Update() call).  Not sure if that's intentional/expected.

Thanks for any direction!
Brian Manning
Top achievements
Rank 1
 answered on 05 Nov 2010
1 answer
232 views
Hey, not sure if I am missing something here, but I am not finding any way to add a new value to the underlying data source when user types a value into the drop down list that does not currently exist. 

I mean, I have my own code that will handle this, I am jsut trying to determine the best time to do what is needed - if the user types in a value that does not exist in data bound list would it make sense to have the code in the TextChanges event, in the Validating event, or somewhere else?

Thanks!

Justin
Emanuel Varga
Top achievements
Rank 1
 answered on 05 Nov 2010
6 answers
211 views
Afternoon,

I've just got a strange behaviour from my gridviews. I recently updated my dataset and went about rebinding everything.

Since then however I have noticed that the alternating row colour no longer works. I am using the default colours.

The property window was telling me that it was set to true so I set this back to false and then to true again incase it had lost its setting but this changed nothing.

I have also set it to false/true inside both the property builder and set programmatically with the same result. I have also tried reopening the project.

Little bit stumped on this one, any one got any ideas?

Kind regards,

Guy
Richard Slade
Top achievements
Rank 2
 answered on 05 Nov 2010
1 answer
157 views
Hi,

I have a hierarchical grid and on the child grids (if there are more than one) on the same level, I'll get some nice captions as Tabs. Now I want these Tabs/Captions also for childgrids where only one grid at a specified level is and also for the MasterGridViewTemplate.

I'm setting already the captions, how can I show them?

Thanks,
Michael
Jack
Telerik team
 answered on 05 Nov 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?