Hi.
I have a grid which have a lot of columns.
20 of the columns are of decimal data type and I need to show their total. But some rows should not be included in the total.
I tried two different approaches to do this, both approaches had different problems.
This is my data model class
public class SgkThkk : SgkAssistantBase
{
public string cn { get; set; } = "";
public DateTime tya { get; set; } = DateTime.Now;
public string bm { get; set; } = "";
public string sgm { get; set; } = "";
public decimal tp { get; set; } = 0;
public decimal ip { get; set; }= 0;
public decimal kn14857 { get; set; }= 0;
public decimal kn15921 { get; set; }= 0;
public decimal kn6645 { get; set; }= 0;
public decimal kn15510 { get; set; }= 0;
public decimal kn2828 { get; set; }= 0;
public decimal kn6111 { get; set; }= 0;
public decimal kn17103 { get; set; }= 0;
public decimal kn17103i { get; set; }= 0;
public decimal kn27103 { get; set; }= 0;
public decimal kn27103i { get; set; }= 0;
public decimal kn37103 { get; set; }= 0;
public decimal kn37103i { get; set; }= 0;
public decimal kn7252 { get; set; }= 0;
public decimal kn17256 { get; set; }= 0;
public decimal kn7316 { get; set; }= 0;
public decimal kn7319 { get; set; }= 0;
public decimal kn5510 { get; set; }= 0;
public decimal kn4857 { get; set; }= 0;
public decimal kn159210 { get; set; }= 0;
public decimal kn3294 { get; set; }= 0;
public decimal odenecek { get; set; }= 0;
public string pdfPath { get; set; } = "";
public bool onayli { get; set; } = true;
}Purpose: exclude lines with "İPTAL" in the 'bm' column from the total
1st approach is to use CustomSummaryItem
public class CustomSummaryItem : GridViewSummaryItem
{
public CustomSummaryItem()
: base()
{ }
public override object Evaluate(IHierarchicalRow row)
{
decimal totalPos = 0;
foreach (GridViewRowInfo childRow in row.ChildRows)
{
if ((childRow is GridViewGroupRowInfo) == false)
{
string bm = childRow.Cells["bm"].Value.ToString();
if (bm != "İPTAL")
{
totalPos += Convert.ToDecimal(childRow.Cells[this.Name].Value);
}
}
}
return totalPos;
}
}And this is the method that adds a summary row to the grid
public void AddSummariesToTHKK(RadGridView rgv)
{
rgv.MasterTemplate.AutoExpandGroups = true;
rgv.GroupDescriptors.Clear();
rgv.GroupDescriptors.Add(new GridGroupByExpression("cn Group By cn"));
rgv.SummaryRowsBottom.Clear();
rgv.MasterTemplate.ShowTotals = true;
List<GridViewSummaryItem> lstSum = new List<GridViewSummaryItem>();
CustomSummaryItem tptSum = new CustomSummaryItem(); tptSum.Name = "tp"; tptSum.Aggregate = GridAggregateFunction.Sum; tptSum.FormatString = "Toplam: {0:C}"; lstSum.Add(tptSum);
CustomSummaryItem ipSum = new CustomSummaryItem(); ipSum.Name = "ip"; ipSum.Aggregate = GridAggregateFunction.Sum; ipSum.FormatString = "Toplam: {0:C}"; lstSum.Add(ipSum);
CustomSummaryItem kn14857Sum = new CustomSummaryItem(); kn14857Sum.Name = "kn14857"; kn14857Sum.Aggregate = GridAggregateFunction.Sum; kn14857Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn14857Sum);
CustomSummaryItem kn15921Sum = new CustomSummaryItem(); kn15921Sum.Name = "kn15921"; kn15921Sum.Aggregate = GridAggregateFunction.Sum; kn15921Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn15921Sum);
CustomSummaryItem kn6645Sum = new CustomSummaryItem(); kn6645Sum.Name = "kn6645"; kn6645Sum.Aggregate = GridAggregateFunction.Sum; kn6645Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn6645Sum);
CustomSummaryItem kn15510Sum = new CustomSummaryItem(); kn15510Sum.Name = "kn15510"; kn15510Sum.Aggregate = GridAggregateFunction.Sum; kn15510Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn15510Sum);
CustomSummaryItem kn2828Sum = new CustomSummaryItem(); kn2828Sum.Name = "kn2828"; kn2828Sum.Aggregate = GridAggregateFunction.Sum; kn2828Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn2828Sum);
CustomSummaryItem kn6111Sum = new CustomSummaryItem(); kn6111Sum.Name = "kn6111"; kn6111Sum.Aggregate = GridAggregateFunction.Sum; kn6111Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn6111Sum);
CustomSummaryItem kn17103Sum = new CustomSummaryItem(); kn17103Sum.Name = "kn17103"; kn17103Sum.Aggregate = GridAggregateFunction.Sum; kn17103Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn17103Sum);
CustomSummaryItem kn17103iSum = new CustomSummaryItem(); kn17103iSum.Name = "kn17103i"; kn17103iSum.Aggregate = GridAggregateFunction.Sum; kn17103iSum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn17103iSum);
CustomSummaryItem kn27103Sum = new CustomSummaryItem(); kn27103Sum.Name = "kn27103"; kn27103Sum.Aggregate = GridAggregateFunction.Sum; kn27103Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn27103Sum);
CustomSummaryItem kn7252Sum = new CustomSummaryItem(); kn7252Sum.Name = "kn7252"; kn7252Sum.Aggregate = GridAggregateFunction.Sum; kn7252Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn7252Sum);
CustomSummaryItem kn17256Sum = new CustomSummaryItem(); kn17256Sum.Name = "kn17256"; kn17256Sum.Aggregate = GridAggregateFunction.Sum; kn17256Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn17256Sum);
CustomSummaryItem kn7316Sum = new CustomSummaryItem(); kn7316Sum.Name = "kn7316"; kn7316Sum.Aggregate = GridAggregateFunction.Sum; kn7316Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn7316Sum);
CustomSummaryItem kn7319Sum = new CustomSummaryItem(); kn7319Sum.Name = "kn7319"; kn7319Sum.Aggregate = GridAggregateFunction.Sum; kn7319Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn7319Sum);
CustomSummaryItem kn5510Sum = new CustomSummaryItem(); kn5510Sum.Name = "kn5510"; kn5510Sum.Aggregate = GridAggregateFunction.Sum; kn5510Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn5510Sum);
CustomSummaryItem kn4857Sum = new CustomSummaryItem(); kn4857Sum.Name = "kn4857"; kn4857Sum.Aggregate = GridAggregateFunction.Sum; kn4857Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn4857Sum);
CustomSummaryItem kn159210Sum = new CustomSummaryItem(); kn159210Sum.Name = "kn159210"; kn159210Sum.Aggregate = GridAggregateFunction.Sum; kn159210Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn159210Sum);
CustomSummaryItem kn3294Sum = new CustomSummaryItem(); kn3294Sum.Name = "kn3294"; kn3294Sum.Aggregate = GridAggregateFunction.Sum; kn3294Sum.FormatString = "Toplam: {0:C}"; lstSum.Add(kn3294Sum);
CustomSummaryItem odeSum = new CustomSummaryItem(); odeSum.Name = "odenecek"; odeSum.Aggregate = GridAggregateFunction.Sum; odeSum.FormatString = "Toplam: {0:C}"; lstSum.Add(odeSum);
GridViewSummaryRowItem sumTopRow = new GridViewSummaryRowItem();
sumTopRow.AddRange(lstSum);
rgv.SummaryRowsBottom.Add(sumTopRow);
rgv.BottomPinnedRowsMode = GridViewBottomPinnedRowsMode.Fixed;
rgv.MasterView.SummaryRows[0].IsPinned = true;
rgv.MasterView.SummaryRows[0].PinPosition = PinnedRowPosition.Bottom;
}With this approach, grand totals always show 0
The result is like below
2nd approach is to subscribe to the GroupSummaryEvaluate event of the grid
private void rgvSgkOtomasyon_GroupSummaryEvaluate(object sender, GroupSummaryEvaluationEventArgs e)
{
decimal value = 0;
foreach (GridViewRowInfo row in this.rgvSgkOtomasyon.Rows)
{
if (row.Cells["bm"].Value.ToString() == "İPTAL" || !e.SummaryItem.FormatString.Contains("0:C")) continue;
value += (decimal)row.Cells[e.SummaryItem.Name].Value;
}
e.Value = value;
}Here is the result
Thank you in advance for your help

