Telerik Forums
UI for WinForms Forum
1 answer
473 views

Hi.

In my grid I've got some columns with double values. Some of the values might be null values or Double.NaN resp.
However, in a summary row I need value counts, average and standard deviation of the values - excluding the null values!
How can I customize the grid aggregate functions to achieve this?
I experimented with GridViewSummaryItem.AggregateExpression a bit, but I don't know how to formulate an If-Condition to skip the null value row.
My code so far looks like this:

        Dim avg As New GridViewSummaryRowItem()
        Dim count As New GridViewSummaryRowItem()
        Dim stdev As New GridViewSummaryRowItem()
        For col As Integer = 2 To table.Columns.Count - 1
            Dim row_cnt As New GridViewSummaryItem()
            row_cnt.Name = table.Columns(col).ColumnName
            row_cnt.Aggregate = GridAggregateFunction.Count
            row_cnt.FormatString = "# {0}"
            count.Add(row_cnt)
            Dim row_avg As New GridViewSummaryItem()
            row_avg.Name = table.Columns(col).ColumnName
            row_avg.Aggregate = GridAggregateFunction.Avg
            row_avg.FormatString = "Ø {0:F4}"
            avg.Add(row_avg)
            Dim row_stdev As New GridViewSummaryItem()
            row_stdev.Name = table.Columns(col).ColumnName
            row_stdev.Aggregate = GridAggregateFunction.StDev
            row_stdev.FormatString = "σ {0:F4}"
            stdev.Add(row_stdev)
        Next
        grd_data_.SummaryRowsBottom.Add(count)
        grd_data_.SummaryRowsBottom.Add(avg)
        grd_data_.SummaryRowsBottom.Add(stdev)

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Mar 2017
22 answers
590 views
hi...

i am using RadMaskedEditBox.....

after adding Maskededitbox value,i cleared maskedbox.

but it is cleared but if we try to enter another value it shows old value...

how to avoid that?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Mar 2017
2 answers
82 views

Hello dear,

I can save layout for more than one grid view in the same file ??, for example:

i have gv1 and gv2, i want to save layout for all grids in one file so i can do this ?? if yes let me know, thanks.

Ammar
Top achievements
Rank 1
 answered on 29 Mar 2017
7 answers
107 views

In winforms Radgridview whenever I need to create a new row I have been generating a class with members for each column like:

public class stopCreationRow
   {
       public string shipper, consignee, zip;
   }

 

Then I create and use it for adding rows like:

private void radButton35_Click(object sender, EventArgs e)
  {
      stopCreationRow newRow = new stopCreationRow();
      //throughout the code set the various fields as needed
      newRow.consignee = "person";
      newRow.shipper = "new shipper";
       
      //then transfer everything to the proper cells
      GridViewDataRowInfo dataRowInfo = new GridViewDataRowInfo(this.stopCreation_grid.MasterView);
      dataRowInfo.Cells["consignee"].Value = newRow.consignee;
      dataRowInfo.Cells["shipper"].Value = newRow.shipper;
       
      //finally create the row
      stopCreation_grid.Rows.Add(dataRowInfo);
       
  }

 

My question is two fold:

1. Can I somehow use newRow from above to directly create the row?

2. Instead of created my own class, since all this information is already in the datagrid can I access the field names though a class derived from the datagrid?

Joe
Top achievements
Rank 2
 answered on 28 Mar 2017
1 answer
182 views

Hi,

I created a Usercontrol using telerik winform controls.

How to include the created Usercontrol into telerik grid view column as Column type

regards

Subramanya Udupa

 

 

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 28 Mar 2017
2 answers
192 views
how to change the shape of the default pin to the user created shape pin?
Joel
Top achievements
Rank 1
 answered on 28 Mar 2017
1 answer
297 views

hi,

i have some code like this

