Hi,
I have a requirement to show a column congtaining waiting bar dot rings in a grid view.
I have the currentcode which defines the custom cell and also the custom column
//////////////////////////////////////
// custom cell
//////////////////////////////////////
public class WaitingDotsRingCellElement : GridDataCellElement
{
private RadWaitingBarElement waitingElement;
private DotsRingWaitingBarIndicatorElement ringElement;
public WaitingDotsRingCellElement ( GridViewColumn column, GridRowElement row )
: base ( column, row )
{
}
protected override void CreateChildElements ( )
{
base.CreateChildElements ();
ringElement = new DotsRingWaitingBarIndicatorElement ();
ringElement.DotRadius = 4;
ringElement.LastDotRadius = 1;
ringElement.Radius = 10;
ringElement.ElementCount = 8;
ringElement.NumberOfColors = 4;
ringElement.ElementColor = Color.Red;
waitingElement = new RadWaitingBarElement ();
waitingElement.WaitingIndicators.Clear ();
waitingElement.WaitingSpeed = 40;
waitingElement.WaitingStyle = WaitingBarStyles.DotsRing;
waitingElement.WaitingIndicators.Add (ringElement );
Children.Add ( waitingElement );
}
protected override void SetContentCore ( object value )
{
if ( Value != null && Value != DBNull.Value )
{
if ( Convert.ToInt32 ( Value ) == 0 )
{
waitingElement.StopWaiting ();
}
else if ( Convert.ToInt32 ( Value ) == 1 )
{
waitingElement.StartWaiting ();
}
}
}
public override bool IsCompatible ( GridViewColumn data, object context )
{
return data is WaitingDotsRingColumn && context is GridDataRowElement;
}
protected override Type ThemeEffectiveType
{
get
{
// Ensures the cell inherits grid cell styling
return typeof ( GridDataCellElement );
}
}
} // WaitingDotsRingCellElement
//////////////////////////////////////
// custom column
//////////////////////////////////////
public class WaitingDotsRingColumn : GridViewDataColumn
{
public WaitingDotsRingColumn(string fileName ) : base(fileName)
{
}
public override Type GetCellType ( GridViewRowInfo row )
{
if ( row is GridViewDataRowInfo )
{
return typeof ( WaitingDotsRingCellElement );
}
return base.GetCellType ( row );
}
} // WaitingDotsRingColumnMy issue is that the properties "radius" and "element count" are not being set correctly, however other properties such as element color are being set correctly.
My grid view row height is being set to 32 via gridView.TableElement.RowHeight
In addition, how do i get rid of the "button" effect appearing in the cell background?
Kind regards
Toby

Hi, I have a requirement to have multiple icons in a cell, I have created a custom GridViewDataColumn and a GridDataCellElement
My current implementation has 2 issues, the icons don't appear until you enter or leave a row (in which case only those rows icons get displayed), or when you click on the column (in which case all the visible rows display their icons.
The second issue is that, since I can scroll horizontally, when scrolling right, the cell locations that end up under the location of my icons cells, when you scroll left again, they appear empty, and you need to reload the Datasource or scroll multiple times vertically for them to appear again.
What I'm doing right now is overriding the ArrangeOverride, to locate the icons on the cell with Children[i].Arrange, and creating the icons overriding SetContent and OnCellFormatting and creating LightVisualElements there, calling Children.Clear() at the beginning of the methods.
I'll try to post an example later but has anyone had an issue like this before?


