Telerik Forums
UI for WinForms Forum
2 answers
83 views

Hi, I've tried to create a radGridView control programmatically so I can host it inside of a radHostControl, I do believe the problem has nothing to do with hosting as it occurs before I host it. : When I create teh control using the following code, I give it a Datasource which has data, however the control reports that it has no columns in its properties. And continuing, the control actually shows the data and all the columns when the app is live; the problem being I can't access these columns as they apparently do not exist:

            RadGridView gridView = new RadGridView();
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition14 = new Telerik.WinControls.UI.TableViewDefinition();

            gridView.BeginInit();
            gridView.MasterTemplate.BeginInit();

            gridView.Size = new Size(100, 300);
            gridView.AutoGenerateColumns = true;
            gridView.DataSource = blacklistProps;
            getBlacklist();

            gridView.MasterTemplate.AllowAddNewRow = false;
            gridView.MasterTemplate.AllowColumnChooser = false;
            gridView.MasterTemplate.AllowColumnHeaderContextMenu = false;
            gridView.MasterTemplate.ShowColumnHeaders = false;
            gridView.MasterTemplate.ShowFilteringRow = false;
            gridView.MasterTemplate.ShowRowHeaderColumn = false;
            gridView.MasterTemplate.ViewDefinition = tableViewDefinition14;
            gridView.Name = "blacklistGridView";

            gridView.RootElement.MinSize = new System.Drawing.Size(0, 0);
            gridView.ShowGroupPanel = false;
            //gridView.Size = new System.Drawing.Size(316, 381);
            gridView.TabIndex = 0;

            gridView.ContextMenuOpening += new Telerik.WinControls.UI.ContextMenuOpeningEventHandler(this.gridViewMappings_ContextMenuOpening);

            gridView.MasterTemplate.EndInit();
            gridView.EndInit();

Nathan
Top achievements
Rank 1
 answered on 23 Jun 2017
15 answers
643 views
Hi,

My grid is a readonly grid and with FullRow Selection mode. But still are the cells highlighted when i'm clicking in the grid. Look at the attached screenshot.

How can I disable this highlighting ? 

I have tried with this code, but still the cell is "in a way" highlighted..

if (e.CellElement.IsCurrent)
            {
                e.CellElement.DrawFill = false;
                e.CellElement.DrawBorder = false;
            }
            else
            {
                e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, Telerik.WinControls.ValueResetFlags.Local);
                e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, Telerik.WinControls.ValueResetFlags.Local);
            }

BTW: The EnableHotTracking is truned of.

Regards
Svein Thomas
Hristo
Telerik team
 answered on 23 Jun 2017
5 answers
1.6K+ views
Hi everybody!

I'm looking something which allow me to set the cursor at the beginning of my MaskedTextBox.

I have a mask like this : '00 00 00 00 00'
When I enter into my field, my cursor isn't at begin.    '00 0|0 00 00 00' instead of    '|00 00 00 00 00'

I tried this code :

private void maskedTextBox1_Enter(object sender, EventArgs e)
        {
            if ((maskedTextBox1.Text.Trim()).Length == 0)
            {
                maskedTextBox1.Focus();
                SendKeys.Send("{HOME}");
                MessageBox.Show(maskedTextBox1.Focused.ToString());
            }
        }

But it doesn't work.

I tried the same code on MouseUp Action but I need to select the control.
If I do a MouseUp inside MaskedTextBox nothing happend, but if I do a MouseUp on the border of my MaskedTextBox, it works. Why?

What should I do in order to set my cursor in the first position?

I tried maskedTextBox1.SelectionStart = 0; but doesn't work.

Thanks

Lookoum
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 23 Jun 2017
15 answers
468 views
I get an error in RadGridView when I closing the form.
But I never use this property =="

Full Message below:
Code generation for property 'PrintCellPaint' failed. Error was:'Object does not match target type'.

Please refer the attachment...

Thank You

