Telerik Forums
UI for WinForms Forum
2 answers
201 views

Hello,

I'm binding objects to a GridView, but i need to create properties for my objects at runtime, because I won't know what properties the object has or how many.  (This is a plugin for Autodesk Revit.)  I was able to implement the PropertyBag method here which is working https://www.codeproject.com/Articles/12282/Implementing-a-PropertyBag-in-C  But the GridView just sees "PropertyBag" as one of the properties.  I'm trying to figure out how to get (or if) the GridView to read these 'subproperties'.  I can create columns for each property in runtime but the cells are blank.  Or if it makes sense to set the cell value of the row based on the column's name.  Thanks.

Michael
Top achievements
Rank 1
 answered on 21 Feb 2018
14 answers
4.0K+ views
Hi there
I want to know how could we refresh a ListView after editing it's items programmatically
I tried these but no change in the ListView until I grab the data and fill it again after an event.

I edited just a piece of data

ListViewDataItem item = lv.Items[pos];               
item["Variety"] = this[id] ;
 
lv.Update();
lv.Refresh();

Shouldn't it work ?

I didn't bound it to anything, and it's filled from a collection
if the strategy isn't the preferable approach please give advices on this
thanks in advance
Hristo
Telerik team
 answered on 21 Feb 2018
3 answers
184 views

I have implemented the drag and drop row feature of telerik grid. Now i have to comfirm/prompt user for drag and drop row action with some message like 'Are you sure to drag the selected row?'

I have implemented below two events for the same 

1) Client Side: 

function onRowDropping(sender, args) {

// some code to do something

}

2) Code behind:

protected void grd_RowDrop(object sender, GridDragDropEventArgs e)
{

// some code to do something

}

So, Please suggest how can we achieve this functionality.

1) Once user attempt to drag and drop the row, a confirmation popup should come.

2) If user confirm the action row should be dropped and re-ordered.

3) Else action should be reverted from client side itself.

 

Any help would be highely appriciated.

 

Thnaks,

Manish

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 21 Feb 2018
5 answers
310 views
Our client wants to input dates as MM-dd-yyyy with leading zeros.

I have the RadMaskedEditBox set as:
Mask = MM-dd-yyyy
MaskType = DateTime

What setting is missing to force and keep the leading zeros?    (specifically for the month and day)

With the current settings the following behavior occurs as follows:
    1. radMaskedEditBox.Value = someDateTimeObject; results in the leading zero of the month does not show
    2. Typing 0 causes the month mask to collapse to one character. The client expects to see 00 all the time as the 
        double 'M' explicity specifies requiring two digits.
    3. After typing the second digit the zero is not shown.  For example, typing '04' only shows '4'.
    4. The mask sticks on the month, never advancing to the day.  For example, typing '04022009' only results in '9-00-0000'
        as the last digit typed was a nine.
Hristo
Telerik team
 answered on 21 Feb 2018
1 answer
688 views
Hi I’m developing an application and I need to bind the combobox column to difference datasources depending on the value of another cell. For example; when the user enters value “fruits” in a cell of a row 1, the next cell, which is a combobox presents to the user items of fruits only; when he enters “cars” in the next row only cars are listed in the combobox cell of the row. How do I achieve that?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 20 Feb 2018
6 answers
232 views
Hi Telerik Folks,

We've overridden our "ProcessKey(KeyEventArgs keys) in a customized BaseGridBehavior class that we're using.  In doing this, the default keys for selecting a block of cells (Shift + the arrow keys) are no longer working.

To overcome this we're trying to put in custom code to explicitly do the same thing.  It looks like this...

