当前位置: 首页>>代码示例>>C#>>正文


C# RadGridView类代码示例

本文整理汇总了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;
        }
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:7,代码来源:ValidationBehavior.cs

示例2: CreateSpreadsheet

 private static RadSpreadsheet CreateSpreadsheet(RadGridView grid)
 {
     return new RadSpreadsheet()
     {
         Workbook = CreateWorkBook(grid)
     };
 }
开发者ID:CJMarsland,项目名称:xaml-sdk,代码行数:7,代码来源:PrintAndExportExtensions.cs

示例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();
            }
        }
开发者ID:Ashna,项目名称:Shayan-Dental,代码行数:35,代码来源:FormDefinePatient.cs

示例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;
            };

        }
开发者ID:llenroc,项目名称:Inflexion2,代码行数:31,代码来源:GridViewRowDoubleClickHandler.cs

示例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);
            }
        }
开发者ID:PrakashDevkota9898,项目名称:HSSNInventory,代码行数:28,代码来源:ClsCommon.cs

示例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;
        }
开发者ID:unicloud,项目名称:AFRP,代码行数:32,代码来源:ImageAndGirdOperation.cs

示例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();
        }
开发者ID:cwschroeder,项目名称:MeterTestComService,代码行数:30,代码来源:ViewUtil.cs

示例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;
        }
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:8,代码来源:ContextMenuBehavior.cs

示例9: BindingRowDetailsWidthBehavior

		public BindingRowDetailsWidthBehavior(RadGridView grid)
		{
			this.gridView = grid;
			if(this.gridView != null)
			{
				this.gridView.LoadingRowDetails+=new EventHandler<Telerik.Windows.Controls.GridView.GridViewRowDetailsEventArgs>(OnLoadingRowDetails);			
			}		
		}
开发者ID:JoelWeber,项目名称:xaml-sdk,代码行数:8,代码来源:BindingRowDetailsWidthBehavior.cs

示例10: CustomFilterBehavior

        public CustomFilterBehavior(RadGridView gridView, TextBox tb)
        {
            this.gridView = gridView;
            this.tb = tb;

            this.tb.TextChanged -= FilterValue_TextChanged;            
            this.tb.TextChanged += FilterValue_TextChanged;
        }
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:8,代码来源:CustomFilterBehavior.cs

示例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);
        }
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:8,代码来源:ConfigurationPanelBehavior.cs

示例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;
        }
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:8,代码来源:SelectedCellsBindingBehavior.cs

示例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;
        }
开发者ID:netintellect,项目名称:OutlookInspired,代码行数:9,代码来源:CustomFilterBehavior.cs

示例14: GetAttachedBehavior

		private static RowReorderBehavior GetAttachedBehavior(RadGridView gridview)
		{
			if (!instances.ContainsKey(gridview))
			{
				instances[gridview] = new RowReorderBehavior();
				instances[gridview].AssociatedObject = gridview;
			}

			return instances[gridview];
		}
开发者ID:netintellect,项目名称:PluralsightSpaJumpStartFinal,代码行数:10,代码来源:RowReorderBehavior.cs

示例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")));
 }
开发者ID:sgh1986915,项目名称:Sliverlight-Prism,代码行数:10,代码来源:IncidenciasOverviewUserControl.g.i.cs


注:本文中的RadGridView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。