Telerik Forums
UI for WinForms Forum
1 answer
128 views
Hi,

is it possibly to implement a GridViewSummaryItem with a AggregateFunction like "Sum / 4.0" ?

Thanks

Edit: I solved the problem.

I implemented a derived class from GridViewSummaryItem and overrided void EvaluateAggregate(GroupSummaryEvaluationEventArgs e)
Alexander
Telerik team
 answered on 01 Jul 2010
1 answer
141 views
Hi,
   i have a problem canceling the ActiveWindowChanging events.
When i enter in this event i check if the last ActiveWindow is updated. If not i ask user to chose to save, or not, data to db.
If user chose to save, i update data in db, and proced changing the Active Window, as user wants. But when i save data, if i get an exception, i send a msgbox to user, and i want to "reactivate" the last ActiveWindow. In this way, the user can edit data to complete it or discard it.
How can i cancel the window changing?
I try with e.cancel = true, but the program loops :(
    Private Sub RadDock1_ActiveWindowChanging(ByVal sender As ObjectByVal e As Telerik.WinControls.UI.Docking.DockWindowCancelEventArgs) Handles RadDock1.ActiveWindowChanging 
        ' Salvo il Layout del tab che sto chiudendo 
        For Each c As Control In RadDock1.ActiveWindow.Controls 
            Select Case c.GetType.ToString 
                Case "Commesse" 
                    Dim mycontrol As AnagraficaCommesse = TryCast(c, AnagraficaCommesse) 
                    mycontrol.SaveGridLayout() 
                Case "Articoli" 
                    Dim mycontrol As Commesse_Articoli = TryCast(c, Commesse_Articoli) 
                    mycontrol.SaveGridLayout() 
                    If mycontrol.RadGridView1.IsInEditMode() Then 
                        If MsgBox("Un record non è stato salvato! Si desidera salvarlo ora?", MsgBoxStyle.YesNo, "Salvare i dati?") = MsgBoxResult.Yes Then 
                            Try 
                                mycontrol.RadGridView1.EndEdit() 
                                mycontrol.UpdateDataSource() 
                            Catch ex As Exception 
                                MsgBox("Si è verificato un problema durante il salvataggio dei dati. Controllare che i dati inseriti siano corretti", MsgBoxStyle.Critical, "Errore"
                                e.Cancel = True 
                            End Try 
                        Else 
                            mycontrol.RadGridView1.EndEdit() 
                        End If 
                    End If 
            End Select 
        Next 
    End Sub 

I'm sorry if code is not clear; this is only for understand if i wrong something in it, with the e.cancel = true.

Thanks
Martin Vasilev
Telerik team
 answered on 01 Jul 2010
1 answer
105 views

Hi, i'm having trouble trying to export the grid. Whenever i export the data i only get the visible part of it. I cannot find to much info about how i have to do it. Could someone please help me?

Regards.

Martin Vasilev
Telerik team
 answered on 01 Jul 2010
1 answer
113 views
Hi everyone,

I would like to add a shortcut to my RadButtonItem without any Keys modifiers.
And the problem is I have no idea how I could make it without displaying the Delimiter - "+" (RadShortcut.Delimiter).

Code:
radButtonItem.Shortcuts.Add(new RadShortcut(0,Keys.F5)); 


Result:
Menu item look:
"text        +F5"
http://img195.imageshack.us/img195/7698/menushortcuts.jpg or attachments

Any ideas how I could remove this Delimiter?

Thanks in advance,
Adam




Stefan
Telerik team
 answered on 01 Jul 2010
2 answers
231 views
I am trying to inherit RadMenuItem (sample bellow), in order to add more properties required by our application.

Public Class TestMenuItem 
    Inherits RadMenuItem 
 
    Public Sub New() 
        Me.New(""Nothing
    End Sub 
 
    Public Sub New(ByVal text As String
        Me.New(text, Nothing
    End Sub 
 
    Public Sub New(ByVal text As StringByVal tag As Object
        MyBase.New(text, tag) 
    End Sub 
End Class 

When I try to add this new RadMenuItem in a RadMenu object, the visual display of the item is different from the actual RadMenuItem. I guess it is a ThemeEngine glitch. Do you have any advice on how to correctly inherit RadMenuItem?

This is a sample form where two menu items are added, one standard RadMenuItem (test1) and one from the inherited TestMenuItem (test2). Form1 has a RadMenu control added and it is a standard Windows.Form form.
Public Class Form1 
 
    Private Sub Form1_Load(ByVal sender As System.ObjectByVal e As System.EventArgs) Handles MyBase.Load 
        Dim mi1 As New RadMenuItem("test1"
        Dim mi2 As New testMenuItem("test2"
        Me.RadMenuItem1.Items.Add(mi1) 
        Me.RadMenuItem1.Items.Add(mi2) 
    End Sub 
End Class 

In the attached image you can see the resulting runtime form with the difference in visual display of the two menu items.

We are currently evaluating your WinForms controls and we have little to no experience with your libraries :).
Constantinos Petridis
Top achievements
Rank 2
Iron
Iron
 answered on 01 Jul 2010
1 answer
170 views
Ok. I'm not 100% sure how to explain this: so here goes.
I have a user control that I made (see attachment control.jpg).

on loading the application I use the following code to dynamically create tabs. (Page is the usercontrol).

for (int i = 0; i < dtTabs.Rows.Count; i++) 
           
                Page cp = new Page(dtTabs.Rows[i].ItemArray[1].ToString(), sCon, at, isPrimary,this); 
                cp.Dock = DockStyle.Fill; 
                RadPanel rp = new RadPanel(); 
                rp.Controls.Add(cp); 
                rp.Dock = DockStyle.Fill; 
 
                TabItem tab = new TabItem(); 
                tab.Alignment = System.Drawing.ContentAlignment.BottomLeft; 
        tab.Name = dtTabs.Rows[i].ItemArray[1].ToString(); 
                tab.Text = dtTabs.Rows[i].ItemArray[1].ToString(); 
                tab.DisplayStyle = DisplayStyle.ImageAndText; 
                tab.TextImageRelation = TextImageRelation.ImageBeforeText; 
                 
 
                tab.ContentPanel.Controls.Add(rp); 
                cp.StartRefresh(); 
 
                tabMain.Items.Add(tab); 
 
 
            } 
 



however when I use the dock.Fill property, or the anchor properties... the control does not display properly... it cuts off the bottom of the control and the right of the control.. See attachment (main.jpg); 



Stefan
Telerik team
 answered on 01 Jul 2010
4 answers
1.2K+ views
Hi
i'm using radGridView and it seems that i cant set the grid header font at design time.
i've tried Element Hierarchy Editor and i've set my font in GridHeaderElement, but it seems it does not work.

i'm using 2010 Q2 and my grid is in ( RightToLeft = True) mode.

is there any other way to modify grid header at runtime?

ps: i also cant set header height in Element Hierarchy Editor  :(

tanx in advance
Alexander
Telerik team
 answered on 01 Jul 2010
1 answer
126 views
here is the idea of the code used to demo this bug.

create a new class


public partial class MainForm : Applications.UI.ShadowForm
{
   //in here create another class
   ChildClass cClass = new ChildClass()
 
   //link the parent object to the child class
   cClass._parent = this.

   //in the InitializeComponent tell it to hide the max button
   ....
    this.MaximizeBox = false;
   ....

  //tell the application to show you child class
   cClass.Show()


}


in the  cClass modifiy the parent MaximizeBox  to true

Result the box does not display untill you resize the parent. forcing it to re-draw.


Deyan
Telerik team
 answered on 01 Jul 2010
3 answers
201 views
Hi,

When i try to re-bind the datasource in RadGridView  Selection Changed event  throws  the below exception :  System.NullReferenceException: Object reference not set to an instance of an object. Pls any solution for this.


SampleCode :

using

 

System;

 

using

 

System.Collections.Generic;

 

using

 

System.ComponentModel;

 

using

 

System.Data;

 

using

 

System.Drawing;

 

using

 

System.Text;

 

using

 

System.Windows.Forms;

 

using

 

Telerik.WinControls;

 

using

 

Telerik.WinControls.UI;

 

namespace

 

RadGrid

 

{

 

public partial class RadForm1 : Telerik.WinControls.UI.RadForm

 

{

 

DataTable dtUserDetails = new DataTable();

 

 

public RadForm1()

 

{

InitializeComponent();

radGridView1.GridBehavior =

new GridBehavior();

 

}

 

private void RadForm1_Load(object sender, EventArgs e)

 

{

 

dtUserDetails.Columns.Add(

"ID");

 

dtUserDetails.Columns.Add(

"Name");

 

 

DataRow newRow;

 

 

for (int rowIndex = 0; rowIndex < 4; rowIndex++)

 

{

newRow = dtUserDetails.NewRow();

newRow[

"ID"] = rowIndex;

 

 

if (rowIndex == 0)

 

{

newRow[

"Name"] = "A";

 

}

 

else if (rowIndex == 1)

 

{

newRow[

"Name"] = "B";

 

}

 

else if (rowIndex == 2)

 

{

newRow[

"Name"] = "C";

 

}

 

else if (rowIndex == 3)

 

{

newRow[

"Name"] = "D";

 

}

 

else if (rowIndex == 4)

 

{

newRow[

"Name"] = "E";

 

}

 

else if (rowIndex == 5)

 

{

newRow[

"Name"] = "E";

 

}

dtUserDetails.Rows.Add(newRow);

}

dtUserDetails.AcceptChanges();

radGridView1.DataSource = dtUserDetails;

radTextBox1.DataBindings.Add(

"Text", dtUserDetails, "ID" );

 

radTextBox2.DataBindings.Add(

"Text", dtUserDetails, "Name");

 

 

}

 

 

private void radGridView1_SelectionChanged(object sender, EventArgs e)

 

{

 

//radGridView1.EndEdit();

 

 

if (dtUserDetails.GetChanges() != null)

 

{

 

if (MessageBox.Show("Do you want to save the changes", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)

 

{

 

this.radGridView1.GridElement.BeginUpdate();

 

radGridView1.Relations.Clear();

dtUserDetails.AcceptChanges();

 

this.radGridView1.GridElement.EndUpdate();

 

 

//radGridView1.DataSource = null;

 

 

//radGridView1.DataSource = dtUserDetails;

 

}

}

}

 

private void radGridView1_ValueChanged(object sender, EventArgs e)

 

{

 

//radGridView1.EndEdit();

 

 

}

 

private void radGridView1_CurrentColumnChanged(object sender, CurrentColumnChangedEventArgs e)

 

{

 

}

 

private void radGridView1_RowsChanged(object sender, GridViewCollectionChangedEventArgs e)

 

{

 

if (dtUserDetails.GetChanges() != null)

 

{

 

if (MessageBox.Show("Do you want to save the changes", "Save", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)

 

{

 

this.radGridView1.GridElement.BeginUpdate();

 

dtUserDetails.AcceptChanges();

 

//this.suppliersTableAdapter.Fill(this.nwindDataSet.Suppliers);

 

 

this.radGridView1.GridElement.EndUpdate();

 

 

 

//radGridView1.DataSource = null;

 

 

//radGridView1.DataSource = dtUserDetails;

 

}

}

}

 

}

 

 

public class GridBehavior : Telerik.WinControls.UI.BaseGridBehavior

 

{

 

protected override bool OnMouseDownLeft(MouseEventArgs e)

 

{

 

GridDataCellElement cell = this.GridControl.ElementTree.GetElementAtPoint(e.Location) as GridDataCellElement;

 

 

if (cell != null

 

&& !cell.Equals(

this.GridControl.CurrentCell)

 

&& cell.RowInfo.Equals(

this.GridControl.CurrentRow)

 

&& cell.ColumnInfo.ReadOnly)

{

 

this.GridControl.EndEdit();

 

}

 

try

 

{

 

return base.OnMouseDownLeft(e);

 

}

 

catch (Exception ex)

 

{

 

MessageBox.Show(ex.Message);

 

 

return true;

 

}

}

}

}

Boryana
Telerik team
 answered on 01 Jul 2010
1 answer
215 views
Hello!

      I have read the following two posts



     And I am wondering, are the collapsing side panels in the Telerik examples project in WPF and thus not available in WinForms?  I need something exactly like that for my WinForms app, but I'm not sure if it exists (at least due to the second post I included above, where using the XP Collapsible Pane will not work for what I'm after...as I'm trying to find something similar to Visual Studio's Solution Explorer and Properties side bars without the pinning)  Are there any WinForms controls like that or is the XP Collapsible Pane the only option?

      Thanks for your time!
Nikolay
Telerik team
 answered on 30 Jun 2010
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
ProgressBar
CheckedDropDownList
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
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
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
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?