I have what seems like a simple task.
My grid looks like this:
and I create it by pulling the data and passing it to the SetupGrid() method (partially) shown below which creates the columns and sets the DataSource. This part works fine.
private void SetupGrid(RadGridView grid,
List<Dictionary>? dictionaryList,
List<CreditInquirySetupEF>? efList,
List<CreditInquirySetupTU>? tuList)
{
grid.Columns.Clear();
grid.Rows.Clear();
grid.Templates.Clear();
grid.MasterTemplate.AutoGenerateColumns = true;
grid.MasterTemplate.ReadOnly = true;
grid.MasterTemplate.ShowChildViewCaptions = false;
grid.MasterTemplate.ShowRowHeaderColumn = false;
grid.ShowRowHeaderColumn = false;
grid.ShowChildViewCaptions = false;
GridViewTemplate template1 = new GridViewTemplate();
GridViewTemplate templateApp = new GridViewTemplate();
if (efList is not null)
{
template1.AutoGenerateColumns = false;
template1.DataSource = null;
template1.DataSource = efList;
template1.AllowAddNewRow = false;
template1.ReadOnly = true;
template1.ShowRowHeaderColumn = false;
template1.Caption = string.Empty;
grid.MasterTemplate.Templates.Add(template1);
template1.MasterTemplate.ShowChildViewCaptions = false;
GridViewRelation relation1 = new GridViewRelation(grid.MasterTemplate);
relation1.ChildTemplate = template1;
relation1.RelationName = "EQVendorID";
relation1.ParentColumnNames.Add("DictionaryKey");
relation1.ChildColumnNames.Add("VendorID");
grid.Relations.Add(relation1);
}
if (tuList is not null)
{
templateApp.AutoGenerateColumns = false;
templateApp.DataSource = null;
templateApp.DataSource = tuList;
templateApp.AllowAddNewRow = false;
templateApp.ReadOnly = true;
templateApp.ShowRowHeaderColumn = false;
templateApp.ShowChildViewCaptions = false;
grid.MasterTemplate.Templates.Add(templateApp);
GridViewRelation relationApp = new GridViewRelation(grid.MasterTemplate);
relationApp.ChildTemplate = templateApp;
relationApp.RelationName = "TUVendorID";
relationApp.ParentColumnNames.Add("DictionaryKey");
relationApp.ChildColumnNames.Add("VendorID");
grid.Relations.Add(relationApp);
}
grid.DataSource = null;
grid.DataSource = dictionaryList;
grid.MasterTemplate.Columns["BranchID"].IsVisible = false;
grid.MasterTemplate.Columns["DictionaryID"].IsVisible = false;
grid.MasterTemplate.Columns["DictionaryKey"].IsVisible = false;
grid.MasterTemplate.Columns["DictionaryKeyString"].IsVisible = false;
grid.MasterTemplate.Columns["DictionaryTypeID"].IsVisible = false;
grid.MasterTemplate.Columns["Active"].IsVisible = false;
grid.MasterTemplate.Columns["Description"].Width = 300;
grid.MasterTemplate.Columns["Description"].HeaderText = "Bureau Name";
grid.MasterTemplate.Columns["Description"].HeaderTextAlignment = ContentAlignment.MiddleLeft;
var buttonCol = new GridViewImageColumn();
buttonCol = new GridViewImageColumn();
buttonCol.HeaderText = "";
buttonCol.Name = "Propertys";
buttonCol.HeaderImage = VisionUI.Properties.Resources.Plus_13;
buttonCol.Width = 30;
buttonCol.AllowSort = false;
grid.MasterTemplate.Columns.Add(buttonCol);
if (efList is not null)
{
grid.MasterTemplate.Templates[0].Caption = "";
var column = new GridViewTextBoxColumn();
column.FieldName = "VendorID";
column.Name = "VendorID";
column.IsVisible = false;
grid.MasterTemplate.Templates[0].Columns.Add(column);
column = new GridViewTextBoxColumn();
column.FieldName = "SettingsBranchID";
column.Name = "SettingsBranchID";
column.IsVisible = false;
grid.MasterTemplate.Templates[0].Columns.Add(column);
column = new GridViewTextBoxColumn();
column.FieldName = "ServiceName";
column.Name = "ServiceName";
column.Width = 145;
column.HeaderText = "Service Name";
column.HeaderTextAlignment = ContentAlignment.MiddleLeft;
column.TextAlignment = ContentAlignment.MiddleLeft;
column.IsVisible = true;
grid.MasterTemplate.Templates[0].Columns.Add(column);The problem comes when I delete a row in the subgrid and physically removing it from the db table. I tried removing the deleted entry from the collection and refreshing and even pulling the data from the database again like this:
int settingsBranchID = absUIControls.GetGridValueInt(gvServiceNames, "SettingsBranchID");
await creditInquirySetupEF.DeleteServiceNameAsync(settingsBranchID);
await creditInquirySetupTU.DeleteServiceNameAsync(settingsBranchID);
vendorList = CommonServices.GetDictionary(EDictionaryType.CreditInquiryVendor, creditInquirySetupEF.BranchID, false);
creditInquirySetupEFList = await creditInquirySetupEF.GetCreditInquirySetupEFAsync(creditInquirySetupEF.BranchID);
creditInquirySetupTUList = await creditInquirySetupTU.GetCreditInquirySetupTUAsync(creditInquirySetupTU.BranchID);
gvServiceNames.DataSource = null;
gvServiceNames.Templates[0].DataSource = null;
gvServiceNames.Templates[1].DataSource = null;
gvServiceNames.DataSource = vendorList;
gvServiceNames.Templates[0].DataSource = creditInquirySetupEFList;
gvServiceNames.Templates[1].DataSource = creditInquirySetupTUList;
gvServiceNames.Refresh();
gvServiceNames.Templates[0].Refresh();
gvServiceNames.Templates[1].Refresh();
foreach (var item in gvServiceNames.Rows)
{
item.IsExpanded = true;
}
gvServiceNames.Templates[0].Rows[0].IsSelected = true;When I reassign the datasources, for some reason the top grid formats like this:
Any ideas as to why?
Thanks
Carl

private void radGridView1_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
{
var cellElement = e.ContextMenuProvider as GridCellElement;
if (cellElement == null) return;
if (cellElement is GridHeaderCellElement)
{
RadMenuItem exportExcel = new RadMenuItem($"ExportToExcel");
exportExcel.Click += (s, args) => { ExportToExcel(); };
e.ContextMenu.Items.Add(exportExcel);
}
}
After upgrade to UI.for.WinForms.AllControls.Net80 <Version>2025.4.1321
cellElement is null in the above line
then return
i can not see "RadMenuItem($"ExportToExcel")"
WHY?

Hello.

I'm trying to eliminate the tab that says table on the subgrids below. I've tried
template1.ShowChildViewCaptions = false;
template1.MasterTemplate.ShowChildViewCaptions = false;
grid.ShowChildViewCaptions = false;
grid.MasterTemplate.ShowChildViewCaptions = false;
Nothing works. What am I doing wrong?
Thanks
Carl


i have a Master-Detail CRUD Job
Details shown using RADGRIDVIEW
for example : Master is "TBSYUSER" class Detail is "TBSYUSAU" class
change master will change detail data
i using BindingList<TBSYUSAU> --> BindingSource -> RADGRIDVIEW
now if detail data's count varing a little large
ex: record count change from 1 to 89 due to master change
RADGRIDVIEW refresh will take more times
should i change strucuture to : Datatable --> BindingSource -> RADGRIDVIEW
or have some suggestion ?
TKs
