Telerik Forums
UI for WinForms Forum
10 answers
128 views
Here is the problem I am having:

1. I created a simple RadForm called form1.cs and added a number of labels, panels and text boxes to it.  I run this form and everything is good.

2. I created a second RadForm called form2.cs and it extends form1.cs.  I run this form and everything works fine.

3. I add a RadListControl to form2.  I run this and the designer view of the form disappears, the program runs, when I exit the program I get an error stating "The designer loader did not provide a root component but has not indicated why."  and the designer view is gone.

4. I close form2.cs, rebuild the project and open form2.cs and it appears in the designer.   As soon as I make any code changes to form2.cs (even as simple as moving the locaiton of a control by one pixel), save and run the file I get the same error listed in step 3.

This only has happened to me with the RadListControl.  textboxes, labels, panels, manu bars, status bars, etc. do not exhibit this behavior.

I have a full solution I can provide that causes the problem.  Tried to open a support ticket but there is no option for the ListControl.  Let me know what I should try next.

BTW, Computer is HP laptop, Windows 7, latest winForms release (Q2 SP1 build 806), VS 2010 Ultimate.  I believe everyting Microsoft is at latest patch level.
Dimitar
Telerik team
 answered on 27 Jun 2016
1 answer
125 views

We have recently converted our controls from win form control to telerik control.

Now "_" is being shown for mnemonic all the time (without pressing Alt key).
Earlier when user press Alt key all the mnemonic get highlighted with _.
i want the same old visual style. 
Any help will be really helpful.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Jun 2016
8 answers
956 views
When I press a key inside a grid, a mnemonic outside the grid is activated, instead of the grid entering edit mode.
For instance, with a combo box column, I expect the first item starting with the key pressed to be selected.

To reproduce, add a grid view, and standard win forms button to a form.  Add the following code to the form:
public Form1()
{
    InitializeComponent();
    var list = new List<Data>();
    list.Add(new Data(1, "Apple"));
    list.Add(new Data(2, "Banana"));
    list.Add(new Data(3, "Orange"));
  
    var lookupList = list.ToList();
  
    radGridView1.MasterTemplate.AllowAddNewRow = false;
    radGridView1.MasterTemplate.AllowColumnChooser = false;
    radGridView1.MasterTemplate.AllowDeleteRow = false;
    radGridView1.MasterTemplate.AllowDragToGroup = false;
    radGridView1.MasterTemplate.EnableGrouping = false;
    radGridView1.ShowGroupPanel = false;
    radGridView1.Columns.Add(new GridViewComboBoxColumn("Key") { DataSource = lookupList, ValueMember = "Key", DisplayMember = "Value" });
    radGridView1.Columns.Add(new GridViewTextBoxColumn("Value"));
    radGridView1.DataSource = list;
  
    button1.Text = "&Button";
    button1.Click += button1_Click;
}
  
private void button1_Click(object sender, EventArgs e)
{
    RadMessageBox.Show(this, "Button Pressed");
}

Add the following class:
public class Data
{
    public Data(int key, string value)
    {
        Key = key;
        Value = value;
    }
  
    public int Key { get; set; }
    public string Value { get; set; }
}

Click on a combo box cell and type "b".  The button is activated, instead of selecting Banana in the combo.

Is this a bug?
Is there a work around?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 24 Jun 2016
1 answer
377 views

I want to be able to set the backcolor for the chart itself with a gradient.  I can easily set the backcolor property but don't see away to control the gradient.  I see that in the property build under Edit UI Elements there is the RadChartElement.  Not sure how to get to that programmatically?  Please advise or let me know the correct way to accomplish this.

Thanks

Dimitar
Telerik team
 answered on 24 Jun 2016
9 answers
333 views

Hi

i use telerik 2015 q3 for winforms

i wanna change the shape of my labels. i have several labels and each of them must have their own shape.

i use the shape property in the in smart tag -> edit ui element -> root element -> shape

and select my predefiened shape and then change the border primitive shape and my label shape change successfully.

but when i use the create new shape instead of select predefined shape nothing happen and when i finish create new one in custom shape editor and click ok, no chnage apeare.

could you please tell me right way

Regard

Hristo
Telerik team
 answered on 22 Jun 2016
