Telerik Forums
UI for WinForms Forum
1 answer
111 views
How would I change the formating of a row or cell based on a value that changes during the program without having to reload the entire data? ie a timer reached a value x and now I want all rows of a grid where x is smaller to change backcolor to red.
Thanks,
Karl
Emanuel Varga
Top achievements
Rank 1
 answered on 04 Oct 2011
1 answer
124 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
192 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
145 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
200 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
207 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
170 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
403 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
502 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
184 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
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
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
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
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?