Telerik Forums
UI for WinForms Forum
1 answer
114 views

Hi, im using Hierarchy data that got stuck on show totals with gridviewgroup but the values always zero on childtemplate

i'm attached files with no group and it works fine. otherwise still zero if using group on childtemplate.

        private void SetDataGridTemplate()
        {
            this.datagrid.Columns.Clear();
            this.datagrid.GroupDescriptors.Clear();
            this.datagrid.Templates.Clear();
            this.datagrid.Relations.Clear();

            this.datagrid.Columns.AddRange(
                new GridViewDecimalColumn("idsub"),
                new GridViewTextBoxColumn("name"),
                    new GridViewTextBoxColumn("unit"),
                new GridViewDecimalColumn("price"));

            var child = new GridViewTemplate();
            child.Columns.AddRange(
                new GridViewDecimalColumn("idsub"),
                new GridViewTextBoxColumn("itemname"),
                new GridViewDecimalColumn("qty"),
                new GridViewTextBoxColumn("satuan"),
                new GridViewDecimalColumn("price"),
                new GridViewDecimalColumn("total"),
                new GridViewDecimalColumn("idcategory"),
                new GridViewTextBoxColumn("category")
                );
            this.datagrid.Templates.Add(child);
            var grupKategori = new GroupDescriptor
            {
                Format = "{0}{1}"
            };
            grupKategori.GroupNames.Add("idcategory", ListSortDirection.Ascending);
            grupKategori.GroupNames.Add("category", ListSortDirection.Ascending);
            this.datagrid.Templates[0].GroupDescriptors.Add(grupKategori);

            var item1 = new GridViewSummaryItem { Name = "price", Aggregate = GridAggregateFunction.Sum, FormatString = "" };
            var item2 = new GridViewSummaryItem { Name = "total", Aggregate = GridAggregateFunction.Sum, FormatString = "{0:0}" };
            var rowSummary = new GridViewSummaryRowItem(new[] { item1, item2 });
            this.datagrid.Templates[0].SummaryRowsBottom.Add(rowSummary);

            this.datagrid.Templates[0].ShowParentGroupSummaries = true;
            this.datagrid.Templates[0].ShowTotals = true;

            var relation = new GridViewRelation();
            relation.ParentTemplate = this.datagrid.MasterTemplate;
            relation.ChildTemplate = this.datagrid.Templates[0];
            relation.ParentColumnNames.Add("idsub");
            relation.ChildColumnNames.Add("idsub");
            this.datagrid.Relations.Add(relation);
        }

        private void buttonLoad_Click(object sender, EventArgs e)
        {
            this.SetDataGridTemplate();
            this.datagrid.DataSource = GetParentSource();
            this.datagrid.Templates[0].DataSource = GetChildSource();
        }

        private void datagrid_GroupSummaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
        {
            switch (e.SummaryItem.Name)
            {
                case "idcategory":
                    string[] arr = e.Value.ToString().Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                    string strvalue = e.Value.ToString();
                    if (strvalue.Contains(","))
                    {
                        arr = e.Value.ToString().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        if (arr.Length > 1)
                        {
                            e.FormatString = arr[1];
                        }
                    }
                    break;
                case "total":
                    switch (e.Parent)
                    {
                        case GridViewGroupRowInfo _:
                            e.FormatString = "{0:0}";
                            break;
                        case GridViewHierarchyRowInfo _:
                            e.FormatString = "{0:0}";
                            break;
                    }
                    break;
                case "price":
                    if (e.Parent is GridViewGroupRowInfo GroupRow)
                    {
                        e.FormatString = $"SubTotal {GroupRow.HeaderText}";
                    }
                    else if (e.Parent == this.datagrid.MasterView.ViewTemplate)
                    {
                        e.FormatString = "Total ";
                    }
                    else if (e.Parent is GridViewHierarchyRowInfo h)
                    {
                        e.FormatString = "Total ";
                    }
                    break;
            }
        }
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 May 2022
1 answer
111 views
Hello, I am setting items pragmatically to be pinned or not. I would like to show a little icon next to the pinned items at the top. How can I accomplish this? Thank you
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 May 2022
1 answer
94 views

Hi, 

I need to set a tooltip to a specific title of a child template of a hierarchical radgridview.

On column titles i can set it without problem using ViewCellFormatting event, but on tabbed childs template titles i can't.

(Radgridview for winforms)

