Telerik Forums
UI for WinForms Forum
1 answer
96 views
Is there an example or can someone assist me in creating a simple bar chart while consuming data using entity framework?
The query could be as simple as:

SELECT        COUNT(Invoice_Header_Id) AS [Total Invoices], Created_By
FROM            Accounts_Payable.Invoice_Header
WHERE        (Date_Created >= CONVERT(DATETIME, '2012-12-19 00:00:00', 102))
GROUP BY Created_By

I don't have an entity created yet.  I would most likely use a store procedure and return a complex type.

Any help is appreciated.

Thanks
Bob
Missing User
 answered on 21 Dec 2012
5 answers
262 views
Hello.

I have a RadGridView with multiple date columns. When the user selects a date (using built-in editor) in any column, I want to save it in the database. If I use the RadGridView1_CellValueChanged event, I can get the new value using
radGridView1.CurrentRow.Cells[radGridView1.CurrentColumn.Name].Value.ToString()


but the drawback is that the user must click outside the cell to trigger the event. So I elected to use RadGridView1_ValueChanged instead, but then, the value doesn't seem to be written in the Gridview's cell at the time the event triggers so the line doesn't work as it always returns the old value.

How can I get the new user value from within RadGridView1_ValueChanged? Please consider that I also have spinner-type editors in the grid that will trigger the same way (and I want them to), so a code sample with multiple editor types on multiple columns would be of great help too.

Thanks alot.
Plamen
Telerik team
 answered on 21 Dec 2012
2 answers
116 views
Hello,

is there a Win 8 Theme available for the Windows Forms RibbonBar?
Marco
Top achievements
Rank 1
 answered on 21 Dec 2012
1 answer
178 views
Hi

I have simple scenario in which a RadDropDownList  is populated from a small table in a database. After it has been populated if needed I need to select the Item or index or display value programmatically. 
Also there is no problem with diplaying the items the items and the selection process works fine, items are diplayed in order.

I have tried to set all the fields that I can with respect to the databinding
here is the windows autogen code for the form where the dropdown resides
//
          // MachineTypeDropDownList
          //
          this.MachineTypeDropDownList.AutoCompleteDisplayMember = "M_Type";
          this.MachineTypeDropDownList.AutoCompleteValueMember = "MachineID";
          this.MachineTypeDropDownList.DataBindings.Add(new System.Windows.Forms.Binding("SelectedIndex", this.machineDataBindingSource, "MachineID", true));
          this.MachineTypeDropDownList.DataBindings.Add(new System.Windows.Forms.Binding("SelectedItem", this.machineDataBindingSource, "M_Name", true));
          this.MachineTypeDropDownList.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", this.machineDataBindingSource, "MachineID", true));
          this.MachineTypeDropDownList.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.machineDataBindingSource, "M_Name", true));
          this.MachineTypeDropDownList.DataSource = this.machineDataBindingSource;
          this.MachineTypeDropDownList.DisplayMember = "M_Type";
          this.MachineTypeDropDownList.Location = new System.Drawing.Point(182, 52);
          this.MachineTypeDropDownList.Name = "MachineTypeDropDownList";
          this.MachineTypeDropDownList.Size = new System.Drawing.Size(136, 20);
          this.MachineTypeDropDownList.TabIndex = 0;
          this.MachineTypeDropDownList.Text = "System.Data.DataViewManagerListItemTypeDescriptor";
          this.MachineTypeDropDownList.ValueMember = "MachineID";
          this.MachineTypeDropDownList.DataBindingComplete += new Telerik.WinControls.UI.ListBindingCompleteEventHandler(this.MachineTypeDropDownList_DataBindingComplete);
          this.MachineTypeDropDownList.Initialized += new System.EventHandler(this.MachineTypeDropDownList_Initialized);


In the form constructor  InitializeComponent() is called after that I try to set the value of selected item of dropdown.
at this point Items count is still 0 
this.MachineTypeDropDownList.DropDownListElement.Items.Count
or
this.MachineTypeDropDownList.Items.Count

