Telerik Forums
UI for WinForms Forum
2 answers
118 views

Hello,

I have togive a custom behaviour to a RadGridView on the Delete or Up/Down key press.

Unfortunately, the RadGrid KeyPress doesn’t risen by the special keys.

So the only way I find to catch those keys press is to override the IsInputkey function so tomake my own control witch extends from the telerik radGrid.

public class CtrlRadGrid : Telerik.WinControls.UI.RadGridView

    {

        public CtrlRadGrid()

            :base(){}

        public delegate void InputKeyEvent(Keys keyData);

        public event InputKeyEvent InputKeyOccurs = null;

        protected override bool IsInputKey(KeyskeyData)

        {

            if (InputKeyOccurs != null)

            {

InputKeyOccurs(keyData);

            }

            return base.IsInputKey(keyData);

        }

}

All works great, my event is raised by all the keys, and all the grid keep isfunctionality… except the skin…

I think that there must be a control on the name of the class…

So is there a simple way to apply the skin on my own control witch extends from radGrid?

Is there a simple way to catch the keyPress from special keys?

Court Philippe
Top achievements
Rank 1
 answered on 24 Feb 2010
1 answer
137 views
I was previously using the December 3rd release of Rad Controls, I used the project updater tool (I like the new recursive feature, that saves me a lot of time) and compiled without a hitch.

However, upon clicking on my RadPanelBar now I get this exception:

System.InvalidCastException: Unable to cast object of type 'Telerik.WinControls.UI.RadPanelBar' to type 'Telerik.WinControls.UI.RadTabStrip'.
   at Telerik.WinControls.UI.RadTabStripContentPanel.OnEnter(EventArgs e)
   at System.Windows.Forms.Control.NotifyEnter()
   at System.Windows.Forms.ContainerControl.UpdateFocusedControl()

If I hit continue and click on the same object again, it does select the RadToggleButton element.

Before upgrading this error did not occur.



Boyko Markov
Telerik team
 answered on 24 Feb 2010
1 answer
101 views
Hello,

I've got a windows service that I'd like to have an excel spreadsheet produced in. In the client, this is done via the Grid view Exporter. However, in the windows service, there are obviously no forms, so in order to do it this way, I would have to instantiate the RadGridView element, set its properties programmatically, set the datasource, and hope that it will be able to export a nicely formatted spreadsheet. When trying this, I was unable to get the grid's columns and rows to populate. Here is how I currently set it up:

grdResults.BackColor = System.Drawing.Color.White; 
                            //  
                            //  
                            //  
                            grdResults.MasterGridViewTemplate.AddNewRowPosition = Telerik.WinControls.UI.PinnedRowPosition.Bottom; 
                            grdResults.MasterGridViewTemplate.AllowAddNewRow = false
                            grdResults.MasterGridViewTemplate.AllowColumnChooser = false
                            grdResults.MasterGridViewTemplate.AllowDeleteRow = false
                            grdResults.MasterGridViewTemplate.AllowEditRow = false
                            grdResults.MasterGridViewTemplate.AllowRowResize = false
                            grdResults.MasterGridViewTemplate.AutoGenerateColumns = true
                            grdResults.MasterGridViewTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill; 
                            grdResults.MasterGridViewTemplate.EnableGrouping = false
                            grdResults.MasterGridViewTemplate.ShowFilteringRow = false
                            grdResults.MasterGridViewTemplate.ShowRowHeaderColumn = false
                            grdResults.MultiSelect = true
                            grdResults.Name = "grdResults"
                            grdResults.ReadOnly = true
                            grdResults.ShowGroupPanel = false
                            grdResults.Size = new System.Drawing.Size(684, 461); 
                            grdResults.TabIndex = 15; 
                            grdResults.TabStop = false
                            ((Telerik.WinControls.UI.GridTableElement)(grdResults.GetChildAt(0))).AlternatingRowColor = System.Drawing.Color.FromArgb(((int)(((byte)(222)))), ((int)(((byte)(255)))), ((int)(((byte)(222))))); 
                            ((Telerik.WinControls.UI.GridTableElement)(grdResults.GetChildAt(0))).RowHeight = 18; 
                            grdResults.Size = new Size(1000, 700); 
                            grdResults.DataSource = objRecordList; 

