本文整理汇总了C#中GridControl类的典型用法代码示例。如果您正苦于以下问题:C# GridControl类的具体用法?C# GridControl怎么用?C# GridControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridControl类属于命名空间,在下文中一共展示了GridControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeOutlookGrid
public GridControl InitializeOutlookGrid(
GridControl gridOutlookList)
{
try
{
gridOutlookList.RowCount = 0;
gridOutlookList.ColCount = 4;
gridOutlookList.ColWidths[0] = 10;
gridOutlookList.ColWidths[1] = 200;
gridOutlookList.ColWidths[2] = 150;
gridOutlookList.ColWidths[3] = 150;
gridOutlookList.ColWidths[4] = 0;
gridOutlookList[0, 1].Text = "Name";
gridOutlookList[0, 2].Text = "Business Fax";
gridOutlookList[0, 3].Text = "Home Fax";
gridOutlookList[0, 1].BackColor = Color.LightGray;
gridOutlookList[0, 2].BackColor = Color.LightGray;
gridOutlookList[0, 3].BackColor = Color.LightGray;
return gridOutlookList;
}
catch (Exception er)
{
Common.Log(er.Message);
return gridOutlookList;
}
}
示例2: InitializeSendToGrid
public GridControl InitializeSendToGrid(GridControl gridSendFax,
string _faxFolder)
{
try
{
gridSendFax.RowCount = 0;
gridSendFax.ColCount = 3;
gridSendFax.ColWidths[0] = 10;
gridSendFax.ColWidths[1] = 75;
gridSendFax.ColWidths[2] = 150;
gridSendFax.ColWidths[3] = 150;
gridSendFax[0, 1].Text = "Del";
gridSendFax[0, 2].Text = "Recipient name";
gridSendFax[0, 3].Text = "Fax number";
gridSendFax[0, 1].BackColor = Color.LightGray;
gridSendFax[0, 2].BackColor = Color.LightGray;
gridSendFax[0, 3].BackColor = Color.LightGray;
GridModel model = gridSendFax.Model;
return gridSendFax;
}
catch (Exception er)
{
Common.Log(er.Message);
return gridSendFax;
}
}
示例3: Create
public GridColumn[] Create(GridControl gridControl, GridView gridView)
{
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "ID", -1, -1), "ID");
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Số ĐKCB HD", 0, 150), "NAME");
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Mô tả", 1, 500), "NOI_DUNG");
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Mục đích", 2, 500), "MUC_DICH");
HelpGrid.CotSpinEditInt(
XtraGridSupportExt.CreateGridColumn(gridView, "Dung lượng (MB)", 3, 150), "DUNG_LUONG", true);
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Tình trạng", 4, 150), "TINH_TRANG");
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Chịu trách nhiệm", 5, 300), "NGUOI_CHIU_TRACH_NHIEM");
HelpGridColumn.CotMemoExEdit(
XtraGridSupportExt.CreateGridColumn(gridView, "Ghi chú", 6, 150), "GHI_CHU");
HelpGridColumn.CotCheckEdit(
XtraGridSupportExt.CreateGridColumn(gridView, GlobalConst.VISIBLE_TITLE, 7, 60), "VISIBLE_BIT");
((PLGridView)gridView).DefaultNewRow = delegate(DataRow row)
{
row["VISIBLE_BIT"] = "Y";
};
return null;
}
示例4: SystemParametersController
public SystemParametersController(AdministrationForm form, GridControl gridControl)
{
view = form;
_gridControl = gridControl;
_instance = this;
//identity = Thread.CurrentPrincipal as UserIdentity;//TODO
}
示例5: frmGroup
public frmGroup(GridControl dv, string flag)
{
this.InitializeComponent();
clsMe clsMe = new clsMe();
clsMe.setFormStyl(this);
this.dvgroup = (DataView)dv.DataSource;
this.BindCombox();
this.comboBox1.SelectedIndex = 0;
this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.dataGridView1.ReadOnly = true;
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AllowUserToResizeRows = false;
this.dataGridView1.MultiSelect = false;
this.dataGridView1.RowHeadersWidth = 55;
this.dataGridView1.BackgroundColor = this.BackColor;
this.dataGridView1.EnableHeadersVisualStyles = false;
this.dataGridView1.AllowUserToResizeColumns = false;
this.dataGridView2.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
this.dataGridView2.ReadOnly = true;
this.dataGridView2.AllowUserToAddRows = false;
this.dataGridView2.AllowUserToDeleteRows = false;
this.dataGridView2.AllowUserToResizeRows = false;
this.dataGridView2.MultiSelect = false;
this.dataGridView2.RowHeadersWidth = 55;
this.dataGridView2.BackgroundColor = this.BackColor;
this.dataGridView2.EnableHeadersVisualStyles = false;
}
示例6: GridViewPrinter
public GridViewPrinter(GridControl aGrid, PrintDocument aPrintDocument, GridView aTable)
{
TheDataGrid = aGrid;
ThePrintDocument = aPrintDocument;
TheTable = aTable;
if (aPrintDocument.DefaultPageSettings.Landscape)
{
PageWidth = ThePrintDocument.DefaultPageSettings.PaperSize.Height;
PageHeight = ThePrintDocument.DefaultPageSettings.PaperSize.Width;
TopMargin = ThePrintDocument.DefaultPageSettings.Margins.Right;
BottomMargin = ThePrintDocument.DefaultPageSettings.Margins.Left;
LeftMargin = ThePrintDocument.DefaultPageSettings.Margins.Top;
RightMargin = ThePrintDocument.DefaultPageSettings.Margins.Bottom;
}
else
{
PageWidth = ThePrintDocument.DefaultPageSettings.PaperSize.Width;
PageHeight = ThePrintDocument.DefaultPageSettings.PaperSize.Height;
TopMargin = ThePrintDocument.DefaultPageSettings.Margins.Top;
BottomMargin = ThePrintDocument.DefaultPageSettings.Margins.Bottom;
}
}
示例7: OpenGridViewGroups
public void OpenGridViewGroups(GridControl ctrl, int groupleveltoexpand)
{
// open grouplevel 0 (if available)
ctrl.BeginUpdate();
try
{
GridView view = (GridView)ctrl.DefaultView;
//view.ExpandAllGroups();
view.MoveFirst();
while (!view.IsLastRow)
{
int rowhandle = view.FocusedRowHandle;
if (view.IsGroupRow(rowhandle))
{
int grouplevel = view.GetRowLevel(rowhandle);
if (grouplevel <= groupleveltoexpand)
{
view.ExpandGroupRow(rowhandle);
}
}
view.MoveNext();
}
view.MoveFirst();
}
catch (Exception E)
{
Console.WriteLine(E.Message);
}
ctrl.EndUpdate();
}
示例8: ConvertControlValue
/// <summary>
/// Converts the specified <code>token</code> into an instance of <see cref="IGridControlValue"/>.
/// </summary>
/// <param name="control">A reference to the parent <see cref="GridControl"/>.</param>
/// <param name="token">The instance of <see cref="JToken"/> representing the control value.</param>
/// <param name="value">The converted control value.</param>
public bool ConvertControlValue(GridControl control, JToken token, out IGridControlValue value) {
value = null;
if (IsLinkPickerEditor(control.Editor)) {
value = GridControlLinkPickerValue.Parse(control, token as JObject);
}
return value != null;
}
示例9: GetControlWrapper
/// <summary>
/// Gets an instance <see cref="GridControlWrapper"/> for the specified <code>control</code>.
/// </summary>
/// <param name="control">The control to be wrapped.</param>
/// <param name="wrapper">The wrapper.</param>
public bool GetControlWrapper(GridControl control, out GridControlWrapper wrapper) {
wrapper = null;
if (IsLinkPickerEditor(control.Editor)) {
wrapper = control.GetControlWrapper<GridControlLinkPickerValue, GridEditorLinkPickerConfig>();
}
return wrapper != null;
}
示例10: GetControlWrapper
/// <summary>
/// Gets an instance <code>GridControlWrapper</code> for the specified <code>control</code>.
/// </summary>
/// <param name="control">The control to be wrapped.</param>
/// <param name="wrapper">The wrapper.</param>
public virtual bool GetControlWrapper(GridControl control, out GridControlWrapper wrapper) {
wrapper = null;
switch (control.Editor.Alias) {
case "media":
wrapper = control.GetControlWrapper<GridControlMediaValue, GridEditorMediaConfig>();
break;
case "embed":
wrapper = control.GetControlWrapper<GridControlEmbedValue>();
break;
case "rte":
wrapper = control.GetControlWrapper<GridControlRichTextValue>();
break;
case "macro":
wrapper = control.GetControlWrapper<GridControlMacroValue>();
break;
case "quote":
case "headline":
wrapper = control.GetControlWrapper<GridControlTextValue, GridEditorTextConfig>();
break;
}
return wrapper != null;
}
示例11: GetMemoTextBox
/// <summary>
///
/// </summary>
/// <param name="gridControl"></param>
/// <returns></returns>
public static WinTextBox GetMemoTextBox(GridControl gridControl)
{
if (m_memoTextBox == null || m_memoTextBox.IsDisposed)
{
WinTextBox memoTextBox = new WinTextBox(EnhancedBorderStyle.None);
//WinButton moreButton = new WinButton(new Xceed.Editors.ButtonType(Xceed.Editors.ButtonBackgroundImageType.Combo, Xceed.Editors.ButtonImageType.ScrollDown));
//memoTextBox.SideButtons.Add(moreButton);
//memoTextBox.DropDownButton = moreButton;
memoTextBox.TextBoxArea.WordWrap = false;
memoTextBox.TextBoxArea.Multiline = false;
memoTextBox.TextBoxArea.AcceptsReturn = false;
memoTextBox.TextBoxArea.ReadOnly = false;
WinTextBox multilineTextBox = new WinTextBox();
multilineTextBox.TextBoxArea.WordWrap = true;
multilineTextBox.TextBoxArea.Multiline = true;
multilineTextBox.TextBoxArea.ReadOnly = true;
memoTextBox.DropDownAnchor = DropDownAnchor.Left;
memoTextBox.DropDownDirection = DropDownDirection.Automatic;
memoTextBox.DropDownAllowFocus = true;
memoTextBox.DropDownControl = multilineTextBox;
memoTextBox.DropDownSize = new System.Drawing.Size(300, 150);
memoTextBox.DroppedDownChanged += new EventHandler(memoTextBox_DroppedDownChanged);
m_memoTextBox = memoTextBox;
}
SetMemoTextBoxParent(m_memoTextBox, gridControl);
return m_memoTextBox;
}
示例12: ToPLGridViewUpdate
//Chú ý tên table trong DataTable phải giống như tên table mà mình cần thao tác thêm xóa
public static PLGridViewUpdate ToPLGridViewUpdate(GridControl grid, PLGridView gridView,
DataTable DataSource, string IDField, string[] NameFields, string[] Subjects,
InitGridColumns InitGridCol, GetRule Rule,
DelegationLib.DefinePermission permission,
PLDelegation.ProcessDataRow InsertFunc, PLDelegation.ProcessDataRow DeleteFunc,
PLDelegation.ProcessDataRow UpdateFunc, int RowPerPage)
{
PLGridViewUpdate update = new PLGridViewUpdate();
for (int i = 0; i < gridView.Columns.Count; i++)
{
update.gridView.Columns.Add(gridView.Columns[i]);
}
update._init(DataSource, IDField, NameFields, Subjects, InitGridCol, Rule,
permission, InsertFunc, DeleteFunc, UpdateFunc);
PLGridViewUpdateHelp page = new PLGridViewUpdateHelp(update.gridControl, RowPerPage, update);
page.AddFunction = update.AddAction;
page.DeleteFunction = update.DeleteAction;
page.EditFunction = update.EditAction;
page.NoSaveFunction = update.NoSaveAction;
page.PrintFunction = update.PrintAction;
page.SaveFunction = update.SaveAction;
update.Dock = grid.Dock;
update.Location = grid.Location;
return update;
}
示例13: GetControlWrapper
/// <summary>
/// Gets an instance <code>GridControlWrapper</code> for the specified <code>control</code>.
/// </summary>
/// <param name="control">The control to be wrapped.</param>
/// <param name="wrapper">The wrapper.</param>
public bool GetControlWrapper(GridControl control, out GridControlWrapper wrapper) {
wrapper = null;
switch (control.Editor.Alias) {
case "media_wide":
case "media_wide_cropped":
wrapper = control.GetControlWrapper<GridControlMediaValue, GridEditorMediaConfig>();
break;
case "banner_headline":
case "banner_tagline":
case "headline_centered":
case "abstract":
case "paragraph":
case "quote_D":
case "code":
wrapper = control.GetControlWrapper<GridControlTextValue, GridEditorTextConfig>();
break;
}
return wrapper != null;
}
示例14: CreateDM_DANH_BA
public GridColumn[] CreateDM_DANH_BA(GridControl gridControl, GridView gridView)
{
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "ID", -1, -1), "ID");
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "Tên tài liệu", 0, 150), "NAME");
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "Địa chỉ", 1, 150), "DIA_CHI");
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "Số điện thoại", 2, 150), "SO_DIEN_THOAI");
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "Di động", 3, 150), "DI_DONG");
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "Fax", 4, 150), "SO_FAX");
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "Người đại diện", 5, 150), "NGUOI_DAI_DIEN");
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "Chức vụ", 6, 150), "CHUC_VU");
HelpGridColumn.CotTextLeft(
HelpGridColumn.ThemCot(gridView, "Số tài khoản", 7, 150), "TAI_KHOAN");
XtraGridSupportExt.ComboboxGridColumn(HelpGridColumn.ThemCot(gridView, "Ngân hàng", 1, 150), " DM_BANK", "ID", "NAME", "TEN_NGAN_HANG").NullText = string.Empty;
gridView.OptionsView.ColumnAutoWidth = false;
gridView.OptionsView.ShowAutoFilterRow = false;
gridView.OptionsView.ShowGroupedColumns = false;
gridView.OptionsView.ShowFilterPanelMode = DevExpress.XtraGrid.Views.Base.ShowFilterPanelMode.Never;
((PLGridView)gridView).DefaultNewRow = ProtocolVN.Framework.Win.HelpGrid.CheckVisibleDefault;
((PLGridView)gridView)._SetUserLayout();
return null;
}
示例15: CreateDM_NHAN_VIEN
public GridColumn[] CreateDM_NHAN_VIEN(GridControl gridControl, GridView gridView)
{
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "ID", -1, -1), "ID");
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Mã nhân viên", 0, 150), "MA_NV");
GridColumn Ten = XtraGridSupportExt.CreateGridColumn(gridView, "Tên nhân viên", 1, 150);
XtraGridSupportExt.TextLeftColumn(
Ten, "NAME");
GridColumn ColPhongBan = XtraGridSupportExt.CreateGridColumn(gridView, "Tên phòng ban", 2, 150);
ColPhongBan.FieldName = "DEPARTMENT_ID";
//XtraGridSupportExt.IDGridColumn(ColPhongBan, "ID", "NAME", "DEPARTMENT", "DEPARTMENT_ID");
HelpGridColumn.CotCombobox(ColPhongBan, HelpDB.getDatabase().LoadDataSet(@"SELECT *
FROM DEPARTMENT WHERE PARENT_ID IS NOT NULL"), "ID", "NAME", "DEPARTMENT_ID");
ColPhongBan.OptionsColumn.AllowEdit = true;
ColPhongBan.OptionsColumn.AllowFocus = false;
ColPhongBan.OptionsColumn.ReadOnly = true;
Ten.SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "CMND", 3, 150), "CMND");
XtraGridSupportExt.DateTimeGridColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Ngày sinh", 4, 150), "NGAY_SINH");
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Điện thoại", 5, 150), "DIEN_THOAI");
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Địa chỉ", 6, 150), "DIA_CHI");
XtraGridSupportExt.TextLeftColumn(
XtraGridSupportExt.CreateGridColumn(gridView, "Email", 7, 150), "EMAIL");
HelpGridColumn.CotCheckEdit(
XtraGridSupportExt.CreateGridColumn(gridView, "Hiển thị", 8, 100), "VISIBLE_BIT");
gridView.OptionsView.ShowGroupedColumns = false;
gridView.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Always;
gridView.OptionsView.ColumnAutoWidth = true;
return null;
}