Telerik Forums
UI for WinForms Forum
1 answer
128 views
Using the latest MaskedEdit control I am attempting to bind the control to a BindingSource using a List of a CustomObjects, similar to...

List<Agency> agencies = GetAgencies();
agencyBindingSource.DataSource = agencies;

Within the Agency object there is a propery called ZipCode, which I am feeding to the MaskedEdit Value propery via DataBinding

this.zipCodeMasked.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.agencyBindingSource, "ZipCode", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged));

I also have a navigation control on the form that allows me to move through out the list and rebinds the controls to the Current object on the list. The strange behavior occurs when moving from one object that has a zipcode to another object that doesn't. When the first object has a ZipCode it appears within the control, however when moving to the next item that doesn't have a ZipCode, the control does not clear. Instead the next item appears to have the same ZipCode as the previous item.

I have use the following rework around...

 

 

var 

 

agencyValues = (Agency)agencyBindingSource.Current;

 

 

 

if (agencyValues != null && !agencyValues.Zip.IsNotNullOrEmpty())

 

 

{

    zipCodeMasked.Value =

null;

 

 

}

 

 

 

 

 

 

 

Boyko Markov
Telerik team
 answered on 20 Mar 2009
3 answers
59 views
I have a RadGridView that starts up with the columns autosized and filled with data when the form loads.  If I minimize the form, then restore it, the columns are all ~40 pixels wide and squished to the left.

Expected behavior:  the columns would still be the size they were when I clicked minimize.
Nikolay
Telerik team
 answered on 19 Mar 2009
0 answers
94 views

I have been noticing that on your RadForm there is a problem with how you get your GetDCEx. To keep it short I'll give you a short piece of code that can help you.

if

(msg.Msg != (int)WindowMessages.WM_NCPAINT)

 

{

 

return GetWindowDC(msg.HWnd);

 

}

 

int flags = (int)(DCX.DCX_CACHE | DCX.DCX_CLIPSIBLINGS

 

|

DCX.DCX_WINDOW );

 

 

 

 

IntPtr zero = IntPtr.Zero;

 

 

if (msg.WParam.ToInt32() != 1)

 

{

flags |= (

int)DCX.DCX_INTERSECTRGN;

 

 

 

zero = msg.WParam;

 

 

 

 

}

 

return GetDCEx(msg.HWnd, zero, flags);

 

 

george
Top achievements
Rank 1
 asked on 19 Mar 2009
2 answers
117 views
Hi,

I'm using RadGridView for many applications here, we are using this mostly for reporting and it works very good!

But i'm not satifisfed by the performance of the data-load. (I'm using RadControls, Q3 2008 SP1)

I'm loading the grid (with default properties) from a DataTable and these are the loading times for a grid with 12 columns:

37 rows - 843 ms
173 rows - 906 ms
319 rows - 1 138 ms

Loading with 5 columns:

35 rows - 423 ms
173 rows - 468 ms
319 rows - 530 ms


Is this to be expected ? Can I set some properties to increase the performance for this ? Is there some kind of 'EnableTurboLoad' property available ? :-)


Olav Botterli
Top achievements
Rank 1
 answered on 19 Mar 2009
1 answer
117 views
I have a grid that has the VerticalScrollState set to AutoHide.  Is there a way at runtime to determine if the vertical scrollbar is currently visible or not?

Thank you.


Jack
Telerik team
 answered on 19 Mar 2009
1 answer
180 views
I using the code in the tabstrip tutorial to put a close "x" button on tabs and it works but is
there any way to actually destroy the tabs instead of hiding or collapsing them?

This is the code from the tutorial...

 Private Function newButton() As RadButtonElement 
 Dim radB As New RadButtonElement() 
 radB.MaxSize = New Size(12, 12) 
 AddHandler radB.Click, AddressOf HideTab 
 radB.Font = New System.Drawing.Font("Verdana", 6, FontStyle.Regular, GraphicsUnit.Point, (DirectCast(0, Byte))) 
 radB.Text = "x" 
 radB.TextAlignment = ContentAlignment.MiddleRight 
 'Alignment defines where the button will be placed on the tab 
 radB.Alignment = ContentAlignment.TopRight 
 Return radB 
End Function 
Private Sub HideTab(ByVal sender As Object, ByVal e As EventArgs) 
 Dim buttonElement As RadElement = (DirectCast(sender, RadElement)) 
 buttonElement.Parent.Visibility = ElementVisibility.Collapsed 
End Sub  

Martin Vasilev
Telerik team
 answered on 19 Mar 2009
1 answer
70 views
I am using the RadSplitButtonElement in my Ribbonbar on my form.
I am adding the RadSplitButtonElement dynamically in code.

I have 2 of them , both are suffering the same issues.
First - No matter what the text alignment or imagealignment or display style or textimagerelation setting , I can not get either of them to display the text at all.

Second , no matter what the image alignment , I cannot get the Image top center or middle center. Top center and middle center always end up with the image top right or right center respectively. Top left and middle left both work fine but basically I am stuck
with my image either right or left.

Any help ?
Peter
Telerik team
 answered on 18 Mar 2009
1 answer
99 views
Does the Q1 2009 Treeview support drag drop operations to other controls, without having to implement Windows drag drop methods?
Victor
Telerik team
 answered on 18 Mar 2009
9 answers
299 views
Hi There,

I working on telerik. I want to maintain the grid header resized from client for that session. For that i provide the grid header resizing facility from client side. For that i used the coding:

 using System; 
