Resolution: Individual cells cannot have specific FormatString since the property is bound to column's FormatString
http://www.telerik.com/forums/gridview---adding-a-third-hierarchy-or-level#HdPZFtCJR0q1OCXxVR5wjg Dim ID As New GridViewDecimalColumn() ID.Name = "ID" ID.HeaderText = "Id" RadGridView1.MasterTemplate.Columns.Add(ID) Dim Name As New GridViewTextBoxColumn() Name.Name = "Name" Name.HeaderText = "Name" Name.Width = 100 RadGridView1.MasterTemplate.Columns.Add(Name) Dim Under_Appeal As New GridViewCheckBoxColumn() Under_Appeal.DataType = GetType(Boolean) Under_Appeal.Name = "Under_Appeal" Under_Appeal.HeaderText = "Under Appeal" RadGridView1.MasterTemplate.Columns.Add(Under_Appeal) Dim Terminated As New GridViewCheckBoxColumn() Terminated.DataType = GetType(Boolean) Terminated.Name = "Terminated" Terminated.HeaderText = "Terminated" RadGridView1.MasterTemplate.Columns.Add(Terminated) Dim Hash As New GridViewDecimalColumn() Hash.Name = "Hash" Hash.HeaderText = "#" RadGridView1.MasterTemplate.Columns.Add(Hash) RadGridView1.Rows.Add(1, "John", True, True) RadGridView1.Rows.Add(2, "Mary", True, False) RadGridView1.Rows.Add(3, "Peter", False, True) Dim template As New GridViewTemplate template.Columns.Add(New GridViewDecimalColumn("ParentID")) template.Columns.Add(New GridViewTextBoxColumn("TEXT")) template.Columns.Add(New GridViewDecimalColumn("PRICE")) RadGridView1.MasterTemplate.Templates.Add(template) Dim relation As New GridViewRelation(RadGridView1.MasterTemplate) relation.ChildTemplate = template relation.RelationName = "PersonProduct" relation.ParentColumnNames.Add("ID") relation.ChildColumnNames.Add("ParentID") RadGridView1.Relations.Add(relation) template.Rows.Add(1, "sugar", 2.0) template.Rows.Add(1, "cake", 12.0) template.Rows.Add(1, "butter", 3.0) template.Rows.Add(2, "cake", 12.0) Dim template2 As New GridViewTemplate template2.Columns.Add(New GridViewDecimalColumn("ParentID2")) template2.Columns.Add(New GridViewTextBoxColumn("TYPE")) template2.Columns.Add(New GridViewDecimalColumn("QTY")) RadGridView1.MasterTemplate.Templates(0).Templates.Add(template2) Dim relation2 As New GridViewRelation(RadGridView1.MasterTemplate.Templates(0)) relation2.ChildTemplate = template2 relation2.RelationName = "PersonProduct2" relation2.ParentColumnNames.Add("ParentID") relation2.ChildColumnNames.Add("ParentID2") RadGridView1.Relations.Add(relation2) template2.Rows.Add(1, "brown", 1) template2.Rows.Add(1, "whiter", 3) template2.Rows.Add(2, "banana", 2) I am getting errors at runtime when I try to see the 3rd level in the hyerarchy.
1. Create new project and add RadButton. 2. On button click show the same instance of RadColorDialog. 3. Before calling the ShowDialog method change the SelectedColor property to a random value. 4. Run the project and click the button several times.
Add a feature for default image similar to the DefaultText.
Currently, if there are not enough rows to fill the height of RadGridView control, the pinned row will appear right after the last row. It will be good to facilitate customization that sets the pinned row to appear at the bottom of the grid. Same logic holds for summary rows and columns. Workaround: public Form1() { InitializeComponent(); DataTable dt = new DataTable(); dt.Columns.Add("Id"); dt.Columns.Add("Name"); for (int i = 0; i < 5; i++) { dt.Rows.Add(i, "Item" + i); } this.radGridView1.DataSource = dt; this.radGridView1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; this.radGridView1.AllowSearchRow = true; this.radGridView1.SearchRowPosition = Telerik.WinControls.UI.SystemRowPosition.Bottom; this.radGridView1.ViewDefinition = new CustomTableViewDefition(); } public class CustomTableViewDefition : TableViewDefinition { public override IRowView CreateViewUIElement(GridViewInfo viewInfo) { return new CustomTableElement(); } } public class CustomTableElement : GridTableElement { protected override RowsContainerElement CreateViewElement() { return new CustomRowsContainerElement(); } } public class CustomRowsContainerElement : RowsContainerElement { protected override SizeF ArrangeOverride(SizeF finalSize) { float y = 0; this.TopPinnedRows.Arrange(new RectangleF(0, y, finalSize.Width, this.TopPinnedRows.DesiredSize.Height)); y += this.TopPinnedRows.DesiredSize.Height + ElementSpacing; this.ScrollableRows.Arrange(new RectangleF(0, y, finalSize.Width, this.ScrollableRows.DesiredSize.Height)); y += this.ScrollableRows.DesiredSize.Height + ElementSpacing; this.BottomPinnedRows.Arrange(new RectangleF(0, finalSize.Height - this.BottomPinnedRows.DesiredSize.Height, finalSize.Width, this.BottomPinnedRows.DesiredSize.Height)); return finalSize; } }
i use a radgridview whits does not allow edit. i press control-v at a cell and it pastes to the cellvalue the last copied to clipboard text. is there a way to do that only if the grid allows edit?
Workaround, use the Pasting event of RadGridView and perform the needed validation
Expanding a newly added row in a grid with ChildViewTabsPosition set to Left or Right, InvalidOperationException is thrown. The issue can be reproduced in both bound and unbound mode.
1. Create new project with RadGridView. 2. Set the SelectionMode to CellSelecitonMode. 3. Set the MultiSelect property to true. 4. Run the project, select some cells, right-click to show the context menu and select the Copy option. 5. Open a notepad and click Paste.
Steps to reproduce: 1. Add a RadGridView to a form and fill it with data so there would be a vertical scroll bar 2. Set AutoSizeRows to true 3. Run the project and call RadGridView.PrintPreview() method 4. You will see that only the rows that are visible in the RadGirdView or have been scrolled to will have a correct height.
Steps to reproduce: 1. Add a RadGridView to form 2. Add a hyperlink column and set its width to say 100. 3. Add a row in the column with a text measuring than 100 in width. 4. Run the project and you will see that the text will be cropped without "..." in its end.
1. Create a new project and open a form at design time 2. Drop RadGridView on the form 3. Add some columns 4. Open the Columns collection for edit 5. Select a column 6. Select the FilterDescriptor property and try to show its dialog
Workaround: use the following custom editor: using System; using Telerik.WinControls.UI; namespace radGridView_MultipleFilters { public class CustomRadMultiColumnComboBoxElement : RadMultiColumnComboBoxElement { protected override Type ThemeEffectiveType { get { return typeof(RadMultiColumnComboBoxElement); } } public GridViewDataColumn DisplayColumn { get { string displayMember = this.DisplayMember; if (string.IsNullOrEmpty(displayMember)) { for (int i = 0; i < this.MultiColumnPopupForm.EditorControl.Columns.Count; i++) { if (this.MultiColumnPopupForm.EditorControl.Columns[i].DataType == typeof(string)) { displayMember = this.MultiColumnPopupForm.EditorControl.Columns[i].FieldName; break; } } if (this.MultiColumnPopupForm.EditorControl.Columns.Count > 0 && string.IsNullOrEmpty(displayMember)) { displayMember = this.MultiColumnPopupForm.EditorControl.Columns[0].FieldName; } } DisplayMember = displayMember; GridViewDataColumn[] columns = this.MultiColumnPopupForm.EditorControl.Columns.GetColumnByFieldName(displayMember); if (columns.Length > 0) { return columns[0]; } return null; } } protected override object FindItemExact(string text) { int index = this.FindItemIndexExact(text); if (index != -1) { return this.EditorControl.ChildRows[index]; } return null; } protected override void SetActiveItem(string text) { int rowIndex = this.FindItemIndexExact(text); if (rowIndex != -1) { this.EditorControl.CurrentRow = this.EditorControl.ChildRows[rowIndex]; this.Select(this.Text.Length, 0); } } protected override int FindItemIndexExact(string text) { GridViewRowInfo rowInfo = this.FindItemExact(text, this.DisplayColumn.Name); if (rowInfo != null) { return rowInfo.Index; } return -1; } protected override GridViewRowInfo FindItemExact(string text, string field) { GridViewDataColumn[] foundColumns = this.EditorControl.Columns.GetColumnByFieldName(field); if (foundColumns.Length > 0) { for (int i = 0; i < this.EditorControl.ChildRows.Count; i++) { object element = this.EditorControl.ChildRows[i].Cells[foundColumns[0].Name].Value; string elementText = Convert.ToString(element); if (!string.IsNullOrEmpty(elementText) && elementText.Equals(text, this.EditorControl.MasterTemplate.CaseSensitive ? StringComparison.InvariantCulture : StringComparison.InvariantCultureIgnoreCase)) { return this.EditorControl.ChildRows[i]; } } } return null; } } }
When the UserDeletingRow and UserDeletedRow are fired in multi cell selection mode, the event arguments should contains the rows of the selected cells.
ADD. RadTimePicker localization provider
This issue appears when using hierarchy and the row height is customized.
When i press control-c at a gridviewcell and paste it to notepad or another telerik control it looks like this.if i paste it to excel it works fine.
Wrapping text in ColumnsGroupViewDefinition does not affect the size of the cells.
FIX. RadGridView - when AlternatingRowColors is enabled and the grid is sorted the colorized rows are wrong.
Makes RadGridView to be thread safe by using from BackgroundWorker