01.    public class MyGridBehavior : BaseGridBehavior
02.    {
03. 
04. 
05.        public void SelectCellBlock(GridViewCellInfo SelectedCellTopLeft,GridViewCellInfo SelectedNewCell)
06.        {
07.            this.GridControl.ClearSelection();
08. 
09. 
10.            int TopRowIndex = SelectedCellTopLeft.RowInfo.Index <= SelectedNewCell.RowInfo.Index ? SelectedCellTopLeft.RowInfo.Index : SelectedNewCell.RowInfo.Index;
11.            int BottomRowIndex = SelectedCellTopLeft.RowInfo.Index >= SelectedNewCell.RowInfo.Index ? SelectedCellTopLeft.RowInfo.Index : SelectedNewCell.RowInfo.Index;
12. 
13.            int LeftColumnIndex = SelectedCellTopLeft.ColumnInfo.Index <= SelectedNewCell.ColumnInfo.Index ? SelectedCellTopLeft.ColumnInfo.Index : SelectedNewCell.ColumnInfo.Index;
14.            int RightColumnIndex = SelectedCellTopLeft.ColumnInfo.Index >= SelectedNewCell.ColumnInfo.Index ? SelectedCellTopLeft.ColumnInfo.Index : SelectedNewCell.ColumnInfo.Index;
15. 
16.            //this.GridControl.GridNavigator.BeginSelection(new GridNavigationContext() { InputType = InputType.Keyboard, ModifierKeys = Keys.Shift });
17. 
18.            for (int rowIndex = TopRowIndex; rowIndex <= BottomRowIndex; rowIndex++)
19.            {
20.                for (int columnIndex = LeftColumnIndex; columnIndex <= RightColumnIndex; columnIndex++)
21.                {
22.                    this.GridControl.Rows[rowIndex].Cells[columnIndex].IsSelected = true;
23.                }
24.            }
25.        }
26. 
27.        public override bool ProcessKey(KeyEventArgs keys)
28.        {
29. 
30.            if (keys.Shift && keys.KeyCode ==Keys.Down)
31.            {               
32.                GridViewCellInfo SelectedCellTopLeft = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
33.                this.GridControl.GridNavigator.SelectNextRow(1);
34.                GridViewCellInfo SelectedNewCell = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
35.                SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);
36.                return false;
37.                     
38.            }
39. 
40.            if (keys.Shift && keys.KeyCode == Keys.Up)
41.            {
42.                GridViewCellInfo SelectedCellTopLeft = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
43.                this.GridControl.GridNavigator.SelectPreviousRow(1);
44.                GridViewCellInfo SelectedNewCell = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
45.                SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);
46.                return false;
47. 
48.            }
49. 
50.            if (keys.Shift && keys.KeyCode == Keys.Left)
51.            {               
52.                GridViewCellInfo SelectedCellTopLeft = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
53.                this.GridControl.GridNavigator.SelectPreviousColumn();
54.                GridViewCellInfo SelectedNewCell = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
55.                SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);
56.                return false;
57.            }
58. 
59.            if (keys.Shift && keys.KeyCode == Keys.Right)
60.            {
61.                GridViewCellInfo SelectedCellTopLeft = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
62.                this.GridControl.GridNavigator.SelectNextColumn();
63.                GridViewCellInfo SelectedNewCell = this.GridControl.SelectedCells.OrderBy(r => r.RowInfo.Index).ThenBy(c => c.ColumnInfo.Index).FirstOrDefault();
64.                SelectCellBlock(SelectedCellTopLeft, SelectedNewCell);
65.                return false ;
66.            }
67.      }
68.}


...It works, pretty much but it's performance gets exponentially slower the larger the block of cells that is selected holding down the Shift key.  It does this most likely because it loops through every cell and individually selects and flips the "IsSelected" property.

Is there a more efficient way to select blocks of cells, like using the GridNavigator.BeginSelection?  Is there a sample for using the GridNavigationContext parameter to do it this way given two cell addresses?

Are we going about this the wrong way?  Is there a more efficient way to make it opt out of our ProcessKey override and have it use the default behavior?

Thanks for any help you can provide...
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 20 Feb 2018
3 answers
180 views
How on some columns to disconnect available filter?
And in the first column, leave only containce?
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 20 Feb 2018
5 answers
1.2K+ views
I guess I am the only person who can't figure this out, but how do I programmatically set the size of a panel in the splitcontainer?  I have a form that has 2 panels and I want to be able to resize the containers on startup based on size during last use.  I have tried:
  • Setting Panel Heights
  • Setting radSplitContainer1.SplitPanels[?].Height
  • Setting radSplitContainer1.Splitters[0].Location

I am out of ideas.  Please let me know if this is possible.

Thanks,
Lee
Hristo
Telerik team
 answered on 19 Feb 2018
3 answers
156 views

Hello all telerik users,

I'm a new user of Telerik Objects and I have a problem where using a RadDropDownListItem in RadRibbonBarGroup.

In this case (Design form) the datasource property of the RadDropDownListItems is disabled. I don't understand. When I put a RadDropDownListItem elsewhere in the form this property is enabled. And of course I need it would be enabled inside a RadRibbonBarGroup.

I have to say that I'm not a C# or VB user but a Progress OpenEdgeStudio user.

 

Thanks a lot for your answers.

 

JP CLARY

Dimitar
Telerik team
 answered on 19 Feb 2018
5 answers
883 views
The radgridview that I've setup allows a user to click the delete button to delete a row.  This works well, but I'd like to prompt the user to confirm a delete.  I've tried to see if there is an event to capture the delete and allow a cancel, but it does not appear to exist.  I realize I could use a delete button, but I do not wish to use this.

Thank you in advance,
   Dennis
Dimitar
Telerik team
 answered on 19 Feb 2018
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
MessageBox
TrackBar
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
ShapedForm
SyntaxEditor
Wizard
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
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
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?