It seems that the GridViewColumnGroup.MinHeight has a big influence on the height of the filter cell.
Workaround:
this.radGridView1.AutoSizeRows = true;
Please refer to the following code snippet demonstrating how the comparer can be applied:
public RadForm1()
{
InitializeComponent();
this.radGridView1.EnableFiltering = true;
this.radGridView1.ShowHeaderCellButtons = true;
this.radGridView1.FilterPopupInitialized += radGridView1_FilterPopupInitialized;
}
private void radGridView1_FilterPopupRequired(object sender, FilterPopupRequiredEventArgs e)
{
RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup;
if (popup != null)
{
popup.MenuTreeElement.TreeView.TreeViewElement.Comparer = new MyComparer(popup.MenuTreeElement.TreeView.TreeViewElement);
}
}
class MyComparer : TreeNodeComparer
{
public MyComparer(RadTreeViewElement treeView)
: base(treeView)
{
}
public override int Compare(RadTreeNode x, RadTreeNode y)
{
if (this.TreeViewElement.SortOrder == SortOrder.Descending)
{
return x.Text.CompareTo(y.Text);
}
return x.Text.CompareTo(y.Text) * -1;
}
}
I am currently working in Telerik v2019.3.917 and .Net 4.5.2. I have multiple theme's setup for a local application for my users but I am seeing something odd with the Telerik.WinControls.Themes.HighContrastBlack theme. It appears that I am unable to select more than one cell in this theme. My grid has multiselect as true and SelectionMode as CellSelect. I have tried holding ctrl and clicking cells, clicking the row header, holding the mouse down and dragging, and using Ctrl+A but none of these select more than one cell.
I am setting the application theme on launch:
var _t =
new
Telerik.WinControls.Themes.HighContrastBlackTheme();
ThemeResolutionService.ApplicationThemeName =
"HighContrastBlack"
;
Themes that work: All Fluents, All Material, All VS.
Is this a bug or am I missing something?
Dear Telerik Support Team,
I have a Grid with one level of Hierarchy, I am using also the search row control of Gridview but this control only searches the data in the Parent Grid and not in the child Grid, I am using the version: v.2019.2.618.20 of Telerik controls in the Project. Below is the code snippet which is used in the Project, please let us know how we can search in child grid using the search row of the Gridview.
radgvStockCount.DataSource = dtStockCountHeader
When pressing Enter or Tab in the new row the ParsingDateTime event is fired after the editor is validated. Use attached to reproduce.
private void GridView_CellEditorInitialized(object sender, GridViewCellEventArgs e)
We have upgraded from WinControl UI 2010 to 2019 R2.
we have a lot of non-data bound radgridview that we process our data and add each row manually.
The radgridView.Rows.Add(rowdatacolumn1, rowdatacolumn2, rowdatacolumn3) used to return the row index of the added row. It is now returning -1 .
This is breaking a lot of our code.
Hi,
I am working with the RadGridView in my c# winform application. I am using the custom font ("Font Awesome 5 Free Solid") for the RadGridView using the "CellFormatting" event to view the icons along with the text. Here i am able to see the proper icons with text but when i open the filter menu to filter out the rows, i am unable to see the icons (icons shown as the box) as in filterbox we don't have any custom font.
I tried to working out the properties of the RadTreeNodeCollection but here we dont have any Custom font property for the same.
i want to show the text as it is in the filterbox along with the text and the icon.
so can you suggest what i can do to view the icons in the filterbox?
Check the attachment for reference.
I might be missing something, but I have Hyperlinks in a column in my RadDatGridView.
I tried searching for a Support document explaining this, but didn't find any.
When the grid is exported to excel all data is coming across, but the column with hyperlink is not
a hyperlink in Excel.
Below is sample of the code used to make the "HyperLink" column in my grid.
radGridView1.DataSource = dtResults;
radGridView1.Columns.Remove("Path");
GridViewHyperlinkColumn col = new GridViewHyperlinkColumn();
radGridView1.Columns.Insert(5, col);
col.Width = 200;
col.FieldName = "Path";
col.HeaderText = "Path";
col.Name = "Path";
Coded used to do the Export....
GridViewSpreadExport spreadExporter = new GridViewSpreadExport(this.radGridView1);
spreadExporter.ExportVisualSettings = true;
SpreadExportRenderer exportRenderer = new SpreadExportRenderer();
spreadExporter.RunExport(filename, exportRenderer);
Thanks.
Roger
Hello,
In our Environment it's not possible to assign a GroupComparer to another GridView template then MasterTemplate. The GroupComparer property is always null after assignment.
It's possible to assign our custom comparer to the MasterTemplate and it will be triggered, but not in another template then MasterTemplate.
Best regards.
Tassilo Koller | Dipl. Informatiker (FH) | IT-Softwareentwicklung
[T] +49 (0)8233 381 383
[E] Tassilo.Koller@forum-media.com | [W] www.forum-verlag.com
FORUM MEDIA GROUP GMBH| Mandichostraße 18 | 86504 Merching | [T] +49 (0)8233 381-0 | [F] + 49 (0)8233 381-222 | [W] www.forum-media.com| Sitz der Gesellschaft: Merching | Register: AG Augsburg HRB 11537 | Geschäftsführer: Magdalena Balanicka, Norbert Bietsch, Roland Hradek, Mihaela Mravlje | Beirat: Ronald Herkert (Vorsitzender)
Elektronische Rechnungen bitte an folgende Adresse senden: invoice@forum-media.com
Using a custom control using the Telerik Presentation Framework, I am receiving a NullException inside the GridCheckBoxHeaderCellElement during the GridViewElement's data load.
The custom control construction follows an example I found somewhere (reference is lost to me at this point):
ControlContainingGridView inherits from RadControl
CreateChildItems creates and adds ControlContainingGridViewElement
ControlContainingGridViewElement inherits from RadElement
CreateChildItems creates and adds some layout controls AND a GridViewElement
public partial class ControlContainingGridView : RadControl {
public ControlContainingGridView() {
InitializeComponent();
this.TextChanged += ControlContainingGridView_TextChanged;
}
private void ControlContainingGridView_TextChanged(object sender, EventArgs e) {
controlContainingGridViewElement.Text = this.Text;
}
private ControlContainingGridViewElement controlContainingGridViewElement = null;
protected override void CreateChildItems(RadElement parent) {
controlContainingGridViewElement = new ControlContainingGridViewElement();
this.RootElement.Children.Add(controlContainingGridViewElement);
base.CreateChildItems(parent);
}
public object DataSource {
get {
return controlContainingGridViewElement.GridView.Template.DataSource;
}
set {
try {
controlContainingGridViewElement.GridView.Template.DataSource = value;
} catch (Exception ex) {
Debug.WriteLine(ex);
}
}
}
internal void SetupColumns(Action<MasterGridViewTemplate> setupColumns) {
controlContainingGridViewElement.GridView.Template.AutoGenerateColumns = false;
setupColumns(controlContainingGridViewElement.GridView.Template);
}
}
public class ControlContainingGridViewElement : RadElement {
private TextPrimitive textPrimitive = null;
private RadButtonElement addButton = null;
private RadButtonElement deleteButton = null;
private RadGridViewElement gridViewElement = null;
public RadGridViewElement GridView { get { return gridViewElement; } }
public bool ShowAddButton { get { return addButton.Visibility == ElementVisibility.Visible; } set { addButton.Visibility = value ? ElementVisibility.Visible : ElementVisibility.Collapsed; } }
public bool ShowDeleteButton { get { return deleteButton.Visibility == ElementVisibility.Visible; } set { deleteButton.Visibility = value ? ElementVisibility.Visible : ElementVisibility.Collapsed; } }
public string Text { get { return textPrimitive.Text; } set { textPrimitive.Text = value; } }
protected override void CreateChildElements() {
DockLayoutPanel dlp = new DockLayoutPanel();
dlp.StretchHorizontally = true;
dlp.StretchHorizontally = true;
dlp.LastChildFill = true;
DockLayoutPanel dlpBar = new DockLayoutPanel();
dlpBar.StretchHorizontally = true;
DockLayoutPanel.SetDock(dlpBar, Dock.Top);
var imagePrimitive = new ImagePrimitive();
DockLayoutPanel.SetDock(imagePrimitive, Dock.Left);
textPrimitive = new TextPrimitive();
DockLayoutPanel.SetDock(textPrimitive, Dock.Left);
var slp = new StackLayoutPanel();
DockLayoutPanel.SetDock(slp, Dock.Right);
var addButton = new RadButtonElement {
Text = "Add",
MaxSize = new Size() { Height = 20 }
};
var deleteButton = new RadButtonElement {
Text = "Del",
MaxSize = new Size() { Height = 20 }
};
slp.Children.Add(addButton);
slp.Children.Add(deleteButton);
dlpBar.Children.Add(slp);
dlpBar.Children.Add(imagePrimitive);
dlpBar.Children.Add(textPrimitive);
gridViewElement = new RadGridViewElement {
StretchHorizontally = true,
StretchVertically = true
};
gridViewElement.Template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
gridViewElement.Template.AllowAddNewRow = false;
gridViewElement.Template.AllowDeleteRow = false;
gridViewElement.Template.AllowDragToGroup = false;
gridViewElement.ShowGroupPanel = false;
gridViewElement.ShowGroupPanelScrollbars = false;
dlp.Children.Add(dlpBar);
dlp.Children.Add(gridViewElement);
this.Children.Add(dlp);
base.CreateChildElements();
}
}
During Form load, I programmatically add columns and provide a binding source
private List<SampleModel> sampleModels = new List<SampleModel>();
private BindingSource sampleModelsBinding = new BindingSource();
private void RadForm1_Load(object sender, EventArgs e) {
sampleModels.Add(new SampleModel() {
When = DateTime.Parse("1980-04-23"),
SomeText = "Purple Bananas",
IsTrue = true
});
sampleModels.Add(new SampleModel() {
When = DateTime.Parse("2002-07-20"),
SomeText = "Ball & Chain",
IsTrue = false
});
sampleModelsBinding.DataSource = sampleModels;
controlContainingGridView.SetupColumns((grid) => {
grid.AddDateTimeColumn(nameof(SampleModel.When), "When");
grid.AddTextBoxColumn(nameof(SampleModel.SomeText), "Some Text");
grid.AddCheckBoxColumn(nameof(SampleModel.IsTrue), "Is True");
});
controlContainingGridView.DataSource = sampleModelsBinding;
}
Inclusion of the CheckBox column results in the following error:
Exception thrown: 'System.NullReferenceException' in Telerik.WinControls.GridView.dll
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.WinControls.UI.GridCheckBoxHeaderCellElement.Attach(GridViewColumn data, Object context)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.InsertElement(Int32 position, IVirtualizedElement`1 element, T data)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.UpdateElement(Int32 position, T data)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.GridVirtualizedRowElement.MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
at Telerik.WinControls.UI.LightVisualElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.UI.GridRowElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.VirtualizedStackContainer`1.MeasureElementCore(RadElement element, SizeF availableSize)
at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureElementCore(RadElement element, SizeF availableSize)
at Telerik.WinControls.UI.VirtualizedStackContainer`1.MeasureElement(IVirtualizedElement`1 element)
at Telerik.WinControls.UI.PinnedRowsContainerElement.MeasureElement(IVirtualizedElement`1 element)
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureElements()
at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.RowsContainerElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.UI.ScrollViewElement`1.MeasureViewElement(SizeF availableSize)
at Telerik.WinControls.UI.ScrollViewElement`1.MeasureView(SizeF availableSize)
at Telerik.WinControls.UI.ScrollViewElement`1.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.UI.GridTableElement.MeasureOverride(SizeF availableSize)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.Layouts.DockLayoutPanel.MeasureOverride(SizeF constraint)
at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
at Telerik.WinControls.UI.GridVisibilityHelper.EnsureRowVisible(GridViewRowInfo rowInfo)
at Telerik.WinControls.UI.GridTableElement.EnsureRowVisible(GridViewRowInfo rowInfo)
at Telerik.WinControls.UI.GridTableElement.EnsureCellVisible(GridViewRowInfo rowInfo, GridViewColumn column)
at Telerik.WinControls.UI.GridTableElement.UpdateViewCore(Object sender, DataViewChangedEventArgs args)
at Telerik.WinControls.UI.GridTableElement.UpdateView(Object sender, DataViewChangedEventArgs args)
at Telerik.WinControls.UI.GridTableElement.ProcessTemplateEvent(GridViewEvent eventData)
at Telerik.WinControls.UI.GridTableElement.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(GridViewEvent eventData)
at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(GridViewEvent gridEvent, PriorityWeakReferenceList list, GridEventProcessMode processMode)
at Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessEvent(GridViewEvent gridEvent)
at Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(GridViewEvent gridEvent)
at Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents()
at Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewEvent gridEvent)
at Telerik.WinControls.UI.GridViewSynchronizationService.RaiseCurrentChanged(GridViewTemplate template, GridViewRowInfo row, GridViewColumn column, Boolean user)
at Telerik.WinControls.UI.GridViewTemplate.CollectionView_CurrentChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Telerik.WinControls.Data.RadCollectionView`1.OnCurrentChanged(EventArgs args)
at Telerik.WinControls.Data.RadCollectionView`1.SetCurrentPositionCore(Int32 newPosition, Boolean forceNotify, CurrentChangeReason reason)
at Telerik.WinControls.Data.RadListSource`1.InitializeCurrentItem()
at Telerik.WinControls.Data.RadListSource`1.Initialize()
at Telerik.WinControls.Data.RadListSource`1.Bind(Object dataSource, String dataMember)
at Telerik.WinControls.Data.RadListSource`1.set_DataSource(Object value)
at Telerik.WinControls.UI.GridViewTemplate.set_DataSource(Object value)
at BugReproduction.ControlContainingGridView.set_DataSource(Object value) in ...\BugReproduction\BugReproduction\ControlContainingGridView.cs:line 42
Please refer to the attached gif file. You will notice that for the GridViewMaskBoxColumn with numeric mask the filtering doesn't work. For the other columns each key stroke filters the grid rows.
Workaround: either use a GridViewDecimalColumn or change the default editor for the GridViewMaskBoxColumn :