For i = 0 To count
    Dim col1 As CheckedListBox.CheckedItemCollection = chk_Sorumlular.CheckedItems
    Dim col2 As CheckedListBox.CheckedItemCollection = chk_Beyannameler.CheckedItems
    If col1.Contains(Me.Izgara.Rows(i).Cells(Me.sutun_sorumlu.Name).Value) And col2.Contains(Me.Izgara.Rows(i).Cells(Me.sutun_Turu.Name).Value) Then
        Dim str As String = Me.Izgara.Rows(i).Cells(Me.sutun_ID.Name).Value.ToString()
        Dim chrArray() As Char = {"|"c}
        If (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(str.Split(chrArray)(1).Trim(), "", False) <> 0) And chk_TahakkukFisi.Checked Then
            Me.Izgara.Rows(i).Cells(Me.sutun_Sec_Tahakkuk.Name).Value = CheckState.Checked
        Else
            Me.Izgara.Rows(i).Cells(Me.sutun_Sec_Tahakkuk.Name).Value = CheckState.Unchecked
 
        End If
        If (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(str.Split(chrArray)(0).Trim(), "", False) <> 0) And chk_Beyanname.Checked Then
            Me.Izgara.Rows(i).Cells(Me.sutun_Sec_Beyanname.Name).Value = CheckState.Checked
        Else
            Me.Izgara.Rows(i).Cells(Me.sutun_Sec_Beyanname.Name).Value = CheckState.Unchecked
 
        End If
    Else
        Me.Izgara.Rows(i).Cells(Me.sutun_Sec_Tahakkuk.Name).Value = CheckState.Unchecked
        Me.Izgara.Rows(i).Cells(Me.sutun_Sec_Beyanname.Name).Value = CheckState.Unchecked
    End If
    Application.DoEvents()
Next

 

i can do this with microsoft checkedlistbox component

but i try do with radcheckedlistbox and get error

An unhandled exception of type 'System.InvalidCastException' occurred in asd.exe
Additional information: An object of type 'System.String' could not be thrown to 'Telerik.WinControls.UI.ListViewDataItem'.

 

how can i fix this

 

thank you

 

Dimitar
Telerik team
 answered on 28 Mar 2017
2 answers
94 views

I am trying to validate a change to a property from within a propertygrid that requires a password.  I am trying to capture the ValueChanging event for the underlying editor.  If a form is launched from within the event handler and the change is not cancelled, an ArgumentOutOfRangeException ends up being thrown sometime after the event handler returns.  I have attached a simple example that throws the exception.  In it there is a simple Yes/No message box.  If Yes is answered -> Exception is thrown.  Any help is much appreciated.  Thank you

 

Enum type and simple class edited by the Property Grid.

public enum EnumeratedProp {
   FirstItem,
   SecondItem,
   ThirdItem
}
 
public class TestProps
{
   [DisplayName("Formula Lock Active")]
   [Description("Indicates whether custom formulas can be locked to prevent editing")]
   public EnumeratedProp TestProp { get; set; }
}

 

Form Code

public partial class TestPropsForm : Form
{
   public TestProps tstProps = new TestProps();
 
   public TestPropsForm()
   {
      InitializeComponent();
      radPropGrid.SelectedObject = tstProps;
   }
 
   private void radPropGrid_EditorInitialized(object sender, Telerik.WinControls.UI.PropertyGridItemEditorInitializedEventArgs e)
   {
      if(e.Item.Name == "TestProp")
      {
         e.Editor.ValueChanging += TestProp_ValueChanging;
      }
   }
 
   private void TestProp_ValueChanging(object sender, Telerik.WinControls.UI.ValueChangingEventArgs e)
   {
      e.Cancel = (MessageBox.Show("Are you sure you want to change this?", "Question", MessageBoxButtons.YesNo) != DialogResult.Yes);
   }
}

Larry
Top achievements
Rank 1
 answered on 27 Mar 2017
7 answers
389 views
I cant write anything at Code Converter branch, everything closed there. So I wanna ask somewhere.Got trouble with batch code converter, its do  not work as intended and throws me an exception like  "Not found Sorry, we couldn't find the page you're looking for.The page you were looking for appears to have been moved, deleted or does not exist."
Dimitar
Telerik team
 answered on 27 Mar 2017
1 answer
426 views

First, I'm sorry if the question is not at the correct place.

I have an application that uses FiddlerCore4.dll

I use the following to installe Fiddler's certificate:

 

        public static bool InstallCertificate()
        {
            if (!string.IsNullOrEmpty(certmakerBcCert))
            {
                FiddlerApplication.Prefs.SetStringPref("fiddler.certmaker.bc.key", certmakerBcKey);
                FiddlerApplication.Prefs.SetStringPref("fiddler.certmaker.bc.cert", certmakerBcCert);
            }

            if (!CertMaker.rootCertExists())
            {
                //CLog.writeNoLogInDB("Creating SSL certificate");
                if (!CertMaker.createRootCert())
                    return false;

                if (!CertMaker.trustRootCert())
                    return false;

                FiddlerApplication.Prefs.SetBoolPref("fiddler.certmaker.PreferCertEnroll", true);
                certmakerBcCert = FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.cert", null);
                certmakerBcKey = FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.key", null);
            }
            return true;
        }

 

However, for firefox, I need to import them manually. How can I ensure through code they are also installed in Firefox? Been looking how to do it for a while.

My application needs to be user friendly, so using Fiddler application to generate Root certificates, and then import them in Firefox is complicated for users.

 

Thanks

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