3 answers
220 views
In Microsoft Excel there is an option named Add Current Selection to Filter. Actually, in Excel, when you search a key in filter popup and click OK, then when you search another key in filter popup then there is an option named 'Add Current Selection to Filter'. I need something like this option in radGridView Excel Like Filtering. Please see the attached file.
Dimitar
Telerik team
 answered on 22 Jun 2016
1 answer
958 views


Hi,

I'm having some problems with the RadGridView's DataBindingComplete event handler in a async context and with the Telerik's WinForm RadGridView BestFitColumns method.

I'm developing an winforms with Telerik application that loads data from several db tables and shows them in distinct RadGridViews (one for each table source).
Each of the grids is inside a DocumentWindow. Each DocumentWindow is inside DocumentContainer and all of the DocumentContainers are under a single aggregating Docking.DocumentTabStrip.

The process db table information process is asyncronous so that the UI is free allowing the user to see the information in one table when it becomes available even if one of the other tables are still being loaded.

The first problem is that the DataBindingComplete is only triggered when the user selects the respective tab. Since some of the DataBindingComplete logic can be quite time consuming it leads to a undesired user experience until the data is finally presented.
Is there an alternative event that can be triggered when the data is already available in the RadGridView but without the need of having the user triggering it?

The second is with the way the BestFitColumns method determines the column width. The native DataGridView column's AutoSizeMode contains a option of AllDataCellsExceptHeader that I'm unable to emulate in Telerik.
The documentation for these options is rather scarce and all of the tried options fall short.
Of the available options the closest are the AllCells, DisplayedCells and DisplayedDataCells as the others do not take in account the cell's values.
The AllCells and DisplayedCells use the column headers as input and that makes data spread out too much, which is undesired.
The closest is DisplayedDataCells that sort of works but the logic seems to only use the cells in the rows in the visible range. (I.E.: the rows presented when the grid is presented in the UI). Trying to explain better, if form only displays the first Nth data rows, after the method runs the data will be visible correctly formatted, but if the (N+1) row data has a width larger than any of the first Nth rows the displayed data will be truncated and suffixed with the "..". Is there a way to emulate the AllDataCellsExceptHeader at all?

Thanks for your help.

Regards,

I've implement it using the following logic (snipped code).

(..)
  private async void displayButton_Click (object sender, EventArgs e) {
  (..)
    await Task.Run(() => Parallel.ForEach(tablesToRetrieve.Keys, tableID => {
      (..)
      DocumentWindow docWindow = ((DocumentWindow)returnedDataDocumentTabStrip.Controls[tableName]);
       
      if (GetDBTableData(tableID, tableArguments, out dataTable)) {
        docWindow.Invoke((Action)delegate {
          docWindow.Controls.Add(newRadView(dataTable));
          docWindow.Refresh();
        });
      }
      (..)
    }));
  }
  (..)
  private RadGridView newRadView(DataTable dTable) {
  
    RadGridView gridView = new RadGridView();   
    gridView.AutoSizeRows = false;
    gridView.AllowAutoSizeColumns = true;
    gridView.ReadOnly = true;
    gridView.AutoExpandGroups = true;
    gridView.AllowAddNewRow = false;
    gridView.AllowDeleteRow = false;
    gridView.AllowColumnReorder = true;
    gridView.AllowColumnResize = true;
    gridView.MultiSelect = true;
    gridView.SelectionMode= GridViewSelectionMode.CellSelect;       
    gridView.EnableFiltering = true;
    gridView.MasterTemplate.EnableFiltering = true;       
    gridView.ShowHeaderCellButtons = true;
    gridView.EnableAlternatingRowColor = true;
    gridView.EnableGrouping = true;
    gridView.MasterTemplate.EnableGrouping  =true;
    gridView.EnableSorting = true;
    gridView.MasterTemplate.EnableSorting = true;       
    gridView.TableElement.AlternatingRowColor = Color.FromArgb(240, 240, 240);
    gridView.TableElement.RowHeight = 18;
    gridView.ShowFilteringRow = true;
    gridView.Dock = DockStyle.Fill;       
    gridView.AllowSearchRow = true;       
    gridView.SearchRowPosition = SystemRowPosition.Bottom;
    gridView.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None;   
    gridView.Name = dTable.TableName;
     
    /* Arm events handlers   
    gridView.ViewCellFormatting += gridView_ViewCellFormatting;
    gridView.DataBindingComplete += gridView_DataBindingComplete;
    gridView.ToolTipTextNeeded += gridView_ToolTipTextNeeded;
 
    /* Load dataTable data */
    gridView.BeginUpdate();
    gridView.DataSource = new BindingSource(dataTable, null);
     
    /* Customize table sort assumptions */   
    gridView.SortDescriptors.Add(new SortDescriptor("DUMMY_COLUMN", System.ComponentModel.ListSortDirection.Descending));
     
    gridView.EndUpdate(true);
     
    return gridView; 
  }
  (..)
  private void gridView_ViewCellFormatting(object sender, CellFormattingEventArgs e) {
    if (e.CellElement.GetType() == typeof(GridHeaderCellElement))
      e.CellElement.TextWrap = true;
  }
  (..)
  private void gridView_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e) {
    RadGridView gridView = (RadGridView)sender;
     
    /* Show/Shift/Hide columns to display */
    (..)
     
    /* Finally Adjust columns to it's data */
    gridView.BestFitColumns(BestFitColumnMode.DisplayedDataCells);
  }

