Telerik Forums
UI for WinForms Forum
2 answers
94 views
I'm using the Office 2010 theme and have the following issues

1.  How do I see the text "Click here to add a new row"?  With this theme, I am not seeing this.  I assume this is because of the theme, perhaps not.  Either way, the documentation shows this at the top of the grid (directly under the column headers) and my grid does not show it.

2.  How can I change the background color of this new row which is being filled in? 

Thanks,
Chris
Richard Slade
Top achievements
Rank 2
 answered on 25 Feb 2011
6 answers
198 views
Hello,

I have a unique requirement where I have to find out if a user manually entered a value in the cell or the system generated it. For example, in a cell it shows 10 as the current value and if the user typed in 10 again, the application has to know if 10 is typed in by user or not.

The cells could have any value type and so I am changing the editor in radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e). However, the handlers for the EditorElements are not being called when the user edits the cells. I am using RadComboBoxEditorElement, GridSpinEditorElement and RadTextBoxEditorElement.

private void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
 {
     var varModel = radGridView1.CurrentRow.Tag as VariableModel;
 
     if (varModel.Variable != null)
     {
         var variableType = varModel.Variable.VariableType;
 
         if (varModel.Variable.VariableSelectionValueCollection.Count > 0)
         {
             var selValCol = varModel.Variable.VariableSelectionValueCollection;
             if (selValCol != null && selValCol.Count > 0)                          // if to be shown as a dropdown  // todo: vsv fix
             {
                 var editor = new RadComboBoxEditor();
                 var elem = editor.EditorElement as RadComboBoxEditorElement;
 
                 elem.DropDownWidth = radGridView1.Columns[STR_ValueCol].Width + radGridView1.Columns[STR_UnitsCol].Width;
                 elem.DropDownStyle = RadDropDownStyle.DropDownList;
                 elem.MaxDropDownItems = 10;
                 elem.DataSource = selValCol.Select(vs => vs.Description).ToList<string>();
 
                 editor.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
                 //editor.ValueChanged += new EventHandler(editor_ValueChanged);
 
                 e.Editor = editor;
             }
         }
         else if (variableType == VariableTypeEnum.Integer)
         {
             var editor = new GridSpinEditor();
             var elem = editor.EditorElement as GridSpinEditorElement;
             elem.MaxValue = int.MaxValue;
             elem.MinValue = int.MinValue;
             if (varModel.Variable.Val != null)
                 editor.Value = varModel.Variable.Val.ToInt32();
 
             e.Editor = editor;
         }
         else if (variableType == VariableTypeEnum.Double)                // todo : capture keys to exclude text
         {
             e.EditorType = typeof(RadTextBoxEditor);
             var editor = new RadTextBoxEditor();
             var elem = editor.EditorElement as RadTextBoxEditorElement;
             //elem.TextChanging += new TextChangingEventHandler(Editor_TextChanging);
             //elem.TextChanged += new EventHandler(elem_TextChanged);
             if (varModel.Variable.Val != null)
                 editor.Value = varModel.Variable.Val.ToDouble();
             e.Editor = editor;
         }
         else if (variableType == VariableTypeEnum.Boolean)
         {
             var editor = new RadComboBoxEditor();
             var elem = editor.EditorElement as RadComboBoxEditorElement;
             elem.Items.AddRange(new[] { new RadComboBoxItem("True"), new RadComboBoxItem("False") });
             editor.Value = elem.Items.Where(ri => ri.Text.ToLower() == varModel.Variable.Val.Val.ToLower()).FirstOrDefault();
 
             e.Editor = editor;
         }
         else if (variableType == VariableTypeEnum.String)
         {
             e.EditorType = typeof(RadTextBoxEditor);
             var editor = new RadTextBoxEditor();
             var elem = editor.EditorElement as RadTextBoxEditorElement;
             //elem.TextChanged += new EventHandler(elem_TextChanged);
             if (varModel.Variable.Val != null)
                 editor.Value = varModel.Variable.Val.ToString();
             e.Editor = editor;
         }
     }
 }


Thanks
Stefan
Telerik team
 answered on 25 Feb 2011
7 answers
330 views
Hi all,

I have need for a cell background color to change when the data changes in that cell..  Currently I have it working in the ValueChanged event and it works fine, but when I scroll, the cell color doesn't scroll with the rows..  I undersgtand this is due to the visual elements and that I should set the color in the RowFormatting event, however, I have no idea what the value is, and can not do "conditional formatting"...  is there a way to know, in RowFormatting, that the cell has been changed?
Thanks,

Matt

My code to do this in CellValueChanged is:
void gvMain_CellValueChanged(object sender, GridViewCellEventArgs e)
{
    GridDataCellElement ce = (GridDataCellElement)sender;
    ce.BackColor = Color.LightPink;
    ce.BackColor2 = Color.White;
    ce.NumberOfColors = 2;
    ce.DrawFill = true;
    ce.GradientStyle = Telerik.WinControls.GradientStyles.Linear;
    _dataDirty = true;
    btnSave.Visible = true;
}
Matt
Top achievements
Rank 1
 answered on 25 Feb 2011
