Inherited from Control. BorderBrush Gets or sets a brush that describes the border background of a control.
BorderThickness Gets or sets the border thickness of a control. CacheMode Gets or sets a value that indicates that rendered content should be cached when possible. CanUserReorderColumns Gets or sets a value that indicates whether the user can change the column display order by dragging column headers with the mouse. CanUserResizeColumns Gets or sets a value that indicates whether the user can adjust column widths using the mouse.
CanUserSortColumns Gets or sets a value that indicates whether the user can sort columns by clicking the column header. CellStyle Gets or sets the style that is used when rendering the data grid cells.
CharacterSpacing Gets or sets the distance between characters of text in the control measured in ths of the font size. ClipboardCopyMode Gets or sets a value that indicates how data is copied to the clipboard. ColumnHeaderHeight Gets or sets the height of the column headers row. ColumnHeaderStyle Gets or sets the style that is used when rendering the column headers.
Columns Gets a collection that contains all the columns in the control. ColumnWidth Gets or sets the standard width or automatic sizing mode of columns in the control.
CurrentColumn Gets or sets the column that contains the current cell. CurrentItem Gets the data item bound to the row that contains the current cell. Cursor Gets or sets the cursor image that displays while the mouse pointer is over a FrameworkElement.
DataContext Gets or sets the data context for a FrameworkElement when it participates in data binding. DefaultStyleKey Gets or sets the key that references the default style for the control. DesiredSize Gets the size that this UIElement computed during the measure pass of the layout process. Dispatcher Gets the Dispatcher this object is associated with. Inherited from DependencyObject. DragIndicatorStyle Gets or sets the style that is used when rendering the drag indicator that is displayed while dragging column headers.
DropLocationIndicatorStyle Gets or sets the style that is used when rendering the column headers. Effect Gets or sets the pixel shader effect to use for rendering this UIElement. FlowDirection Gets or sets the direction that text and other user interface elements flow within any parent element that controls their layout. FontFamily Gets or sets the font used to display text in the control.
FontSize Gets or sets the size of the text in this control. FontStretch Gets or sets the degree to which a font is condensed or expanded on the screen. FontStyle Gets or sets the style in which the text is rendered. FontWeight Gets or sets the thickness of the specified font. Foreground Gets or sets a brush that describes the foreground color. FrozenColumnCount Gets or sets the number of columns that the user cannot scroll horizontally. GridLinesVisibility Gets or sets a value that indicates which grid lines separating inner cells are shown.
HeadersVisibility Gets or sets a value that indicates the visibility of row and column headers. Height Gets or sets the suggested height of a FrameworkElement. HorizontalAlignment Gets or sets the horizontal alignment characteristics that are applied to a FrameworkElement when it is composed in a layout parent, such as a panel or items control.
HorizontalContentAlignment Gets or sets the horizontal alignment of the control's content. HorizontalScrollBarVisibility Gets or sets a value that indicates how the horizontal scroll bar is displayed.
IsEnabled Gets or sets a value indicating whether the user can interact with the control. IsReadOnly Gets or sets a value that indicates whether the user can edit the values in the control. IsTabStop Gets or sets a value that indicates whether a control is included in tab navigation. IsValid Gets a value that indicates whether data in the grid is valid. ItemsSource Gets or sets a collection that is used to generate the content of the control. Margin Gets or sets the outer margin of a FrameworkElement.
MaxHeight Gets or sets the maximum height constraint of a FrameworkElement. MaxWidth Gets or sets the maximum width constraint of a FrameworkElement. MinHeight Gets or sets the minimum height constraint of a FrameworkElement. MinWidth Gets or sets the minimum width constraint of a FrameworkElement. Name Gets or sets the identifying name of the object.
Opacity Gets or sets the degree of the object's opacity. OpacityMask Gets or sets the brush used to alter the opacity of regions of this object. Padding Gets or sets the padding inside a control. Parent Gets the parent object of this FrameworkElement in the object tree.
Projection Gets or sets the perspective projection 3-D effect to apply when rendering this UIElement. RenderTransform Gets or sets transform information that affects the rendering position of a UIElement.
RenderTransformOrigin Gets or sets the origin point of any possible render transform declared by RenderTransform , relative to the bounds of the UIElement. Resources Gets the locally defined resource dictionary. Resources property element, through XAML implicit collection syntax.
RowBackground Gets or sets the Brush that is used to paint row backgrounds. RowDetailsTemplate Gets or sets the template that is used to display the content of the details section of rows. RowDetailsVisibilityMode Gets or sets a value that indicates when the details sections of rows are displayed. RowGroupHeaderStyles Gets the style that is used when rendering the row group header.
RowHeaderStyle Gets or sets the style that is used when rendering the row headers. RowHeaderWidth Gets or sets the width of the row header column. RowHeight Gets or sets the standard height of rows in the control. RowStyle Gets or sets the style that is used when rendering the rows. SelectedIndex Gets or sets the index of the current selection. SelectedItem Gets or sets the data item corresponding to the selected row. SelectedItems Gets a list that contains the data items corresponding to the selected rows.
SelectionMode Gets or sets the selection behavior of the data grid. Style Gets or sets an instance Style that is applied for this object during rendering. TabIndex Gets or sets a value that determines the order in which elements receive focus when the user navigates through controls by using the TAB key.
TabNavigation Gets or sets a value that modifies how tabbing and TabIndex work for this control. Tag Gets or sets an arbitrary object value that can be used to store custom information about this object.
Template Gets or sets a control template. Triggers Gets the collection of triggers for animations that are defined for a FrameworkElement. UseLayoutRounding Gets or sets a value that determines whether rendering for the object and its visual subtree should use rounding behavior that aligns rendering to whole pixels.
VerticalAlignment Gets or sets the vertical alignment characteristics that are applied to a FrameworkElement when it is composed in a parent object such as a panel or items control. VerticalContentAlignment Gets or sets the vertical alignment of the control's content. VerticalScrollBarVisibility Gets or sets a value that indicates how the vertical scroll bar is displayed. Visibility Gets or sets the visibility of a UIElement. A UIElement that is not visible does not render and does not communicate its desired size to layout.
Width Gets or sets the width of a FrameworkElement. Methods Name Description AddHandler Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element.
Specify handledEventsToo as true to have the provided handler be invoked for routed event that had already been marked as handled by another element along the event route. ApplyTemplate Loads the relevant control template so that its parts can be referenced. Arrange Positions child objects and determines a size for a UIElement.
Parent objects that implement custom layout for their child elements should call this method from their layout override implementations to form a recursive layout update. ArrangeOverride Arranges the content of the DataGrid. Overrides FrameworkElement. ArrangeOverride Size. BeginEdit Causes the data grid to enter editing mode for the current cell and current row, unless the data grid is already in editing mode.
BeginEdit RoutedEventArgs Causes the data grid to enter editing mode for the current cell and current row in the specified keyboard and mouse state. CancelEdit Causes the data grid to cancel the current edit, restore the original value, and exit editing mode. CancelEdit DataGridEditingUnit Causes the data grid to cancel the current edit, restore the original value, and exit editing mode. CheckAccess Determines whether the calling thread has access to this object.
ClearValue Clears the local value of a dependency property. CollapseRowGroup Collapses data grid row groups. CommitEdit Causes the data grid to commit the current edit to the data source and exit editing mode. CommitEdit DataGridEditingUnit, Boolean Causes the data grid to commit the current edit to the data source, and optionally exit editing mode. Equals Object Determines whether the specified Object is equal to the current Object. Inherited from Object. ExpandRowGroup Expands data grid row groups.
Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. FindName Retrieves an object that has the specified identifier name. Focus Attempts to set the focus on the control.
GetAnimationBaseValue Returns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active.
GetBindingExpression Retrieves the BindingExpression for a dependency property where a binding is established. GetGroupFromItem Gets the row group that the specified item belongs to. GetHashCode Serves as a hash function for a particular type. GetType Gets the Type of the current instance. GetValue Returns the current effective value of a dependency property from a DependencyObject. After the invalidation, the UIElement will have its layout updated, which will occur asynchronously.
Typically, objects that implement custom layout for their layout children call this method from their own MeasureOverride implementations to form a recursive layout update. MeasureOverride Size. MemberwiseClone Creates a shallow copy of the current Object. Overrides UIElement. OnDrop Called before the Drop event occurs. OnLostMouseCapture Called before the LostMouseCapture event occurs to provide handling for the event in a derived class without attaching a delegate.
Overrides Control. ReadLocalValue Returns the local value of a dependency property, if a local value is set. After this call, typically no object holds mouse capture. ScrollIntoView Scrolls the DataGrid vertically to display the row for the specified data item and scrolls the DataGrid horizontally to display the specified column. SetBinding Attaches a binding to a FrameworkElement , using the provided binding object, and returns a BindingExpressionBase for possible later use.
SetValue Sets the local value of a dependency property on a DependencyObject. ToString Returns a string that represents the current object. TransformToVisual Returns a transform object that can be used to transform coordinates from the UIElement to the specified object. UpdateLayout Ensures that all positions of child objects of a UIElement are properly updated for layout.
Events Name Description AutoGeneratingColumn Occurs one time for each public, non-static property in the bound data type when the ItemsSource property is changed and the AutoGenerateColumns property is true. BeginningEdit Occurs before a cell or row enters editing mode. BindingValidationError Occurs when a data validation error is reported by a binding source. CellEditEnded Occurs when a cell edit has been committed or canceled. CellEditEnding Occurs when a cell edit is ending.
ColumnHeaderDragCompleted Occurs when the user drops a column header that was being dragged using the mouse. ColumnHeaderDragDelta Occurs one or more times while the user drags a column header using the mouse. ColumnHeaderDragStarted Occurs when the user begins dragging a column header using the mouse. ColumnReordered Occurs when a DataGrid column has moved to a new position in the display order.
ColumnReordering Occurs before a DataGrid column moves to a new position in the display order. CopyingRowClipboardContent Occurs when the row is prepared for a clipboard copy operation. CurrentCellChanged Occurs when a different cell becomes the current cell. DataContextChanged Occurs when the data context for this element changes. DragEnter Occurs when the input system reports an underlying drag event with this element as the target. DragLeave Occurs when the input system reports an underlying drag event with this element as the origin.
DragOver Occurs when the input system reports an underlying drag event with this element as the potential drop target. Drop Occurs when the input system reports an underlying drop event with this element as the drop target. LayoutUpdated Occurs when the layout of the Silverlight visual tree changes. Loaded Occurs when a FrameworkElement has been constructed and added to the object tree.
LoadingRow Occurs after a DataGridRow is instantiated, so that you can customize it before it is used. LoadingRowDetails Occurs when a new row details template is applied to a row, so that you can customize the details section before it is used.
LoadingRowGroup Occurs when a row group header is loading, so that you can customize the header before it is used. MediaCommand Occurs when a button is pressed on a remote control. MouseLeftButtonDown Occurs when the left mouse button is pressed or when the tip of the stylus touches the tablet while the mouse pointer is over a UIElement. MouseLeftButtonUp Occurs when the left mouse button is released or the tip of the stylus is removed from the tablet while the mouse or the stylus is over a UIElement or while a UIElement holds mouse capture.
However, this event will only be raised if a caller marks the preceding MouseRightButtonDown event as handled; see Remarks. In that case we will use a template column and a value convertor to accomplish the task. Well there can be other ways also to achieve the same.
So with this view in mind, let us create a class say "DateConvertor" that will implement the IValueConvertor interface as under. While the data size grows it becomes necessary to split data across pages- a concept that is call as Paging. The PagedCollectionView class splits data into multiple pages as per the static row number provided per page. In silverlight,the DataPager control gives a user friendly interface that is highly customizable for paging through a data collection that can be any IEnumerable collection e.
PagedCollectionView here. It can also be bind to the ItemsSource of the DataGrid. The convertor class is as under. This article shows some of the operations that a developer may need in their day to day operation while working with Silverlight DataGrid controls. Hope you like this and will be useful. Comments or Responses. If you run the application, you will see an empty grid with no columns and rows as demonstrated in Figure 1.
In order to populate the RadGridView control with data, you should create a collection of business objects. For the purposes of this example, create a new class named Club and add several properties to it, as shown in Example 3. If you want to support two-way binding, your Club class should implement the INotifyPropertyChanged interface and raise the PropertyChanged event every time a property value changes. It resides in the Telerik. Controls namespace. Now that you have prepared the needed sample data, it is time to bind RadGridView to it.
The local namespace in the example corresponds to the namespace where MyViewModel resides. Alternatively, you can set the ItemsSource property in code-behind, as demonstrated in Example 6. Running the application containing the code from Examples 1 - 6 will result in a populated RadGridView , like in Figure 2. You can read more about configuring the data bindings here.
The RadGridView from the examples above contains three columns, one for each of the properties of the Club class. RadGridView automatically generates these columns. If you want to stop the columns auto generation and define the columns that you want to be visible manually, set the property AutoGenerateColumns to False. Example 7 demonstrates how you can manually prevent the automatic generation and define columns. The code in Example 7 is shown in Figure 3. The second named "Established" is bound, respectively, to Established.
0コメント