The CellFormating example of RadGridView formats in red color not only FirstName column's cells.
Make possible users easily to change the behavior of replacing the null value with empty string. Workaround: DataTable table = new DataTable("table"); table.Columns.Add("ID", typeof(int)); DataColumn col = table.Columns.Add("Name", typeof(string)); col.AllowDBNull = false; col.DefaultValue = string.Empty; table.ColumnChanging += new DataColumnChangeEventHandler(table_ColumnChanging); this.radGridView1.DataSource = table; private void table_ColumnChanging(object sender, DataColumnChangeEventArgs e) { if (!e.Column.AllowDBNull && (e.ProposedValue == DBNull.Value || e.ProposedValue == null) && e.Column.DataType == typeof(string)) { e.ProposedValue = string.Empty; } }
To reproduce: - Open the Excel Like Filtering demo - Open a the excel like filtering dialog and select Available Filter > Custom - Select Contains in both drop downs and press OK
The following code exhibits the problem. All you have to do is click the Wrapper column cell and bring down the dropdown. Then select the Phase column. You will get the app to crash in the FilterWrappers method. namespace RadControlsWinFormsApp2 { public partial class Form1 : Form { private String[] dataPhases = null; private String[] dataWrappers = null; public class Data { public Data(int ID, string Phase, int Wrapper) { this.ID = ID; this.Phase = Phase; this.Wrapper = Wrapper; } public int ID { get; set; } public String Phase { get; set; } public int Wrapper { get; set; } } public Form1() { InitializeComponent(); this.radGridView1.DataSource = new Data[] { new Data(1, "A", 1), new Data(2, "B", 2) }; } private void Form1_Load(object sender, EventArgs e) { GridViewComboBoxColumn columnPhase = radGridView1.Columns["PHASE"] as GridViewComboBoxColumn; dataPhases = new String[] { "A", "B", "C", "A/B/C" }; GridViewComboBoxColumn columnWrapper = radGridView1.Columns["WRAPPER"] as GridViewComboBoxColumn; dataWrappers = new String[] { "", "1", "2" }; columnWrapper.DataSource = dataWrappers; columnPhase.DataSource = dataPhases; } private void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e) { if (e.Column is GridViewComboBoxColumn) { RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor; if (editor != null) { RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)editor.EditorElement; editorElement.Filter = null; } } switch (e.Column.Name) { case "WRAPPER": { GridViewComboBoxColumn cbc = e.Column as GridViewComboBoxColumn; cbc.DataSource = dataWrappers; RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor; if (editor != null) { RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)editor.EditorElement; editorElement.Filter = FilterWrappers; } } break; case "PHASE": { GridViewComboBoxColumn cbc = e.Column as GridViewComboBoxColumn; cbc.DataSource = dataPhases; } break; } } private bool FilterWrappers(RadListDataItem item) { int nWrapper = 0; if (item.Value.ToString() != String.Empty) nWrapper = Convert.ToInt32(item.Value); return true; } } }
The following HTMLViewDefinition has a wrong layout when run: HtmlViewDefinition view = new HtmlViewDefinition(); view.RowTemplate.Rows.Add(new RowDefinition()); view.RowTemplate.Rows.Add(new RowDefinition()); view.RowTemplate.Rows.Add(new RowDefinition()); view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("column0", 0, 1, 1)); view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("column1", 0, 1, 3)); view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("column2", 0, 1, 1)); view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("column3", 0, 1, 2)); view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("column4", 0, 1, 1)); view.RowTemplate.Rows[2].Cells.Add(new CellDefinition("column5", 0, 1, 1)); The layout puts column5 over column1. A possible workaround would be to refresh the rows in the grid's SizeChanged event handler: private void RadGridView1_SizeChanged(object sender, EventArgs e) { radGridView1.TableElement.ViewElement.UpdateRows(true); }
FIX. RadGridView - seting the HeaderImage of a column in the PropertyBuilder results in Object Reference message
Consider the iTunes Artist mode grid http://www.telerik.com/forums/itunes-like-grid
There should be an option which allows the users to turn off the escaping of special characters when exporting to ExcelML.
Allow setting the CurrentColumn/CurrentCell in the RowValidaging event
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.