using System.Collections; 
using System.IO; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Telerik.Web.UI; 
 
namespace WebApplication1 
 public class GridSettingsPersister 
 private RadGrid gridInstance; 
 
 public GridSettingsPersister( RadGrid gridInstance ) 
 { 
  this.gridInstance = gridInstance; 
 } 
  
 //this method should be called on Render 
 public string SaveSettings() 
 { 
  object[] gridSettings = new object[4]; 
 
  //Save groupBy 
  GridGroupByExpressionCollection groupByExpressions = gridInstance.MasterTableView.GroupByExpressions; 
  object[] groupExpressions = new object[groupByExpressions.Count]; 
 
  int count = 0
  foreach( GridGroupByExpression expression in groupByExpressions ) 
  { 
   groupExpressions[count] = ((IStateManager)expression).SaveViewState(); 
   count++; 
  } 
 
  gridSettings[0] = groupExpressions; 
 
  //Save sort expressions 
  gridSettings[1] = ((IStateManager)gridInstance.MasterTableView.SortExpressions).SaveViewState(); 
 
  //Save columns order 
  int columnsLength = gridInstance.MasterTableView.Columns.Count + 
   gridInstance.MasterTableView.AutoGeneratedColumns.Length; 
 
  Pair [] columnOrder = new Pair[ columnsLength ]; 
 
  ArrayList allColumns = new ArrayList( columnsLength ); 
 
  allColumns.AddRange(gridInstance.MasterTableView.Columns ); 
  allColumns.AddRange(gridInstance.MasterTableView.AutoGeneratedColumns); 
 
  int i = 0
  foreach( GridColumn column in allColumns ) 
  { 
   Pair p = new Pair(); 
   p.First = column.OrderIndex; 
   p.Second = column.HeaderStyle.Width; 
 
   columnOrder[i] = p; 
 
   i++; 
  } 
 
  gridSettings[2] = columnOrder; 
 
 //Save filter expression 
  gridSettings[3] = (object)gridInstance.MasterTableView.FilterExpression; 
 
  LosFormatter formatter = new LosFormatter(); 
 
  StringWriter writer = new StringWriter(); 
  formatter.Serialize( writer, gridSettings ); 
 
  return writer.ToString(); 
 
 } 
 
 //this method should be called on PageInit 
 public void LoadSettings( string settings ) 
 { 
  LosFormatter formatter = new LosFormatter(); 
  StringReader reader = new StringReader( settings ); 
 
  object[] gridSettings = (object[])formatter.Deserialize( reader ); 
 
  //Load groupBy 
  GridGroupByExpressionCollection groupByExpressions = this.gridInstance.MasterTableView.GroupByExpressions; 
  groupByExpressions.Clear(); 
 
  object[] groupExpressionsState = (object[])gridSettings[0]; 
 
  int count = 0
  foreach( object obj in groupExpressionsState ) 
  { 
   GridGroupByExpression expression = new GridGroupByExpression(); 
   ((IStateManager)expression).LoadViewState( obj ); 
   groupByExpressions.Add( expression ); 
   count++; 
  } 
 
  //Load sort expressions 
  this.gridInstance.MasterTableView.SortExpressions.Clear(); 
  ((IStateManager)this.gridInstance.MasterTableView.SortExpressions).LoadViewState( gridSettings[1] ); 
 
  //Load columns order 
  int columnsLength = this.gridInstance.MasterTableView.Columns.Count + 
   this.gridInstance.MasterTableView.AutoGeneratedColumns.Length; 
 
  Pair [] columnOrder = (Pair[])gridSettings[2]; 
 
  if ( columnsLength == columnOrder.Length) 
  { 
   ArrayList allColumns = new ArrayList( columnsLength ); 
 
   allColumns.AddRange(this.gridInstance.MasterTableView.Columns ); 
   allColumns.AddRange(this.gridInstance.MasterTableView.AutoGeneratedColumns); 
 
   int i = 0
   foreach( GridColumn column in allColumns ) 
   { 
    column.OrderIndex = (int)columnOrder[i].First; 
    column.HeaderStyle.Width = (Unit)columnOrder[i].Second; 
 
    i++; 
   } 
  } 
  //Load filter expression 
  this.gridInstance.MasterTableView.FilterExpression = (string)gridSettings[3]; 
 
 } 
}  
By using this coding i am able to maintain the grid resizing for the session. But the problem i am facing is, i have provide facility in my grid that, when i will double click on any of the row in the grid it will move to  edit page, And when i will come back to this page grid header use to come its original size. It's not maintaining the session. I just wanna the grid should maintain the header resized on double click also. Can anybody tell me the way to maintain the session on grid double click also.

Regards:
Vimal Kumar Srivastava
Madhepura, Bihar
Email Id: vimaltech04@gmail.com


Vimal Kumar
Top achievements
Rank 1
 answered on 18 Mar 2009
3 answers
343 views

Hi,

Is it possible to custom the context menu on grid header?

In particular, I want to add a menu item for grouping my grid on one of the columns. That is the only one column my users are likely to group the grid, so I don't want to show the whole group panel.

I may want to add some anther menu items too.

Thanks.

Nikolay
Telerik team
 answered on 18 Mar 2009
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)
Chart (obsolete as of Q1 2013)
Form
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
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
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
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Styling
Barcode
BindingNavigator
PopupEditor
RibbonForm
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
Licensing
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?