Telerik Forums
UI for WinForms Forum
1 answer
268 views

My radGridView numerical columns have thousand separator so I have to put a ',' when I search the grid cells using search row. How can I setup the grid so its search cell has thousand separator when I am looking for numerical values?

My numerical columns values are 5 decimal point:

123.12345

123.1234

123.123

123.12

123.1

123

0.123

and so fourth...

Hristo
Telerik team
 answered on 20 Apr 2016
11 answers
495 views

Hi,

I recently read that self-referencing hierarchy is now supported by the radGridView.  Unfortunately, I have been unable to locate any demos, tutorials, or sample code to look at.  Is this information available?

Here is my current code that I'm working with:

private void SetupElementsGrid()  
{  
    radGvElements.Columns.Clear();  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ElementID"));  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ProtocolTemplateID"));  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ParentElementID"));  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ElementNumber"));  
    radGvElements.MasterGridViewTemplate.Columns.Add(new GridViewTextBoxColumn("ElementDesc"));  
 
    radGvElements.Columns["ElementID"].IsVisible = false;  
    radGvElements.Columns["ProtocolTemplateID"].IsVisible = false;  
    radGvElements.Columns["ParentElementID"].IsVisible = false;  
 
    radGvElements.Columns["ElementNumber"].HeaderText = "Element Number";  
    radGvElements.Columns["ElementDesc"].HeaderText = "Element Description";  
 
    radGvElements.MasterGridViewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;  
 
    GridViewTemplate childTemplate = new GridViewTemplate();     
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ElementID"));  
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ProtocolTemplateID"));  
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ParentElementID"));  
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ElementNumber"));  
    childTemplate.Columns.Add(new GridViewTextBoxColumn("ElementDesc"));  
 
    //childTemplate.Columns["ElementID"].IsVisible = false;  
    //childTemplate.Columns["ProtocolTemplateID"].IsVisible = false;  
    //childTemplate.Columns["ParentElementID"].IsVisible = false;  
 
    //childTemplate.Columns["ElementNumber"].HeaderText = "Element Number";  
    //childTemplate.Columns["ElementDesc"].HeaderText = "Element Description";  
 
    childTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;  
      
    if(radGvElements.MasterGridViewTemplate.ChildGridViewTemplates.Count == 0)  
    {                     
        radGvElements.MasterGridViewTemplate.ChildGridViewTemplates.Add(childTemplate);  
    }  
      
    GridViewRelation relation = new GridViewRelation(radGvElements.MasterGridViewTemplate);  
    relation.ChildTemplate = childTemplate;  
    relation.RelationName = "ParentChild";  
    relation.ParentColumnNames.Add("ElementID");  
    relation.ChildColumnNames.Add("ParentElementID");  
    radGvElements.Relations.Add(relation);  
 
    ProtocolTemplate = (ProtocolTemplate)ProtocolTemplatesBindingSource.CurrencyManager.List[ProtocolTemplatesBindingSource.CurrencyManager.Position];  
    ElementsBindingSource.DataSource = ProtocolTemplate.Elements;  
    radGvElements.DataSource = ElementsBindingSource;  
                  
    radGvElements.DataSource = ElementsBindingSource;  
    childTemplate.DataSource = ElementsBindingSource;  

Sample data would look like this:

ElementID -- ProtocolTemplateID -- ParentElementID -- ElementNumber -- ElementDesc
1 -- 1 -- 1 -- 1.0 -- ParentLevel1
2 -- 1 -- 1 -- 1.1 -- ChildLevel1
3 -- 1 -- 1 -- 1.2 -- ChildLevel2
4 -- 1 -- 4 -- 2.0 -- ParentLevel2

With my current code, this displays as:

Row 1
-- Row1
-- Row2
-- Row3
Row 2
Row 3
Row 4
-- Row 4

It should be:

Row 1
-- Row 2
-- Row 3
Row 4

Also, another problem is with the portion of code I have commented out.  This code causes a NullReferenceException error to be thrown and I don't know why.

 

If anyone could help me out with the above code, or even point me in the direction of some reading material, I would be very grateful.

Thanks,

Robert

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 20 Apr 2016
1 answer
162 views
I am facing issue with RadDateTimePicker.Is it possible to enter only two digit in the year part like if i enter 16 than it will be consider as 2016 not to enter 2016? If i enter 16 than it will consider as 2016 and if i enter 2016 than it will consider same 2016. please check below code i used for RadDateTimePicker

Public Sub New()
        Me.New()
        Me.CustomFormat = "MM/dd/yyyy"
        AddHandler Me.LostFocus, AddressOf radDateTimePicker1_LostFocus
        Me.Font = New System.Drawing.Font("Tahoma", 8.25!)
        Me.Format = System.Windows.Forms.DateTimePickerFormat.Custom
        Me.NullText = "  /   /"
        Me.Size = New System.Drawing.Size(80, 19)
        Me.Value = New Date(CType(0, Long))
        CType(Me.DateTimePickerElement.GetCurrentBehavior(), RadDateTimePickerCalendar).Calendar.FirstDayOfWeek = FirstDayOfWeek.Monday
        CType(Me.DateTimePickerElement.TextBoxElement.Provider, MaskDateTimeProvider).AutoSelectNextPart = True
    End Sub