I have a listview with 5 columns, I want the 4th column of each row of the list box to have a backcolor which is specified by the user, (it's a visual representation of what they will see later in the program) I created a ListViewDataItem to capture all the info to be displayed in the listview, but I can't seem to get it to change the backcolor of a specific column.
please advise.
thanks
Jason
Hi,
I want to select the text from pdf file using pdfviewer and show that text in textbox, same like want to capture the text position same like zone of the text using x axis ,y axis ,height and width. I saw this is available in ui for wpf , so same like available in ui for windows ?
Could you pls share sample project for text selection in wpf ? or if got in win pls share.
i used Radpdfviewer and RadPdfViewerNavigator for windows
Pls reply asap.
Regards
Aravind


Hello everyone,
I'm running into a peculiar issue with VS Community v17.0.4 2019 and the Telerik Extension. When I attempt to launch the Upgrade Wizard (or most of the other options):
I get the following error to pop up:
Here is the full stack trace from that dialog as well:
Failed to execute command.
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "NuGet.VisualStudio.IVsNuGetProjectUpdateEvents" but found 0 after applying applicable constraints.
at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView](String contractName, ImportCardinality cardinality)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName)
at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]()
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()
at Telerik.VSX.NuGet.NuGetPackageService..ctor()
at Telerik.VSX.Internal.ProjectManagement.ProjectWrapUIComponentsBase..ctor(Project dteProject)
at Telerik.WinControls.VSX.Helpers.ProjectWrapFactory.<>c.<.cctor>b__5_0(Project p)
at Telerik.VSX.Internal.ProjectManagement.ProjectWrapFactoryBase`1.GetForProject(Project project)
at Telerik.VSX.Internal.ProjectManagement.ProjectWrapFactoryBase`1.GetForFirstSelectedProject(IServiceProvider serviceProvider)
at Telerik.WinControls.VSX.ProjectConfigurators.StreamlinedProjectConfiguration.GetDplConfigurationTypeSelector()
at Telerik.WinControls.VSX.ProjectConfigurators.StreamlinedProjectConfiguration.StartPdfProcessingConfigurationWizard()
at Telerik.VSX.VSPackage.PackageBase.CommandCallback(Object sender, EventArgs e)
I removed the extension & re-installed it, but the issue still persists. Has anyone else seen this error before?
I've found the AutoSize function for all the columns in a spreadsheet.
And it's NEARLY perfect: it's just too aggressive.
So after auto-sizing some columns, they look like this:
when the columns should look like:
It's only a small difference, but it's the difference between being able to see everything, and not.
Is there a way to make this function a bit more generous? Maybe add a little space ?
Hi,
We have a RadDock with multiple open documents (of type DocumentWindow), like the attached "DocumentsLayout" image.
These documents belong to a specific parent (what we call the "MainFolder"). Once the "MainFolder" is closed, we have a process that closes all opened documents and saves some metadata, including which documents were opened (currently we only save the names of those documents). We want to be able to restore the docking layout and restore the location of those previously opened documents, but we are not sure how to.
Currently, once we get the list of documents that we want to reopen, we restore them with:
public void RestoreDocuments(RadDock radDock, IEnumerable<DocumentWindow> documents)
{
foreach (DocumentWindow document in documents)
{
radDock.AddDocument(document);
}
}But of course the docking layout is lost, and all documents are added to the default DocumentTabStrip (even floating ones were added to the main one).What is the best way to achieve this? We also care about the order they were originally located within the tab strips (i.e. in the image, Document 2 on the left and Document 1 on the right)
Note: We are using version 2018_3_911, but we can upgrade if necessary.
Thank you for your help.

