本文整理汇总了C#中RadGridView类的典型用法代码示例。如果您正苦于以下问题:C# RadGridView类的具体用法?C# RadGridView怎么用?C# RadGridView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RadGridView类属于命名空间,在下文中一共展示了RadGridView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidationBehavior
public ValidationBehavior(RadGridView gridView, bool isEnabled)
{
this.gridView = gridView;
this.isValidationEnabled = isEnabled;
this.gridView.CellValidating += this.GridView_CellValidating;
}
示例2: CreateSpreadsheet
private static RadSpreadsheet CreateSpreadsheet(RadGridView grid)
{
return new RadSpreadsheet()
{
Workbook = CreateWorkBook(grid)
};
}
示例3: CheckSessionAccessList
public static void CheckSessionAccessList(AccessSubType accessSubType, RadButton btnPrint, RadButton btnAdd, RadButton btnNew, RadButton btnSave, RadButton btnCancel, RadGridView grid)
{
if (Session.CurrentUser.Role.IsAdmin)
return;
AccessControl ac = Session.CurrentUser.Role.AccessControlList[accessSubType];
if (!ac.AccessPrint)
{
if (btnPrint != null)
btnPrint.Hide();
}
if (!ac.AccessRemove)
{
if (grid != null)
grid.Columns.RemoveAt(grid.Columns.Count() - 1);
}
if (!ac.AccessInsert)
{
if (btnAdd != null)
btnAdd.Hide();
if (btnNew != null)
btnNew.Hide();
}
if (!ac.AccessChange)
{
if (btnSave != null)
btnSave.Hide();
if (btnCancel != null)
btnCancel.Hide();
}
}
示例4: GridViewRowDoubleClickHandler
public GridViewRowDoubleClickHandler(RadGridView gridView)
{
MouseButtonEventHandler handler = (sender, args) =>
{
var row = sender as GridViewRow;
if (row != null && row.IsSelected)
{
var methodName = GetMethodName(gridView);
var dataContextType = gridView.DataContext.GetType();
var method = dataContextType.GetMethod(methodName);
if (method == null)
{
throw new MissingMethodException(methodName);
}
method.Invoke(gridView.DataContext, null);
}
};
gridView.RowLoaded += (s, e) =>
{
e.Row.MouseDoubleClick += handler;
};
gridView.RowUnloaded += (s, e) =>
{
e.Row.MouseDoubleClick -= handler;
};
}
示例5: PrintPreview
public static void PrintPreview(RadGridView grdData)
{
if (grdData.Rows.Count <= 0)
{
MessageBox.Show(@"No Datas To Be Printed.", @"Print", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return;
}
try
{
var rpd = new RadPrintDocument
{
Margins = new Margins(10, 10, 10, 10),
DefaultPageSettings = { PaperSize = new PaperSize("A4", 850, 1100) },
AssociatedObject = grdData
};
var dialog = new RadPrintPreviewDialog
{
ThemeName = grdData.ThemeName,
Document = rpd,
StartPosition = FormStartPosition.CenterScreen
};
dialog.ShowDialog();
}
catch (Exception e)
{
MessageBox.Show(@"Error While Printing Document." + Environment.NewLine + e.Message, @"Print", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
示例6: CreatDataGridView
/// <summary>
/// 创建RadGridView
/// </summary>
/// <param name="structs">RadGridView列</param>
/// <param name="itemsSource">数据源</param>
/// <param name="headerName"></param>
/// <returns></returns>
public static RadGridView CreatDataGridView(Dictionary<string, string> structs, IEnumerable<object> itemsSource, string headerName)
{
var rgView = new RadGridView
{
ShowGroupPanel = false,
AutoGenerateColumns = false,
IsReadOnly = true,
Name = headerName,
RowIndicatorVisibility = Visibility.Collapsed
};
foreach (var gvColumn in structs.Keys.Select(item => new GridViewDataColumn
{
Header = structs[item],
IsFilterable = false,
IsSortable = false,
DataMemberBinding = new System.Windows.Data.Binding(item)
}))
{
rgView.Columns.Add(gvColumn);
}
rgView.ItemsSource = itemsSource;
return rgView;
}
示例7: ConvertSelectedDataToString
/// <summary>
/// Converts the selected data to string for clipboard copy paste.
/// </summary>
/// <param name="grid">The gridview.</param>
/// <returns>The formatted textual representation of the selected gridview cells.</returns>
public static string ConvertSelectedDataToString(RadGridView grid)
{
var sb = new StringBuilder();
foreach (var h in grid.Columns)
{
sb.Append(h.Name + "\t");
}
sb.Append("\n");
foreach (GridViewRowInfo t in grid.SelectedRows)
{
for (int cell = 0; cell < t.Cells.Count; cell++)
{
sb.Append(t.Cells[cell].Value != null ? t.Cells[cell].Value.ToString() : " --- ");
sb.Append("\t");
}
sb.Append("\n");
}
return sb.ToString();
}
示例8: ContextMenuBehavior
public ContextMenuBehavior(RadGridView grid, FrameworkElement contextMenu)
{
this.gridView = grid;
this.contextMenu = contextMenu;
(contextMenu as RadContextMenu).Opened += RadContextMenu_Opened;
(contextMenu as RadContextMenu).ItemClick += RadContextMenu_ItemClick;
}
示例9: BindingRowDetailsWidthBehavior
public BindingRowDetailsWidthBehavior(RadGridView grid)
{
this.gridView = grid;
if(this.gridView != null)
{
this.gridView.LoadingRowDetails+=new EventHandler<Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs>(OnLoadingRowDetails);
}
}
示例10: CustomFilterBehavior
public CustomFilterBehavior(RadGridView gridView, TextBox tb)
{
this.gridView = gridView;
this.tb = tb;
this.tb.TextChanged -= FilterValue_TextChanged;
this.tb.TextChanged += FilterValue_TextChanged;
}
示例11: ConfigurationPanelBehavior
public ConfigurationPanelBehavior(RadGridView grid, FrameworkElement panel)
{
this.grid = grid;
this.panel = panel;
this.ActivatedRows = new ObservableCollection<MyBusinessObject>();
this.panel.LayoutUpdated += new EventHandler(panel_LayoutUpdated);
}
示例12: SelectedCellsBindingBehavior
public SelectedCellsBindingBehavior(RadGridView gridView, System.Windows.Controls.ListBox listBox)
{
this.gridView = gridView;
this.listBox = listBox;
this.listBox.ItemsSource = this.selectedCells;
this.gridView.SelectedCellsChanged += gridView_SelectedCellsChanged;
}
示例13: CustomFilterBehavior
public CustomFilterBehavior(RadGridView gridView, RadWatermarkTextBox textBlock, RadBusyIndicator busyIndicator)
{
this.gridView = gridView;
this.textBlock = textBlock;
this.busyIndicator = busyIndicator;
this.textBlock.TextChanged -= this.OnTextBlockTextChanged;
this.textBlock.TextChanged += this.OnTextBlockTextChanged;
}
示例14: GetAttachedBehavior
private static RowReorderBehavior GetAttachedBehavior(RadGridView gridview)
{
if (!instances.ContainsKey(gridview))
{
instances[gridview] = new RowReorderBehavior();
instances[gridview].AssociatedObject = gridview;
}
return instances[gridview];
}
示例15: InitializeComponent
public void InitializeComponent() {
if (_contentLoaded) {
return;
}
_contentLoaded = true;
System.Windows.Application.LoadComponent(this, new System.Uri("/Procbel.Apps.Silverlight.Modules.Incidencias;component/Views/IncidenciasOverview" +
"UserControl.xaml", System.UriKind.Relative));
this.LayoutRoot = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
this.attachmentGrid = ((RadGridView)(this.FindName("attachmentGrid")));
}