After the datasource is set, there are still no rows or columns, even though this should produce 67 rows and four columns. Is there an easier way to produce the desired spreadsheet from my list of objects? Alternatively, is there something I can do to get the grid to behave better so I can leverage the build-in exporter?

Thanks!
Jeremy
Martin Vasilev
Telerik team
 answered on 24 Feb 2010
1 answer
91 views
Hi,

I am trying to add more than one text box and label in a cell. I successed in displaying the controls but the textboxes are in non editable mode. Means i can't change their text. I am also facing indefinite loop like thing with radGridView1_CellFormatting() event. It could be poosible i m doing it in wrong way please help me.

Here is my code for refrence:
using System;  
using System.Collections.Generic;  
using System.ComponentModel;  
using System.Data;  
using System.Drawing;  
using System.Linq;  
using System.Text;  
using System.Windows.Forms;  
using Telerik.WinControls.UI;  
 
namespace TelerikGridEditing  
{  
    public partial class Form3 : Form  
    {  
        public Form3()  
        {  
            InitializeComponent();  
        }  
 
        private void bindGrid()  
        {  
            DataTable dt = new DataTable();  
            dt.Columns.Add("ProductId");  
            dt.Columns.Add("ProductName");  
            dt.Columns.Add("ProductDesciption");  
            dt.Rows.Add(1, "IPod Classic 80GB", "Description of product");  
            dt.Rows.Add(2, "IPod Touch 32GB", "Description of product");  
            dt.Rows.Add(3, "DishWasher", "Description of product");  
            dt.Rows.Add(4, "Microwave Oven", "Description of product");  
            dt.Rows.Add(5, "WashingMachine", "Description of product");  
            dt.Rows.Add(6, "Coffee Mug", "Description of product");  
            dt.Rows.Add(7, "Umbrella", "Description of product");  
 
            GridViewDataColumn col5 = new GridViewDataColumn();  
            radGridView1.DataSource = dt;  
            radGridView1.MasterGridViewTemplate.Columns.Add(col5);  
        }  
        private void GridLayout()  
        {  
            radGridView1.Columns[0].Width = 50;  
            radGridView1.Columns[1].Width = 100;  
            radGridView1.Columns[2].Width = 200;  
            radGridView1.Columns[3].Width = 250;  
            radGridView1.Width = 700;  
 
            radGridView1.MasterGridViewTemplate.Columns[0].HeaderText = "Id";  
            radGridView1.MasterGridViewTemplate.Columns[1].HeaderText = "Name";  
            radGridView1.MasterGridViewTemplate.Columns[2].HeaderText = "Description";  
            radGridView1.MasterGridViewTemplate.Columns[3].HeaderText = "Order Detail";  
             
            radGridView1.MasterGridViewTemplate.AllowAddNewRow = false;  
            radGridView1.MasterGridViewTemplate.EnableGrouping = false;  
              
        }  
        private void Form3_Load(object sender, EventArgs e)  
        {  
            bindGrid();  
            GridLayout();  
            
            this.radGridView1.CellFormatting += new CellFormattingEventHandler(radGridView1_CellFormatting);  
        }  
 
        void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)  
        {  
            if (e.CellElement.RowInfo is GridViewDataRowInfo)  
            {  
                if (e.CellElement.ColumnIndex == 3)  
                {  
                    int pos = 10;  
                    for (int i = 0; i < 2; i++)  
                    {  
                        RadLabelElement lblElement = new RadLabelElement();  
                        lblElement.MaxSize = new Size(50,10);  
                        lblElement.Location = new Point(5, pos);  
                        lblElement.Text = "Text";  
                        e.CellElement.Children.Add(lblElement);  
 
                        RadTextBoxElement txtElement = new RadTextBoxElement();  
 
                        txtElement.Text = "Blank";  
                        txtElement.MaxSize = new Size(50, 10);  
                        txtElement.Location = new Point(55, pos);  
 
                        e.CellElement.Children.Add(txtElement);  
                        pos += 25;  
                    }  
 
                    int rowIndex = e.CellElement.RowIndex;  
                    this.radGridView1.Rows[rowIndex].Height = pos + 10;  
                }  
 
 
            }  
        }  
    }  
}  
 