Private Sub radDateTimePicker1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs)
        Try
            If (Me.Value = "#12:00:00 AM#" Or Date.MinValue = Me.Value.ToShortDateString() Or Me.Value.Year <= 1900) Then
                Me.NullableValue = Date.MinValue
                Me.NullText = "  /  /"
            End If
        Catch ex As Exception
        End Try
    End Sub
 
Hristo
Telerik team
 answered on 20 Apr 2016
3 answers
229 views

I am using a scatter chart now, and trying to allow the user to select multiple points to turn them on or off. Using the selection mode of "MultipleDataPoints" doesn't seem to work for scatter charts the way the "documentation" implies for the pie charts. When I get the "SelectedPointChanged" event, either I don't understand the purpose of the "NewSelectedPoint" and "OldSelectedPoint", or they aren't working. Basically if I have 5 points 1,2,3,4, and 5, if I click on point 2 and then 3 it gives me new point 3 and old point 2. I would expect not to get an old point called out until I "deselect" a point. Otherwise I don't see how to accomplish what the example shows, with two points offset from the center when the multiple points is selected. Rather than banging my head against the wall on this, I used the custom renderer and hit test method on mouse down method that you showed me to fix the multiple pie selection issue, so I have it been able to accomplish what I need but I would still like to know what I am supposed to do in that situation, or if multiple data point selection is just not supported for scatter charts.

 

My more pressing issue is that I am now trying to use the lasso selection. However I don't want to zoom. I would like to override the behavior to get the lasso but then do my own action on the lasso'd points (the selection I am doing above, actually). I tried inheriting the class but all of the obvious calls that I could override had no effect.

 

Alternatively, or perhaps in addition to, I would like to know how to determine what points are in the zoomed area once lasso'd. For double bonus, I would like to be able to lasso a circle with the radius emanating from the moused down point (the radius at the mouse up point).

Hristo
Telerik team
 answered on 20 Apr 2016
2 answers
293 views

Hi,

 

I have a dataGrid with a threestate Checkbox-Column. Off = 0, On = 1, Indeterminate = 2.

State Off and On ok, but Indeterminate only the last is show correctly.

After fill the dataGrid On and Indeterminate always the same. I don't know what is wrong.

 

Database Columns are:

Code varchar(10)
Description varchar(50)
Sort tinyint  (0=off,1=on,2=indeterminate)

 

Fill datagrid:

private bool LoadStreets()
        {
            bool bOk = true;
            try
            {
                context.Street.Load();
                bindingSourceStreet.DataSource = context.Strassen.Local.ToBindingList();
            }
            catch (DbEntityValidationException ex)
            {
                bOk = false;
            }

            return bOk;
        }

Please can you tell me what is wrong?

Thank you

Andreas

Andreas
Top achievements
Rank 1
 answered on 20 Apr 2016
3 answers
239 views

it is super weird. I spend over 4 hours 

my project has very simple data table :

date,quantitysold,AverageQuantity,  in datatime, int, int

date will be X

quantitysold, averageQuantity, will be Y1 and Y2

first, user will get the product ID table into gridview and when choosing the product to show the chart,

the radchartview should popup/update the chart based on the product PID

I could make it work when I click the first product ID, erverything is ok, but more I click the datagrid to view the product sales data , the chartview becomes more smaller, please refer to the screenshots

everytime I click the data, I first make series.clear(), and tested area clear(), chart refresh, update.

 

 

   private void radGridView_197_data_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
        {
            this.radChartView_197_chart.Series.Clear();
            this.radChartView_197_chart.Area.Series.Clear();
            this.radChartView_197_chart.Refresh();
            this.SetChartViewData();
         //   if (gridview_197_firstClick)
            this.SetupChartView();

....more other code here ,

....

 

               CartesianArea area = this.radChartView_197_chart.GetArea<CartesianArea>();
                area.ShowGrid = true;
                CartesianGrid grid = area.GetGrid<CartesianGrid>();
                grid.DrawHorizontalStripes = true;

 

 

...............more code here to update the table which is every time different because product id changed.

 this.radChartView_197_chart.DataSource = table;
         
            this.radChartView_197_chart.Update();
            this.radChartView_197_chart.Refresh();

 

 

 

}
          

there is no zoom related setup , I tried almost everything, but there is very limited source online to bind the new data source.

 

please let me know how to do this.

 

 

 

 

 

 

 

Richard
Top achievements
Rank 1
 answered on 20 Apr 2016
5 answers
171 views

Hi, I want to custom a diagramtoolbox item, how to do it with UI for WinForms?

waiting for answer, thanks

