Telerik Forums
UI for WinForms Forum
5 answers
170 views

Dear All 

Please Help me how to make from like example MDI Layout - Radribbonbar 

i mean step by step... with properties not coding  

i have follow this step...

i have change properties 

controlbox = false 

formborderstyle = fixedsingle 

text = null 

 ismdicontainer = true 

 

i still cannot get like mdi layout - ribbonbar example

 

thanks before

 

Hengky
Top achievements
Rank 1
Veteran
 answered on 02 Oct 2015
1 answer
82 views

Hi,

I am using a RadToggleButton and a RadDropDownButton in a RadRibbonBar.

The RadDropDownbutton does not have the "IsChecked" property. How do I get the same behavior ​than a RadToggleButton, meaning: If i click on the radDropDownButton i want it to have the same "visual behavior" as a normal RadTogglebutton;

I need it to change the backgroundcolor after a click like the togglebutton and to change it back if you click again.

 

thanks for any help

 

 

Hristo
Telerik team
 answered on 02 Oct 2015
5 answers
602 views

Hello,

Very new to Telerik Components.

 I am using Telerik Gridview with different column types like multicombobox, decimal, combo box etc., Now I need to do validation each cells and written code for validation in CellValidating event of Gridview. it is  validating  properly. but I need to clear the cell content which is not happening.

I red other articles regarding the same and i initialize a cell validating event in the editor (Multicombobox editor). in this case the event itself is not firing.

kindly help me sort this issue.

 I am attaching code snip shot for your ref.

Grid level Cell validation event

private void grddisplaygrid_CellValidating(object sender, CellValidatingEventArgs e)
        {
            e.Cancel = true;
            grddisplaygrid.CurrentRow.Cells[0].Value = string.Empty;
            }​

 