I am also attaching the snap shot what i want to do.

Regards,
Saurabh Garg
Martin Vasilev
Telerik team
 answered on 24 Feb 2010
0 answers
96 views
Photo Album example executes in C#.net for windows application fine, but in vb.net the samples not running and provide some errors.
Please provide some sample data which runs in vb.net smoothly.
Thank in advance
Kamran Hussain
Top achievements
Rank 1
 asked on 24 Feb 2010
6 answers
180 views

Hi,

I am working on a winforms version of the IPhone menu from telerik ASP.NET. I took the Background an mad it transparent.
After that I took a titlebar and made it nice so it fitted in the top section of the picture. That gave me window and drag functionality.
Found a action button for the bottom center. All nice.

But now in the main window I need some action.
I started to work with a listbox and my approach is to ajust the appearance with the telerik Theme Builder and test.

My first problem / chalenge is that when I open my existing myStyle.XML file and make some changes, save the file and test, some previous changes seem to have dissapeared ????

My second chalenge is more a question if there maybe exist already something like this or Is somebody interested in assisting a littlebit to achieve a winforms version of the Telerik ASP.NET IPhone demo ???
Maybe this could look nice in the telerik winforms demo as well ???

Regards,

Rick Rehorst
Rick Rehorst
Top achievements
Rank 1
 answered on 23 Feb 2010
3 answers
183 views

I'm trying to create a simple tabbed MDI application. It won't even have dockable toolbars or anything, just a tab bar with open documents. I could do a traditional MDI, but I think that tabbed MDI is easier to use and more modern.

I would also like my application to retain the "default system" look that users are familiar with instead of using fancy color schemes and custom control styles.

How can I best achieve this? I tried the RadDock, and while it does provide the tabbed MDI part, the theming support for it is still incomplete and I can't get the standard look. I could also try to use a simple RadTabStrip, but for that I can't find any options to add a "close"  button next to each item.

What would be the recommended way?

Nikolay
Telerik team
 answered on 23 Feb 2010
2 answers
216 views
Hi,

    I need to set the Height of the  Multi Column Combo box with respect to the Height of the screen, for example i need to set the Height always 60% of the size of the screen. 


Mike Treat
Top achievements
Rank 1
 answered on 23 Feb 2010
0 answers
104 views
Hi,

I am building an application that has a need to implement themes in such a way that they will be synchronized with system themes (coloring scheme). The problem is when I used Telerik controls and use any of available themes on them, the controls on application would not take any effect when Windows themes are changed. I used another UI component that provides a theme named "system" that applies the current Windows theme on the application and when system theme changes it is also reflected in the application.

I want to know if the same behavior can be produced by using Telerik controls? Please let me know if this is possible or any work around is available for this case.

Regards,

Haroon
Haroon
Top achievements
Rank 1
 asked on 23 Feb 2010
5 answers
211 views
Hi Telerik,

I am gonna use RadChart for the first time in a Windows application using VB.Net.

I need to display the pie chart for the total amount  with 7 divisions namely - Visa, Master, Amex, Cheque, Cash, Discover, Paypal.

This is my stored procedure output -

Amount     TenderType     NoOfPeople

300.00      Amex                  2
600.00      Cash                  4
450.00      Cheque              3
450.00      Discover             3
300.00      Master                2
300.00      Paypal                2
300.00      Visa                    2

The pie chart has to display Amount of the respective tendertype.   

Plz help me with how to code and display in Windows application using VB.Net.

Thank you in advance.

Regards,
Raj

 

Raj Maverick
Top achievements
Rank 1
 answered on 23 Feb 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
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?