Hello,
When i put the simplified layout on the ribbon bar to On, the radRichTextEditor who is associated stay stays in its place instead of sticking to the ribbon. That's a lot of wasted space. How do I do this? i don't find the property ...
i found an exemple here : Nouvelle barre de ruban simplifiée moderne dans Telerik UI pour WinForms
That is exactilly what i want
Thank you (and sorry for my english !)

I have a WinForm with multiple controls that are bound to an management object. Once of the controls is a RadCheckedDropDownList that is bound to a single object property containing a bitwise value, something like this:
2, 'None'
4, 'Mornings'
8, 'Afternoon'
16, 'Evenings'
32, 'Anytime'
Using bitwise values I plan to store, say, 24 in the field if the user chooses Afternoons and Evenings. What I cannot figure out is how to bind this to the object property. if there a direct way to do this or will it need to be handled in the UI. Can I bind it as directly as I can, say, a string or in value that goes to a single property? Do you have sample code for such an approach?
Thanks
Carl
Hi, I am working on a program that uses queries that are hard coded into the program. Within the program, I have pages (radpageview) and then grids on the pages. Then each grid is programmed to load in data from the queries.
I am running into trouble because my grids are based on the first grid... I have this hard coded into the SQL Query and it will look at a specific cell value to then run the query with that in the where statement.
I need a cell value that is in the template, but I am having no luck.
As you can see below, I can get the cells from my main grid... but not from the template.
Example to explain...
I set this: selectedOrder = grdCustPOListing.CurrentRow.Cells["Order Num"].Value.ToString();
So that selectedOrder can now be used in my query:
"Select RMAH.RMANum as [RMA], RMAH.RMADate as [RMA Date], RMAD.RMALine as [RMA Line], RMAD.RefInvoiceLine as [Invoice], " +