i have tried to use the lisener for databound compeleted but items are still 0
private void MachineTypeDropDownList_DataBindingComplete(object sender, Telerik.WinControls.UI.ListBindingCompleteEventArgs e)
       {
           System.Diagnostics.Debug.WriteLine("this.MachineTypeDropDownList.DropDownListElement.Items  --------------------------------" + this.MachineTypeDropDownList.DropDownListElement.Items.Count);
           System.Diagnostics.Debug.WriteLine("this.MachineTypeDropDownList.Items  --------------------------------" + this.MachineTypeDropDownList.Items.Count);
       }

I get the same result after when i try
private void MachineTypeDropDownList_Initialized(object sender, EventArgs e){}

My question is at what point , or what event signals that the binding process is complete and further manipulation of the dropdownlist can comence?
Why is it that by the end of the form contructor code,  the binding has not happened yet.


Thank you very much for any pointers to understand the telerik framework better
Ervis
Peter
Telerik team
 answered on 21 Dec 2012
1 answer
146 views
Hi There

I'm having some trouble with the order of events for the Cell Format

We do some conditional cell formatting based on values returned from a database, such as what days to block - holidays etc
I managed to get it to work fine the first time round 

The issue arises on the following Navigator events
  • NavigateBackwardsClick
  • NavigateForwadsClick

as the following event fires before the Navigate event

  • Scheduler.CellFormating

This seems quite strange, I would have thought that they would be reversed.

How can I call a refresh of the data method and which event should it go in 
  • exceptionTimes = _service.GetSchedulerExceptionTimesByDateRange(RangeStartDate, RangeEndDate)

As putting the values in the Navigate events makes the cellformating event use the previous 
range of exception times for the previous date range as defined before the navigate event.

Below is some example code 
Private Sub snMain_NavigateBackwardsClick(sender As Object, e As EventArgs) Handles snMainNav.NavigateBackwardsClick
 
    RangeStartDate = rsScheduler.ActiveView.StartDate.AddDays(-1)
    RangeEndDate = rsScheduler.ActiveView.EndDate.AddDays(1)
 
    exceptionTimes = GetSchedulerExceptionTimesByDateRange(, RangeStartDate, RangeEndDate)
    GetAppointmentsByDateRange()
 
 End Sub
 
Private Sub rsScheduler_CellFormatting(sender As Object, e As SchedulerCellEventArgs) Handles rsScheduler.CellFormatting
    ' Other Code
    For Each Exception In exceptionTimes
        'Block etc
 
    Next
 
End Sub

Ivan Todorov
Telerik team
 answered on 21 Dec 2012
1 answer
926 views

I would like for my grid to autosize according to the form size. When the form is resized, I would like the grid to expand. Is there a setting for this anywhere?

Anton
Telerik team
 answered on 21 Dec 2012
3 answers
379 views
Hi,