Hristo
Telerik team
 answered on 22 Jun 2016
1 answer
42 views

Hi,

 

I was wondering how I would go about modifying the radCalender control so that the currentTimePointer is drawn only on the current week rather than on every week in the calendar.

 

I already have a customDayViewApppointmentsTable class that derives from the DayViewAppointmentsTable class that I've used to modify the size of the currentTimePointer, would the desired functionality be accessed through another override in this class?

 

Thanks,

Robert

Hristo
Telerik team
 answered on 21 Jun 2016
3 answers
146 views

I need a ComboBox column initialized with some data and the user can enter new data too when inserting new row into grid. For example, ComboBox column has three items by default Phone, Mobile, Fax, but the user needs to insert new item (e.g., Code). How can I do this?

Here is the code. With this code the user can only select one of the default values of combo column and he/she cannot enter his/her new value into combo column.

DataTable table = new DataTable();
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Value", typeof(string));
var details = db.BatchItemDetails.Where(d => d.BatchItem_Id == _id)
                       .Select(d => new { d.Name, d.Value });
foreach (var row in details)
   table.Rows.Add(row.Name, row.Value);
 
grid.MasterTemplate.AutoGenerateColumns = false;
grid.DataSource = table;
 
GridViewComboBoxColumn name = new GridViewComboBoxColumn();
name.DataSource = (from b in db.Batches
             join i in db.BatchItems on b.Id equals i.Batch_Id
             join d in db.BatchItemDetails on i.Id equals d.BatchItem_Id
             where b.Id == batchId
             orderby d.Name
             select d.Name).Distinct().ToArray(); // string array.
 
name.AutoCompleteMode = AutoCompleteMode.Suggest;
name.DropDownStyle = RadDropDownStyle.DropDown;
name.Name = "Name";
name.FieldName = "Name";
name.HeaderText = "عنوان اطلاعات";
name.Width = 219;
name.TextAlignment = ContentAlignment.MiddleLeft;
grid.Columns.Add(name);
 
grid.Columns.Add("Value", "شرح اطلاعات", "Value");
grid.Columns["Value"].Width = 353;
 
grid.AutoSizeRows = true;

Hristo
Telerik team
 answered on 21 Jun 2016
5 answers
140 views

Hello,

i created a custom cell element.

The custom part of the Element is a RadListControl.

The functionality works but I want the ListControl Element fit perfect in the Cell.

I have tried a lot and read many forum threads to find a solution but nothing works.

There are still Gaps (see Screenshot).

I hope someone can help me quick with my request.

Greets André

 

Dimitar
Telerik team
 answered on 21 Jun 2016
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
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
CollapsiblePanel
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
Styling
Barcode
PopupEditor
RibbonForm
TaskBoard
Callout
NavigationView
ColorBox
PictureBox
FilterView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
BreadCrumb
ButtonTextBox
FontDropDownList
BarcodeView
Security
LocalizationProvider
Dictionary
SplashScreen
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
ToolbarForm
NotifyIcon
DateOnlyPicker
AI Coding Assistant
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?