Please help.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 02 May 2022
2 answers
328 views

I did some searching and finding it difficult to disable button(s) in RadGridView. 

I have a gridview with two buttons (Edit, Delete) then datacolumns in grid.

When Delete is pressed, I want to execute code, disable / hide Edit / Delete buttons on that row only.

I was able to disable the button but then all buttons are now being disabled on all rows.  Even though the buttons are disabled the commandcellClick is still executing when clicking on the disabled button.

I did add the CellFormatting  procedure but it executes so many times it's hard to know what row / cell it's on and when.

 private void gvResults_CellFormatting(object sender, CellFormattingEventArgs e)
        {
                if (e.ColumnIndex == 0)
                   {
                        RadButtonElement b = (RadButtonElement)e.CellElement.Children[0];
                        b.Enabled = false;
                        Debug.Print("Working on cell: " + e.CellElement.Value);
                    }
        }
tar
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 29 Apr 2022
1 answer
186 views

Hi,

   I tried Telerik Radgridview Grouping using example in docs.telerik.com/devtools/winforms/controls/gridview/grouping/setting-groups-programmatically. But when ever i tried to group its showing Object not set to instance of  an Object error.

 

My input data looks like this

 

 

My Group descriptor code looks like this

My Error looks like this

 

I am not sure why i am getting this error. I just wanted to group the data by DevelopmentPart.

 

And also if you have any small sample project for gridview can you provide?

 

Regards

Harsha

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Apr 2022
1 answer
188 views

Hello,

I am a freelancer residing in Germany and the sole developer of a small application which is usable for (automated) Windows setup. Looking around for a nice and slick design I stumbled over the Telerik Winforms controls. But after checking your 500 pages EULA I am confused about your licensing policy and would like to know what exactly I would need in order to be legally allowed to use your Telerik Winforms components (esp. RadForm, RadPanel, RadButton, RadCheckbox, RadLabel, RadTextbox, RadTextControl, RadDropDownList, RadMultiColumnComboBox, RadGridView - all including a customized Fluent Dark design theme) within my own application which I want to sell to potentially customers globally - and hereby I want to avoid possible copyright infringements, of course.

I already know that I need to use ILMerge to hide the used Telerik .dll files within the released application but I do not know which or if any license is needed, at all, as the .dlls theirselves can be used without any license keys as you have mentioned on various articles/forum posts. Furthermore and as mentioned, it is only a small tool and I do not intend to modify the Telerik .dlls in any way.

Thanks a lot in advance and kind regards!

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Apr 2022
4 answers
1.9K+ views

I can't seem to get the back color of a cell, row or column to set programatically.

The ribbon lets me choose a back (fill) color, but nothing happens. 

I can find the 'setForeColor' method, but there isn't a 'setBackColor'. Can you confirm that this is right ?

I CAN set back colors using the Styles = good/bad/neutral from the UI.

So is the only way to set the back color to create my own CellStyle, and use that?

Is there any documentation on how to do this? Using the Visual Studio debugger makes it a very slow process of software archeology!

Randy
Top achievements
Rank 1
Iron
Iron
 answered on 27 Apr 2022
1 answer
90 views
how can I remove the border from the component? I would like no border not even the border of the cells
thank you
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 27 Apr 2022
2 answers
928 views

HI Support,

 

I would like to know drag and drop to gridivew from attached file of forward outlook email. Now I got error. Can't read file stream. I can read file stream normal attached file (pdf or excel).

 

Thanks,

Moe

 

 

Moe
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 27 Apr 2022
1 answer
241 views

I need help with the performance of the SortDescriptors for the RadGridview. I attached a project that demonstrates the issue.

I have two sets of data. The "Larger Data Table" has roughly twice as many rows (around 17k). The "Smaller Data Table" has around 9k rows.

  • Setting the Sort Descriptors toggle switch ON, selecting the "Larger Data Table" radio button, and clicking the [Load Data Set] button takes approximately 1 second in my environment.
  • Setting the Sort Descriptors toggle switch ON, selecting the "Smaller Data Table" radio button, and clicking the [Load Data Set] button takes approximately 7 seconds in my environment.

I have no idea what is causing this issue. However, through a ton of troubleshooting, I finally figured out it is the sort descriptors causing the issue.


Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 Apr 2022
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)
Chart (obsolete as of Q1 2013)
Form
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
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
NavigationView
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?