Telerik Forums
UI for WinForms Forum
1 answer
154 views

Hi, I am using RadControls for WinForms SP2 (Q2 2010) and trying to render a stock price line chart, of which each price is a daily price. The prices are rendering ok however I have an issue with the x axis which I believe is affecting how the data is ultimately rendered.

 

Each item in the series is a daily price for the given stock, along with the date on which the price relates to.  On the X axis we want to just show monthly points, so for our example where we are rendering a chart of daily stock prices, each axis label on the x axis would show the month (Jan, Feb, Mar etc). The code we are using (VB.net) to set the x axis label is:

 

chrtVBA.PlotArea.XAxis.AddRange(xMin, xMax, 30)

 

…where xMin and xMax are the minimum and maximum dates in the series (converted using .ToOADate()).

 

As you can see, we are specifying 30 as the step value, however I beleive that because there aren’t 30 days in every month the X axis labels becomes out of sync with the plotted points. Is there a specific method to call or property we can set so that the x axis correctly shows the correct month?

 

I have attached an example of what the chart currently looks like, we have checked the stock prices and they do appear to be out of sync with the x axis, for example a price which appears to be for late August on the rendered chart should be showing for early September. For information; the xMin and xMax values used to render this chart were 09/12/2010 and 09/12/2011 respectively (not We did call .ToOADate() to convert.

Thanks for you help.
Michael

 

Peshito
Telerik team
 answered on 03 Oct 2011
3 answers
267 views
HI,
I'm populating a RadGrid with an Accessdb which has a datetime column. In the RadGrid I have a column which is to show only the hour, minute and second. I use the Formatstring {0:h.mm.ss}.

Problem: when the hour is a zero 00.01.01 in the db in the RadGrid it is displayed as 12.01.01.
It displays correct when the time is 01.01.01.

How can I display just 00.01.01?

Thanks,
Karl
Emanuel Varga
Top achievements
Rank 1
 answered on 03 Oct 2011
2 answers
177 views
I am currently using a radpageview in outlook mode. I am trying to collapse the pageviewpages to the strip on the bottom as icons so they can still be accessed when a button is clicked. Also I need the expand option to still work so they can be added back on through add more buttons or dragging the collapse bar. I am trying to do this programatically.

Thanks
Alexander
Telerik team
 answered on 03 Oct 2011
2 answers
261 views
Hi 

I have read in the documentation here: http://www.telerik.com/help/winforms/gridview-rows-summary-rows.html that summary rows can be pinned, but I cannot get this to work. Whenever I scroll down, the row disappears from view. Is there any property I should be setting to make this happen?

regards
Steve
Steve
Top achievements
Rank 1
 answered on 03 Oct 2011
1 answer
241 views
Hello all,

I have a custom radtextbox class called PosNegTB. Now i want to set the inital text value of that class to "0.00", this is the code i have for it:

public sub new
mybase.new
mybase.text = "0.00"

end sub

but when i add this class onto my main form the text inside it is "PosNegTB". What am i doing wrong? Plz help.


Thank you in advance
Ivan Petrov
Telerik team
 answered on 03 Oct 2011
2 answers
224 views
Hi Guys,
I have a GridViewTexboxColumn that displays Gender ( either M or F ) and I want to change it into GridViewComboBox that has 2 items, Male and Female
Thanks in advance.

Ivan Petrov
Telerik team
 answered on 03 Oct 2011
3 answers
551 views

I'm using the standard RadGridVeiw events to set various cell states such as enabled.  Everything works fine as long as the grid doesn't have a scroll bar.  Here is the code.

I'm finding that on this line

 

 

if (row.Cells[e.ColumnIndex].CellElement != null)  CellElement is null and is that last row in view when the grid loads.  So my code below only works for rows in view.

Let me state exactly what I'm trying to do. If nothing  else please help me find the correct solution.
I have a Winforms RadGridView table with GridViewCheckBoxes in a column.  When a user selects a checkbox in a row i want all the rest of the checkboxes in the other rows to be disabled.  When the user unchecks the checkboxed row I want all checkboxes in other rows to be enabled.
  It's simple, only one checkbox in a row can be selected.

 



 

 

public bool HandleCellValueChanged(RadGridView matrixRadGrid, GridViewCellEventArgs e, MatrixPickerPresenter matrixPresenter, RadGridView measureGrid)

 

{
 

bool IsValidSelection = false;

 

 

 

if (reportType == CustomReportTypes.Matrix || reportType == CustomReportTypes.MatrixRowWithHistory || reportType == CustomReportTypes.MatrixWithHistory)

 

{

 

 

if (e.Column.HeaderText == "Selected")

 

{

measureGrid.DataSource =

 

null;

 

 

 

if (matrixPresenter.Measures.Count > 0)

 

{

measureGrid.Enabled =

 

true;

 

measureGrid.DataSource = matrixPresenter.Measures;

 

 

try

 

{

 

 

var displayRow =

 

measureGrid.Rows.Where(row => ((

 

ReportMeasure)row.DataBoundItem).IsDisplayMeasure).FirstOrDefault();

 

 

 

if (displayRow != null)

 

{

 

 

// The Display Measure must be in view for the RowFormatting event to fire and the user needs to know what the Display Measure is at the start.

 

measureGrid.GridElement.ScrollToRow(displayRow);

}

}

 

 

catch

 

{

 

 

// Do nothing: No need to end the world just because the Display Measure isn't in view.

 

;

}

 

}

 

 

else

 

{

measureGrid.Enabled =

 

false;

 

}

IsValidSelection = measureGrid.Enabled;

 

 

var selectedReportItem = e.Row.DataBoundItem as ReportMatrix;

 

 

 

if (selectedReportItem != null)

 

{

 

 

bool enableOtherSelectedCheckboxes = true;

 

 

 

if (selectedReportItem.Selected)

 

{

enableOtherSelectedCheckboxes =

 

false;

 

IsValidSelection =

 

true;

 

}

 

 

 

for (int index = 0; index < matrixRadGrid.Rows.Count; index++)

 

{

 

 

var row = matrixRadGrid.Rows[index];

 

 

 

 

if (e.RowIndex == index)

 

{

 

 

if (!selectedReportItem.Selected)

 

{

selectedReportItem.MatrixParameter = (

 

int)MatrixParameterTypes.None;

 

e.Row.Cells[e.ColumnIndex + 1].Value = (

 

int)MatrixParameterTypes.None;

 

}

 

 

 

continue;

 

}

matrixRadGrid.GridElement.ScrollToRow(row);

 

 

if (row.Cells[e.ColumnIndex].CellElement != null)

 

{

row.Cells[e.ColumnIndex].CellElement.Enabled = enableOtherSelectedCheckboxes;

}

}

}

}

 

 

else if (e.Column.HeaderText == "Runtime Parameter")

 

{

 

 

bool setEnabled = true;

 

 

 

var reportMatrix = e.Row.DataBoundItem as ReportMatrix;

 

 

 

if (reportMatrix != null && reportMatrix.Selected)

 

{

setEnabled =

 

false;

 

IsValidSelection =

 

true;

 

measureGrid.Enabled =

 

true;

 

}

 

 

for (int index = 0; index < matrixRadGrid.Rows.Count; index++)

 

{

 

 

var row = matrixRadGrid.Rows[index];

 

 

 

if (e.RowIndex == index)

 

{

 

 

continue;

 

}

row.Cells[e.ColumnIndex].CellElement.Enabled = setEnabled;

}

}

}

 

 

return IsValidSelection;

 

}

}