1 answer
255 views
Have been scratching my head a little over this one for a while, so I thought I would ask the question here on the forums!

If I have a radDock that has for example 3 tabs/documents in the DocumentManager, how would I programatically select one of the tabs?

I would have thought:
this.radDock1.DocumentManager.ActiveDocument = radDock1.DockWindows[1];
would be the way to go, but that property is read only.

I can't find anything in the documentation for this and boy, I wish you guys would comment all the methods and prcedures in the radDock library, so intellisense would give me a clue!

Thanks for the help,

Richard.
rjmorton
Top achievements
Rank 1
 answered on 24 Feb 2011
2 answers
224 views
Hello,

When I switch Scheduler view from week to day, it showed me first date of the week not the current. (I am displaying one date in schedular, which is current date). How I scroll to current date without clicking Today button.

For example

In week View I am getting dates from Jan 16th to Jan 22nd and current date is Jan 18. When go to Day view it display Jan 16th not Jan 18

Thanks
Dobry Zranchev
Telerik team
 answered on 24 Feb 2011
21 answers
359 views
HI

Please let me know any way to display ONLY 'Clear value' item , when right click on the radgridview cell.

Thank You

Richard Slade
Top achievements
Rank 2
 answered on 24 Feb 2011
3 answers
157 views
Hi
why the time part in an excel filter of a date time column is set to '12:00' for all?
Can any one resolve this for me.
Alexander
Telerik team
 answered on 24 Feb 2011
3 answers
126 views
Hello, 
I have looked and see that some people report that the isvisible property is true or false depending on whether the row is filtered.
I don't find this in my project.

I have a gridview that is bound to a datatable.
When the user filters the rows, we want to be able to iterate over the unfiltered rows and update a value in a cell.

Whenever I iterate over the gridview.rows collection, the gridviewrowinfo.isvisible is always true, regardless of filter state.

Can anyone point me to what I'm doing wrong?

Here is a snipit of code
Dim mCellPos As Integer = rgvItemsAndProps.CurrentCell.ColumnIndex
            rgvItemsAndProps.BeginEdit()
            For Each gr As GridViewRowInfo In rgvItemsAndProps.Rows
                Dim y As String = gr.Cells(2).Value
                If gr.IsVisible = True Then
                    gr.Cells(mCellPos).Value = _ItemPropGridClipboard
                End If
            Next
            rgvItemsAndProps.EndEdit()
        End If



Richard Slade
Top achievements
Rank 2
 answered on 24 Feb 2011
15 answers
570 views
According to the documentation for the GridView control (v2010.3.10.1215):

Gets or sets the name data source property or database column to which the is bound. 

Gets or sets a string value representing the column's unique name in the Columns collection of the .  


However, the code below does not display the value for SQL field "ProjectTitle"

        GridViewTextBoxColumn1.FieldName = "ProjectTitle"
        GridViewTextBoxColumn1.HeaderText = "Title"
        GridViewTextBoxColumn1.Name = "Title"

Instead, I have to set the property Name to the SQL field. The property FieldName can be anything.

GridViewTextBoxColumn1.FieldName = "Foobar"
        GridViewTextBoxColumn1.HeaderText = "Title"
        GridViewTextBoxColumn1.Name = "ProjectTitle"


Can someone explain to me which is correct?  

By the way, I am binding to a SQLDataReader and AutoGenerateColumns is false.

Richard Slade
Top achievements
Rank 2
 answered on 23 Feb 2011
9 answers
259 views
Hello,

I have some code that worked up until Q2 2010 SP1, which no longer works in Q3 2010. RadGridView.Rows.Add(...) used to return the row index of the added row, but in Q3 2010 it returns -1.

I have a hierarchical GridView and the following code:

private void SetupRadGridviewRelation()
{
    GridViewRelation selfRelation = new GridViewRelation(this.radGridView1.MasterTemplate, this.radGridView1.MasterTemplate);
    selfRelation.ParentColumnNames.Add("IdCol");
    selfRelation.ChildColumnNames.Add("ParentIdCol");
    this.radGridView1.Relations.Add(selfRelation);
}
 public void LoadVariables
 {  
    foreach (var varModel in list)
    {
        var rowNum = radGridView1.Rows.Add(varModel.Id, varModel.ParentId, varModel.VarName, varModel.VarValue, varModel.VarUnits);
        radGridView1.Rows[rowNum].Tag = varModel;
    }
 }


Does anybody know of a solution. Is this a bug in Q3 2010?

Thanks.
Richard Slade
Top achievements
Rank 2
 answered on 23 Feb 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?