How to apply (by c# code) custom style (fore color, back color, font etc..) to only specific column, so style will affect all data in that column? I also want change style for individual column header cell and summary cell.
I'm only interested in the change of these properties in some of the columns, not all.

Plamen
Telerik team
 answered on 21 Dec 2012
4 answers
159 views
How can I give the user the ability to click on the popup alert and perform some action?  I do not see a CLICK event on the popup object.
Marek Kruk
Top achievements
Rank 1
 answered on 21 Dec 2012
1 answer
92 views
Context menu is expanding slowing on any usercontrol and rad gridview control. Also on 3rd Party control like Stockchart. It takes approx 2 seconds to pop-up.
Ivan Petrov
Telerik team
 answered on 21 Dec 2012
2 answers
123 views
Hello,

Edit: Sorry for topic name. Can't update it after posting.

I have RadMultiColumnComboBox in GridView.
I replace editor for that column like that:
private void GridView_EditorRequired(object sender, EditorRequiredEventArgs e)
{
   if (e.EditorType == typeof(RadMultiColumnComboBoxElement))
   {
       PersonChecker newEditor = new PersonChecker();
       e.Editor = newEditor;
   }
}

and this is my custom class:

public class PersonChecker : BaseInputEditor
{
    public override object Value
    {
        get
        {
            String all = "";
 
            RadMultiColumnComboBoxElement editor = ((RadMultiColumnComboBoxElement)this.EditorElement);
 
            foreach (GridViewRowInfo gvri in editor.Rows)
            {
 
                if (Convert.ToBoolean(gvri.Cells[0].Value) == true)
                {
                    if (all != "")
                        all += "; ";
 
                    all += Convert.ToString(gvri.Cells[1].Value);
 
                }
            }
 
            return all;
        }
        set
        {
            Console.WriteLine("to do");
        }
    }
 
    protected override RadElement CreateEditorElement()
    {
        RadMultiColumnComboBoxElement editor = new RadMultiColumnComboBoxElement();
 
        editor.EditorControl.AutoGenerateColumns = false;
        editor.Columns.Clear();
         
        GridViewCheckBoxColumn check = new GridViewCheckBoxColumn();
        check.HeaderText = "";
        check.Name = "Check";
        check.MinWidth = 40;
        check.MaxWidth = check.MinWidth;
        check.ReadOnly = false;
        editor.Columns.Add(check);
     
        GridViewTextBoxColumn username = new GridViewTextBoxColumn();
        username.HeaderText = "Username";
        username.Name = "Username";
        username.MinWidth = 200;
        editor.Columns.Add(username);
 
        editor.Rows.Clear();
 
        editor.Rows.Add(new Object[] { false, "Person 1" });
        editor.Rows.Add(new Object[] { false, "Person 2" });
        editor.Rows.Add(new Object[] { false, "Person 3" });
 
 
        //foreach (Person person in FormMain._persons)
        //{
        //    editor.Rows.Add(
        //    new Object[] { false, person.SP_Username }
        //  );
        //}
 
 
        editor.EditorControl.ShowRowHeaderColumn = false;
        editor.AutoSizeDropDownToBestFit = true;
 
        editor.PopupClosing -= Editor_PopupClosing;
        editor.PopupClosing += Editor_PopupClosing;
 
        editor.EditorControl.CellClick -= EditorControl_CellClick;
        editor.EditorControl.CellClick += EditorControl_CellClick;
 
        return editor;
    }
 
    private void EditorControl_CellClick(object sender, GridViewCellEventArgs e)
    {
        if (e.ColumnIndex == 0 && e.RowIndex > -1)
        {
            e.Row.Cells[0].Value = !Convert.ToBoolean(e.Row.Cells[0].Value);
        }
    }
 
    private void Editor_PopupClosing(object sender, RadPopupClosingEventArgs args)
    {
        if (args.CloseReason == RadPopupCloseReason.Mouse)
        {
            args.Cancel = true;
        }
    }
 
    public override void BeginEdit()
    {
        base.BeginEdit();
        this.EditorElement.Focus();
    }
 
    public override bool EndEdit()
    {
        return base.EndEdit();
    }
 
    public override Type DataType
    {
        get { return typeof(string); }
    }
 
}

So basically when user edit cell, another grid (custom editor) will show and user can check few person. After editing value in that cell will be set like Person 1; Person 2; Person 3.

This all work just fine but i have problem with text in that cell when user is in edit mode.
After entering edit mode cell text automatically change to "False".
When user check some rows cell text also change according to checked state "False" or "True".

How to avoid that text changing?
I want see my current string (depend what was checked) "Person 1; Person 2; Person 3" in grid cell also in edit mode so will be always updated information.
I another words, how to control text displayed in cell when user is in edit mode? 






konrad
Top achievements
Rank 1
 answered on 21 Dec 2012
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
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
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
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
Accessibility
NavigationView
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
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
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?