Ivan Todorov
Telerik team
 answered on 03 Oct 2011
2 answers
577 views
I have an application with 3 GridViews bound to 3 datatables.  I use a single VB subroutine with the GridView as an argument to write changes in these datatables to an Oracle database.  In this subroutine, after the database has been updated, I call RadGridView.DataSource.AcceptChanges to reset all the data row states.  My problem is this:

In a GridView with, let's say 500 rows, I select row 250 and position it in the middle of the displayed rows.  After the save routine completes and RadGridView.DataSource.AcceptChanges is called, the GridView refreshes and the selected row is now displayed at the top of the GridView.  This behavior disrupts the users' workflow.  Is there any way I can suppress this refresh?

Thanks,
Robert S.
Jack
Telerik team
 answered on 03 Oct 2011
2 answers
247 views
Hello Guys

As you can see the attached file, I have a gridview with 4 hierarchical views, I need that when the user click one of the tabs of the hierarchical view, and other row is expanded the selected tab view will be the previous selected. And if more of 1 row is expanded and the user change the  hierarchical view, in all the expanded rows change the selected tab view to the selected for the user.

 I tried to make it with the RadGridView1_ChildViewExpanding Event but i didnt find the Select Tab Property,
 in the hirarchical view




Private Sub RadGridView1_ChildViewExpanding(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.ChildViewExpandingEventArgs) Handles RadGridView1.ChildViewExpanding
        'RadGridView1.Templates.GetTemplateByCaption(e.ParentRow.ActiveView.ViewTemplate.Caption)
        Dim stemplate As String
        If e.IsExpanded = False Then
            For Each row As GridViewRowInfo In RadGridView1.Rows
                If (row.IsExpanded = True) Then
                    stemplate = DirectCast(row, Telerik.WinControls.UI.GridViewHierarchyRowInfo).ActiveView.ViewTemplate.Caption
                    Exit For
                End If
            Next
 
        End If
 
    End Sub
, 
Cesar
Top achievements
Rank 1
 answered on 03 Oct 2011
1 answer
166 views
I am using a GridViewMaskBoxColumn for formatted string entry, because I am working with an existing data store that contains text entries. I would like to save the fully formatted value, not just the entered characters .

Am I able to bind the column so that the Text property of the cell editor is saved to the data store instead of the Value property. It would be the difference between storing :
masked Value : 1234567890
masked Text :    12-34-567-89-W0

Here is the columns Designer code.
gridViewMaskBoxColumn1.FieldName = "LSD";
gridViewMaskBoxColumn1.HeaderText = "ll-ss-ttt-rr-mm";
gridViewMaskBoxColumn1.Mask = "00\\-00\\-000\\-00\\-\\W0";
gridViewMaskBoxColumn1.MaskType = Telerik.WinControls.UI.MaskType.Standard;
gridViewMaskBoxColumn1.Name = "LSDM";
gridViewMaskBoxColumn1.Width = 120;
Peter
Telerik team
 answered on 30 Sep 2011
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
SyntaxEditor
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
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?