Telerik Forums
UI for WinForms Forum
1 answer
162 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
142 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
123 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
234 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
226 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
275 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
148 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
260 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
3 answers
218 views
Good Morning, 

 I sow an exemplo: Telerik webmail.
 
to build this webmail, whats components I´ll need to buy?


sorry, but my english is no good!
Schlurk
Top achievements
Rank 2
 answered on 22 Feb 2010
2 answers
136 views
Hey at Telerik

I'm am trying to intercept an event that would look like a RowCreated.

I need the DataBoundItem and a row, so i can change the BackColor of each row depending on the data from the DataBoundItem

Does such an event exists or do i need to handle this another way ?

Sincerly

Jan
Martin Vasilev
Telerik team
 answered on 22 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)
Form
Chart (obsolete as of Q1 2013)
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
PdfViewer and PdfViewerNavigator
CommandBar
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
VirtualGrid
Toolstrip (obsolete as of Q3 2010)
Label
AutoCompleteBox
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
SplitContainer
Documentation
Map
DesktopAlert
CheckedDropDownList
ProgressBar
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
SyntaxEditor
Wizard
CollapsiblePanel
LayoutControl
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
WaitingBar
GroupBox
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
FileDialogs
ColorDialog
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
NavigationView
BindingNavigator
RibbonForm
Styling
Barcode
PopupEditor
TaskBoard
Callout
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Overlay
Security
LocalizationProvider
Dictionary
TreeMap
StepProgressBar
SplashScreen
Flyout
Separator
SparkLine
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
SpeechToTextButton
SmartPasteButton
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?