Hristo
Telerik team
 answered on 23 Jun 2017
0 answers
140 views

Hi!

Is there a way, maybe I'm missing something, to apply a DataTypeConverer to a DropDownList, the same as we are able to do with a column in a RadGridView?

The idea is that the DisplayMember I need to set is a collection of KeyValuePair. Depending on a key configured externally, I need to choose a specific value. This can be done for grid by applying a custom DataTypeConverter.

For example, let's say the data source is like the following:

var dataSource = new List<Entity>{
        new Entity
{
            int Id = 1;
            string Name = "NameSample";
            Dictionary<int, string> Descriptions = new Dictionary<int, string>
            {
                {0, "descriptionInEnglish"},
                {1, "descriptionInGerman"}
            };
        }

};

I need to set the DisplayMember of the DropDownList to show the description in a language depending on an external setting.

 

Thanks!

Timotei
Top achievements
Rank 1
 asked on 22 Jun 2017
1 answer
136 views

I have a GridViewComboBoxColumn and while in edit mode I want the StretchVertically to be false so I use the following code:

this.radGridView1.CellBeginEdit += RadGridView1_CellBeginEdit;

private void RadGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
switch (e.Column.Name)
{
case "MyColumn":
RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
if (editor != null)
{
editor.EditorElement.StretchVertically = false;
editor.EditorElement.Alignment = ContentAlignment.TopLeft;
}

But the dropdownlisteditor is still vertically centered in the cell. Is there a way to have it TopLeft?

Dimitar
Telerik team
 answered on 21 Jun 2017
3 answers
111 views

Hi,

I defined  item and dragged it to the radDiagram. 

My question is how to find the items by ID? 

When I found the IDs, I would connect two items programmatically. <Source and target are known>.

I used this code

 MessageBox.Show(radDiagram1.Shapes[0].Name.ToString());

but nothing ...

But when I used this code

MessageBox.Show(radDiagram1.Shapes[0].Width.ToString());

the width was shown!

I need to find the items individually. 

Thank you

 

Dimitar
Telerik team
 answered on 21 Jun 2017
16 answers
1.7K+ views
Hi guys,

I fall into a problem of performance when binding a BindingList<T> to a grid where T implements INotifyPropertyChanged interface.

Exactly, what happens is that, having a lot of rows (10000), when I change a property of one object the FirePropertyChanged method takes some seconds and I don't understand why.

Can someone help me about that?

Thanks in advance.

Stefano.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 21 Jun 2017
4 answers
106 views

Is there a way to change the button on the collapsible panel from a round button to a rectangle?  I would have TEXT in the button instead of a UP/DOWN arrow?

 

TIA

Mark
Top achievements
Rank 2
Bronze
Bronze
Veteran
 answered on 20 Jun 2017
16 answers
1.3K+ views
Hi,

I have a hierarchical grid with some childs. Now I need to set programatically the right Row and Column in the grid (after the user has clicked somewhere). In the normal grid this is easy and goes just this:

grid.CurrentRow = grid.Rows[rowIndex];<br>grid.CurrentColumn = grid.Columns[fieldIndex];


But when the cell is in one of the child grids it gets complicated. After searching the grid I know in which child in which row it is. Since the rows in each child grids are also zerobased, my only solution to set the correct line is this one (if it is in the first level of the hierarchy):

grid.CurrentRow = selectedRow.ViewInfo.ParentRow.ChildRows[rowIndex];

But I cannot get set the correct column.
grid.CurrentColumn = selectedRow.ViewInfo.ParentRow.ChildRows[rowIndex].ViewTemplate.Columns[fieldIndex];

The expression on the right side returns the correct index. But assigning to grid.CurrentColumn doesn't change anything. No error, but also no setting of the currentcolumn.

  1. Can anybody help how to set this correctly?
  2. Is there a more elegant generic solution to get to right child? For now I would just need to hardcode the access to each child level.

Thanks,
Michael                                     
                                    
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 20 Jun 2017
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?