in editor level (keydown event is firing but the validaiting event is not firing

-----------------------

private void grddisplaygrid_CellEditorInitialized(object sender, GridViewCellEventArgs e)
        {
                if (this.grddisplaygrid.CurrentColumn is GridViewMultiComboBoxColumn)
                {
                    RadMultiColumnComboBoxElement editor = e.ActiveEditor as RadMultiColumnComboBoxElement;
                    if (editor != null)
                    {
                        iscellintialized = true;
                        editor.EditorControl.EnableFiltering = true;
                        editor.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
                        editor.ClearTextOnValidation = false;
                        editor.Text = "";
                        RadMultiColumnComboBoxElement editorElement = editor.EditorElement as RadMultiColumnComboBoxElement; //_gridEditor.EditorElement as RadItem;
                        editorElement.KeyDown += new KeyEventHandler(MultiComboboxeditor_KeyDown); //.KeyDown += new KeyEventHandler(radGridView1_KeyDown);
                        editorElement.Validating += new CancelEventHandler(editor_validaitng);
                        editorElement.Validated += new EventHandler(editor_validated);
                    }
                }
            }

        private void editor_validated(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        private void editor_validaitng(object sender, CancelEventArgs e)
        {
            //throw new NotImplementedException();
            
        }​

 

 

 

 

 

 

 

 

T S
Top achievements
Rank 1
 answered on 02 Oct 2015
2 answers
125 views

I have a problem with the way ColumnGrouping is handling a GridViewTextBoxColumn.  I have recreated the problem in a very simple code snippet.  I am attaching a screen image of how it is rendered and the code that populates the table.

What am I doing wrong?

radGridView1.Visible = false;
radGridView1.Columns.Clear();
radGridView1.Rows.Clear();
radGridView1.SummaryRowsTop.Clear();
radGridView1.Refresh();
//radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
// Handle Planning Group definitions if provided.
ColumnGroupsViewDefinition ColView = new ColumnGroupsViewDefinition();
ColView.ColumnGroups.Add(new GridViewColumnGroup("SYSTEM"));
ColView.ColumnGroups.Add(new GridViewColumnGroup("DETAILS"));
ColView.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());
ColView.ColumnGroups[1].Rows.Add(new GridViewColumnGroupRow());
radGridView1.TableElement.BeginUpdate();
GridViewTextBoxColumn gt = new GridViewTextBoxColumn("System");
//gt.MaxLength = 40;
gt.AutoSizeMode = BestFitColumnMode.None;
radGridView1.MasterTemplate.Columns.Add(gt);
ColView.ColumnGroups[0].Rows[0].Columns.Add(radGridView1.Columns["System"]);
for (int x=1; x<10; x++)
{
radGridView1.MasterTemplate.Columns.Add(new GridViewDecimalColumn(x.ToString()));
ColView.ColumnGroups[1].Rows[0].Columns.Add(radGridView1.Columns[x.ToString()]);
}
radGridView1.ViewDefinition = ColView;
// Add data rows
for (int y=1; y<20; y++)
{
// Populate the columns for this system
object[] columns = new object[10]; // Allocate a new array
columns[0] = "System"+y.ToString();
for (int c=1; c<10; c++)
{
columns[c] = Convert.ToDecimal(y*c);
}
radGridView1.Rows.Add(columns);
}
// Done populating grid
radGridView1.TableElement.EndUpdate();
radGridView1.Columns[0].IsPinned = true;
radGridView1.Columns[0].PinPosition = PinnedColumnPosition.Left;
radGridView1.Refresh();
radGridView1.Visible = true; 

 

 

 

Pete
Top achievements
Rank 1
 answered on 01 Oct 2015
2 answers
115 views

Hello:

 When I set uxTreeView.SelectedNode = someNode, if the newly selected node is out of view, the RadTreeView control is scrolled so that the newly selected node is in view and visible.  How do I prevent the scroll from occurring?  I want to select a node that may be out of view, but don't want the node to be scrolled into view.

 Thanks!

Mark
Top achievements
Rank 1
 answered on 30 Sep 2015
2 answers
211 views
I have a project originally developed with 2009.1.402.20 that was recently upgraded to 2010.2.713.40.  All of the RadGrid controls I have are using the Vista Skin.  Before upgrading the skin was applying correctly.  After upgrading, the Vista skin will not apply (nor will any other skin).  Any ideas on how to fix this?
Nathan
Top achievements
Rank 1
 answered on 30 Sep 2015
0 answers
238 views

This is my code to export to excel .But in this code while i press export button then it will export the excel,and shows a message as it is saved ,but it is not opening automatically by the code given ,instead os that it shows file cannot be find.How can i fix it? 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.Data.SqlClient;
using Telerik.WinControls;
using System.IO;
using System.Collections.Specialized;
using System.Web;
using Telerik.WinControls.UI;
using System.Reflection;
using Telerik.WinControls.Export;
using Telerik.WinControls.UI.Export;
using Telerik.WinControls.Data;


namespace Export2html_pdf_excel
{
    public partial class ExportForm : Telerik.WinControls.UI.RadForm
    {
        SaveFileDialog save = new SaveFileDialog();
        public ExportForm()
        {
            InitializeComponent();

        }

        private void RadForm1_Load(object sender, EventArgs e)
        {
            try
            {
                DataTable dt = new DataTable();
                SqlConnection con = new SqlConnection("server=QB_DT_2\\sqlexpress;database=nikeho;user id=sa;password=admin123");
                SqlDataAdapter sda = new SqlDataAdapter("select top 1000 * from idtable", con);
                sda.Fill(dt);
                GridView.DataSource = dt;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }
        }

        private void radRadioButtonExport_ToggleStateChanged(object sender, StateChangedEventArgs args)
        {

            if (this.RBtnExcel.IsChecked)
            {
                save.Filter = "Excel (*.xls)|*.xls";
            }


        }



        private void Export_Click(object sender, EventArgs e)
        {
            if (save.ShowDialog() != DialogResult.OK)             
             {                
                 return;             
             }              
            if (save.FileName.Equals(String.Empty))             
            {                 
                RadMessageBox.SetThemeName(this.GridView.ThemeName);                 
                RadMessageBox.Show("Please enter a file name.");                 
                return;             
            }              
            string fileName = this.save.FileName;             
            bool openExportFile = false;              
            if (this.RBtnExcel.IsChecked)             
            {                 
                RunExportToExcel(fileName, ref openExportFile);            
            }                        

            if (openExportFile==true)
            {
                try
                {
                    System.Diagnostics.Process.Start(fileName);
                }

                catch (Exception ex)
                {
                    string message = String.Format("The file cannot be opened on your system.\nError message: {0}", ex.Message);
                    RadMessageBox.Show(message, "Open File", MessageBoxButtons.OK, RadMessageIcon.Error);

                }
            }
          }


        private void RunExportToExcel(string fileName, ref bool openExportFile)         
        {             
            ExportToExcelML excelExporter = new ExportToExcelML(this.GridView);

            try        
            {               
                this.Cursor = Cursors.WaitCursor;    
                excelExporter.RunExport(fileName);           
                RadMessageBox.SetThemeName(this.GridView.ThemeName);   
                DialogResult dr = RadMessageBox.Show("The data in the grid was exported successfully. Do you want to open the file?",                     "Export to Excel", MessageBoxButtons.YesNo, RadMessageIcon.Question);           
                if (dr == DialogResult.Yes)        
                {                 
                    openExportFile = true;    
                    //System.Diagnostics.Process.Start(fileName);
                }        
            }           
            catch (IOException ex)       
            {               
                RadMessageBox.SetThemeName(this.GridView.ThemeName);   
                RadMessageBox.Show(this, ex.Message, "I/O Error", MessageBoxButtons.OK, RadMessageIcon.Error);    
            }           
            finally        
            {             
                this.Cursor = Cursors.Default;   
            }         
        }

Vivek
Top achievements
Rank 1
 asked on 30 Sep 2015
1 answer
174 views

hi,

 

I have a grid view which has a grouping, I want to have a button within the group, is it possible, the image has been attached & I want a button next to

"Rule Name :Galaxy"

 

Thanks

Regards

Ramraj

Dimitar
Telerik team
 answered on 29 Sep 2015
3 answers
343 views
I have been looking at the ColorBox control, but I cannot figure out how to do simple things.  What I want to do is specify the color displayed when the form containing the ColorBox control is opened, and extract the value of the new color chosen by the user.

I expected to be able to specify something like:

radColorBox1.InitialColor = Red;

and then get the new value if there is one. 

Apparently one gets the new value from the ValueChanging or ValueChanged event handlers, which is straightforward enough I guess.

I program in C#.  Any suggestions will be appreciated.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 29 Sep 2015
2 answers
657 views

Don't know if this has been mentioned before but I'll share my solution anyway.

The issue is when you use the ExportToML on a RadGridView and the resulting excel-file gives you the little green triangle on every cell. Where it says "the number in the cell is formatted as text or preceded by an apostrophe".   The yellow mark gives you the option to "convert to number" before you can use the values as expected.  Highly annoying if you ask me.

Solution

If you google this you get the standard solution of using ExcelCellFormatting event and change

the property of: 

  •  e.ExeclStyleElement.NumberFormat.FormatType
  •  e.ExeclStyleElement.NumberFormat.FormatString.

This however doesn't solve the problem. The solution is not the visual style export, but in the data.

  •  e.ExcelCellElement.Data.DataType = DataType.Number;
  • e.ExcelCellElement.Data.DataItem = old;

 

 

var exporter = new ExportToExcelML(grid) {SheetName = sheetname, ExportVisualSettings = true};
exporter.ExcelCellFormatting += exporter_ExcelCellFormatting;
exporter.RunExport(tempPath);

private static void exporter_ExcelCellFormatting(object sender, ExcelCellFormattingEventArgs e)
{
    if (!e.GridCellInfo.ColumnInfo.Name.StartsWith("v.")) return;
 
    if (e.GridCellInfo.Value == null) return;
 
    e.ExcelStyleElement.NumberFormat.FormatType = DisplayFormatType.Custom;
    e.ExcelStyleElement.NumberFormat.FormatString = "#";
 
    int old;
    if ( int.TryParse(e.GridCellInfo.Value.ToString().Replace(",",""), out old))
    {
        e.ExcelCellElement.Data.DataType = DataType.Number;
        e.ExcelCellElement.Data.DataItem = old;
    }
}

 

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