Jonathan
Top achievements
Rank 1
 answered on 20 Apr 2016
5 answers
199 views
Hello Alex,

Thank you for writing.

Following the provided information, I was unable to reproduce the issue you are facing. I have attached my sample project. Could you please specify the exact steps how to reproduce the problem or feel free to modify the project in a way to replicate the experienced problem. You can provide the sample modified application in the support thread that you have opened on the same topic.

I am looking forward to your reply.

Regards,
Dess
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Hristo
Telerik team
 answered on 19 Apr 2016
1 answer
79 views

Hello,

when following this example: http://demos.telerik.com/aspnet-ajax/scheduler/examples/overview/defaultcs.aspx,

I have noticed that the RadCalendar1 doesnt synchronise the RadSchedular,

Really, i didnt use the same RadSchedular (witch binds with web service), i have used a datasource for binding

the mine is:

1) .ASPX

 <telerik:radscheduler runat="server" id="RadScheduler1"
                    DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End" DataDescriptionField="Description"
                    DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentId" DataReminderField="Reminder"
                    OnAppointmentDataBound="DiaryRadScheduler_AppointmentDataBound" OnAppointmentCommand="DiaryRadScheduler_AppointmentCommand"
                    AllowDelete="false" AllowEdit="false" AllowInsert="false" EnableDescriptionField="true"
                    EnableRecurrenceSupport="false" EnableResourceEditing="false" EnableExactTimeRendering="false"
                    DayStartTime="08:00:00" DayEndTime="20:00:00" WorkDayStartTime="09:00:00" WorkDayEndTime="18:00:00"
                    WeekView-DayStartTime="08:00:00" WeekView-DayEndTime="20:00:00" WeekView-WorkDayStartTime="09:00:00" WeekView-WorkDayEndTime="18:00:00" WeekView-EnableExactTimeRendering="true"
                    MultiDayView-DayStartTime="08:00:00" MultiDayView-DayEndTime="20:00:00" MultiDayView-WorkDayStartTime="09:00:00" MultiDayView-WorkDayEndTime="20:00:00" MultiDayView-NumberOfDays="5" MultiDayView-EnableExactTimeRendering="true"
                    AppointmentStyleMode="Auto" SelectedView="AgendaView"
                    StartEditingInAdvancedForm="true" StartInsertingInAdvancedForm="true"
                    ShowHeader="true" ShowFooter="true" ShowAllDayRow="false" ShowDateHeaders="true" ShowFullTime="false" OverflowBehavior="Expand"
                    RowHeight="25px" RowHeaderWidth="50px" MinutesPerRow="30" TimeLabelRowSpan="2"
                    FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" HoursPanelTimeFormat="HH:mm tt">
                    <DayView HeaderDateFormat="d" UserSelectable="true" />
                    <WeekView HeaderDateFormat="d" UserSelectable="true" />
                    <MonthView HeaderDateFormat="d" UserSelectable="true" />
                    <AgendaView HeaderDateFormat="d" UserSelectable="true" />
                    <TimelineView UserSelectable="false" />
                    <MultiDayView UserSelectable="false" />
                    <AdvancedForm Modal="true" />
                    <AppointmentTemplate>
                        <%# Container.Appointment.Resources.GetResourceByType("Type").Text%><br /><%# Eval("Subject") %><br /><%# Eval("Description") %>
                        <div>
                            <asp:Button runat="server" ID="BtnExport" CssClass="rsExportButton" ToolTip="Export to iCalendar" CommandName="Export" OnClientClick="Export(this, event); return false;" style="border: none; cursor: pointer;" />
                        </div>
                    </AppointmentTemplate>
                </telerik:radscheduler>

2) .CS

RadScheduler1.DataSource = DataSourceRadSchedular;

 

Any suggestion please?

 

Hristo
Telerik team
 answered on 18 Apr 2016
1 answer
182 views

Hi,

I am trying to build a RadDocument from many input RadDocuments (to put together many small documents). Many of these smaller documents have numbered lists whose numbering should be preserved. To insert each of the small documents, I am using
     richTextEditorToInsertInto.DocumentEditor.InsertFragment(new DocumentFragment(radDocumentToAppend))

When put together in the bigger document the numbering continues to increase, e.g., if

Document_1 contains:      and       Document_2 contains:
  DOC1_Header                               DOC2_Header
      1.  Doc1_Item1                               1.  Doc2_Item1
      2.  Doc1_Item2                               2.  Doc2_Item2
      3.  Doc2_Item3                               3.  Doc2_Item3
When put together, the resulting document contains
    DOC1_Header 
      1.  Doc1_Item1
      2.  Doc1_Item2
      3.  Doc2_Item3
    DOC2_Header
      4.  Doc2_Item1
      5.  Doc2_Item2
      6.  Doc2_Item3

Is there a way of resetting the start index for list numbering to 1? How can i keep the numbering from the original documents?

Thanks,

Shahrzade.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Apr 2016
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
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?