devexpress

wumingyue110 2011-03-05 10:52:43
有谁能提供一些 devexpress组件的用法,最好有视频,呵呵,谢谢了,
最好有cxgrid的详细介绍哦
...全文
10428 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
yj605528638 2013-01-06
  • 打赏
  • 举报
回复
ycproc 2012-11-05
  • 打赏
  • 举报
回复
你安装了devexpress以后本地会有 一个 程序是 Demo center。 这个里面的案例一应俱全。前后台都有
阿荷 2012-05-28
  • 打赏
  • 举报
回复
貌似需要 安装好后 再加载吧。
阿荷 2012-05-28
  • 打赏
  • 举报
回复
界个 应该属于第三方控件吧。
djcsdn 2011-04-07
  • 打赏
  • 举报
回复
我记得安装程序带了很多例子,默认安装没有打钩,供参考
huluhome 2011-03-28
  • 打赏
  • 举报
回复
我的代码有什么错误啊,问什么room表的显示就不能自定义标题呢

DataSet ds = new DataSet();

ds.Tables.Add(VirtualDataSourceBuilding());
ds.Tables.Add(VirtualDataSourceFloor());
ds.Tables.Add(VirtualDataSourceRoom());
//设置栋座表和楼层表之间的关系
DataColumn keyColumnBuilding = ds.Tables["BuildingInfo"].Columns["id"];
DataColumn foreignKeyColumnFloor = ds.Tables["floor"].Columns["buildingID"];
ds.Relations.Add("buildingFloor", keyColumnBuilding, foreignKeyColumnFloor,false);
//设置楼层表和房间表之间的关系
DataColumn keyColumnFoor = ds.Tables["floor"].Columns["id"];
DataColumn foreignKeyColumnRoom = ds.Tables["room"].Columns["floorID"];
ds.Relations.Add("floorRoom", keyColumnFoor, foreignKeyColumnRoom, false);

//给GridControl绑定数据源
gridControl1.DataSource = ds.Tables["buildingInfo"];
gridControl1.ForceInitialize();
//Assign a GridView to the relationship
DevExpress.XtraGrid.Views.Grid.GridView gvFloor = new DevExpress.XtraGrid.Views.Grid.GridView(gridControl1);
gridControl1.LevelTree.Nodes.Add("buildingFloor", gvFloor);

DevExpress.XtraGrid.Views.Grid.GridView gvRoom = new DevExpress.XtraGrid.Views.Grid.GridView(gridControl1);
DevExpress.XtraGrid.Columns.GridColumn columnRoomID = new DevExpress.XtraGrid.Columns.GridColumn();
columnRoomID.FieldName = "roomID";
columnRoomID.Name = "columnRoomID";
columnRoomID.Caption = "房间编号";
DevExpress.XtraGrid.Columns.GridColumn columnFloorID = new DevExpress.XtraGrid.Columns.GridColumn();
columnFloorID.FieldName = "floorID";
columnFloorID.Name = "columnFloorID";
columnFloorID.Caption = "楼层编号";
DevExpress.XtraGrid.Columns.GridColumn columnRoomName = new DevExpress.XtraGrid.Columns.GridColumn();
columnRoomName.FieldName = "roomName";
columnRoomName.Name = "columnRoomName";
columnRoomName.Caption = "房间名称";
gvRoom.Columns.Add(columnRoomID);
gvRoom.Columns.Add(columnFloorID);
gvRoom.Columns.Add(columnRoomName);

gridControl1.LevelTree.Nodes.Add("floorRoom", gvRoom);




gvBuilding.Columns["id"].VisibleIndex = 1;
gvBuilding.Columns["buildingName"].Caption = "栋座名称";
gvBuilding.Columns["ruleName"].Caption = "栋座规则";
gvBuilding.Columns["floorsCount"].Caption = "楼层数";
//Create columns for the pattern view
gvFloor.PopulateColumns(ds.Tables["floor"]);
gvFloor.Columns["floorName"].Caption = "楼层名称";
gvFloor.Columns["property"].Caption = "楼层属性";
gvFloor.Columns["buildingID"].VisibleIndex = 1;



//Set a predefined color scheme for the Card View
//Color schemes are stored in the Windows\System32 folder by default
//in the DevExpress.XtraGrid.Appearances.xml file
string filePath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.System) +
"\\DevExpress.XtraGrid.Appearances.xml";
XAppearances xAppearances = new XAppearances(filePath);
xAppearances.LoadScheme("Winter", gvFloor);
gvFloor.PaintStyleName = "MixedXP";

xAppearances.LoadScheme("Winter", gvBuilding);
gvBuilding.PaintStyleName = "MixedXP";

this.gvBuilding.OptionsView.ShowGroupPanel = false;
gvFloor.OptionsView.ShowGroupPanel = false;

//禁止删除列
gvBuilding.OptionsCustomization.AllowColumnMoving = false;
gvFloor.OptionsCustomization.AllowColumnMoving = false;
//禁止添加行
gvBuilding.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.False;
gvFloor.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.False;



//设置标题
gvBuilding.ViewCaption = "栋座信息";
gvFloor.ViewCaption = "楼层信息";
gvRoom.ViewCaption = "房号信息";
wumingyue110 2011-03-11
  • 打赏
  • 举报
回复
好东西,回去好好研究,谢谢这位大侠
wumingyue110 2011-03-11
  • 打赏
  • 举报
回复
好东西,回去好好研究,谢谢这位大侠
一叶障目 2011-03-11
  • 打赏
  • 举报
回复
设置行号
gridView1.IndicatorWidth = 30;

private void gridView1_CustomDrawRowIndicator_1(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;

if (e.Info.IsRowIndicator)
{
if (e.RowHandle >= 0)
{
e.Info.DisplayText = (e.RowHandle + 1).ToString();
}
else if (e.RowHandle < 0 && e.RowHandle > -1000)
{
e.Info.Appearance.BackColor = System.Drawing.Color.AntiqueWhite;
e.Info.DisplayText = "G" + e.RowHandle.ToString();
}
}
}

private void gridView1_CustomDrawRowIndicator(object sender, DevExpress.XtraGrid.Views.Grid.RowIndicatorCustomDrawEventArgs e)
{
if (e.Info.IsRowIndicator && e.RowHandle >= 0)
{
e.Info.DisplayText = e.RowHandle.ToString();
}

}

隐藏图中标记处的英文部分
代码实现方法
gridView1.OptionsView.ShowGroupPanel = false;
控件实现方法



设置某列不可编辑和只读
gridView1.Columns[0].OptionsColumn.AllowEdit = false;
gridView1.Columns[0].OptionsColumn.ReadOnly = false;
设置模板

以下为步骤
首先从In-Place Editor Repository中添加LookUpEdit.取名为re_User

他的Columns属性中添加2列.Caption依次为:编号,姓名FieldName依次为:User_code,User_Name然后将Re1的NullText设置成空.

AutoSearchColumnIndex属性设置为2.
ImmediatePopup属性设置为True.
SearchMode设置为OnlyInPopup.
然后将这个模板列附加到我们上面提到的列1(也就是将列1的ColumnEdit属性设成Re1)

最后我们还要在代码里面给Re1绑定数据源和显示项.

re_user.DataSource=new T8002().getT8002().Tables[0];
re_user.DisplayMember = "USER_NAME";
re_user.ValueMember = "USER_CODE";
*:对于Oracle数据库字段一定要用大写,切记!!
Dev中的属性Table
/// <summary>
/// 机场图管理表的状态
/// </summary>
/// <returns></returns>
public DataTable TypeTable()
{
DataTable dt = new DataTable();
dt.Columns.Add("S_TYPE");
dt.Columns.Add("S_TYPE_NAME");
DataRow row = dt.NewRow();
row["S_TYPE"] = "0";
row["S_TYPE_NAME"] = "正常";
dt.Rows.Add(row);
row = dt.NewRow();
row["S_TYPE"] = "1";
row["S_TYPE_NAME"] = "删除";
dt.Rows.Add(row);
return dt;
}
使新添加的行在 gridView1 的第一行
//使新添加的行在 gridView1 的第一行
gridView1.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Top;
gridView1.AddNewRow();
初始化新行的数据
private void gridView1_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
{
ColumnView View = sender as ColumnView;
View.SetRowCellValue(e.RowHandle, "SEQ_I7101", (int)DataSetProvider.GetSequenceSeed("seq_i7101"));
View.SetRowCellValue(e.RowHandle, "S_TYPE", "0");
}
子窗体字段刷新父窗体(注意加大加粗字体部分)

父窗体
private void btnAdd_Click(object sender, EventArgs e)
{
FrmBaseInfo_img_01 frm = new FrmBaseInfo_img_01();
if (frm.ShowDialog() == DialogResult.OK)
{
if (dt.Select("I7101='" + frm.ID + "'").Length > 0)
{
dt.Select("I7101='" + frm.ID + "'")[0]["AIRPORT_4CODE"] = frm.CODE;
dt.Select("I7101='" + frm.ID + "'")[0]["PIC_CODE"] = frm.PIC_CODE;
dt.Select("I7101='" + frm.ID + "'")[0]["PUBLISH_DATE"] = frm.Publish_date;
dt.Select("I7101='" + frm.ID + "'")[0]["EFFECT_DATE"] = frm.EFFECT_DATE;
dt.Select("I7101='" + frm.ID + "'")[0]["USER_CODE"] = frm.UserCODE;
dt.Select("I7101='" + frm.ID + "'")[0]["MAKE_DATE"] = frm.Mark_Date;
dt.Select("I7101='" + frm.ID + "'")[0]["S_TYPE"] = "0";
}
else
{
try
{
DataRow _dr = dt.NewRow();
_dr["I7101"] = frm.ID;
_dr["AIRPORT_4CODE"] = frm.CODE;
_dr["PIC_CODE"] = frm.PIC_CODE;
_dr["PUBLISH_DATE"] = frm.Publish_date;
_dr["EFFECT_DATE"] = frm.EFFECT_DATE;
_dr["USER_CODE"] = frm.UserCODE;
_dr["MAKE_DATE"] = frm.Mark_Date;
_dr["S_TYPE"] = "0";
dt.Rows.Add(_dr);
}
catch (Exception)
{
MessageBox.Show("请您正确填写日期的格式");
}
}
gvImg.Refresh();
}
}
子窗体


获取选中行指定列的值
注意: gcUSER_CODE 为需要获取的列,可根据实际需求改动

wumingyue110 2011-03-11
  • 打赏
  • 举报
回复
可以发到我的邮箱吗,451290601@qq.com 谢谢了
呵呵
22222bbb 2011-03-10
  • 打赏
  • 举报
回复
怎么给你呢?
DevExpress9.2完整版 包含如下控件集: ---------------- DevExpress.BonusSkins.v9.2.dll DevExpress.Charts.v9.2.Core.dll DevExpress.Data.v9.2.Compact.dll DevExpress.Data.v9.2.dll DevExpress.Data.v9.2.Linq.dll DevExpress.Data.v9.2.Linq.xml DevExpress.Data.v9.2.xml DevExpress.OfficeSkins.v9.2.dll DevExpress.SharePoint.MOSS.v9.2.dll DevExpress.SharePoint.WSS.v9.2.dll DevExpress.Tutorials.v9.2.dll DevExpress.Utils.v9.2.dll DevExpress.Utils.v9.2.xml DevExpress.Web.ASPxEditors.v9.2.dll DevExpress.Web.ASPxEditors.v9.2.xml DevExpress.Web.ASPxGauges.v9.2.dll DevExpress.Web.ASPxGauges.v9.2.xml DevExpress.Web.ASPxGridView.v9.2.dll DevExpress.Web.ASPxGridView.v9.2.Export.dll DevExpress.Web.ASPxGridView.v9.2.Export.xml DevExpress.Web.ASPxGridView.v9.2.xml DevExpress.Web.ASPxHtmlEditor.v9.2.dll DevExpress.Web.ASPxHtmlEditor.v9.2.xml DevExpress.Web.ASPxPivotGrid.v9.2.dll DevExpress.Web.ASPxPivotGrid.v9.2.Export.dll DevExpress.Web.ASPxPivotGrid.v9.2.Export.xml DevExpress.Web.ASPxPivotGrid.v9.2.xml DevExpress.Web.ASPxScheduler.v9.2.Design.dll DevExpress.Web.ASPxScheduler.v9.2.dll DevExpress.Web.ASPxScheduler.v9.2.xml DevExpress.Web.ASPxSpellChecker.v9.2.dll DevExpress.Web.ASPxSpellChecker.v9.2.xml DevExpress.Web.ASPxThemes.v9.2.dll DevExpress.Web.ASPxTreeList.v9.2.dll DevExpress.Web.ASPxTreeList.v9.2.Export.dll DevExpress.Web.ASPxTreeList.v9.2.Export.xml DevExpress.Web.ASPxTreeList.v9.2.xml DevExpress.Web.v9.2.dll DevExpress.Web.v9.2.xml DevExpress.Wpf.Bars.v9.2.Design.dll DevExpress.Wpf.Bars.v9.2.dll DevExpress.Wpf.Bars.v9.2.dll.Design.dll DevExpress.Wpf.Bars.v9.2.dll.VisualStudio.De DevExpress.Wpf.Bars.v9.2.Expression.Design.d DevExpress.Wpf.Bars.v9.2.VisualStudio.Design DevExpress.Wpf.Bars.v9.2.xml DevExpress.Wpf.Carousel.Customization.v9.2.d DevExpress.Wpf.Carousel.v9.2.Design.dll DevExpress.Wpf.Carousel.v9.2.dll DevExpress.Wpf.Carousel.v9.2.dll.Design.dll DevExpress.Wpf.Carousel.v9.2.dll.VisualStudi DevExpress.Wpf.Carousel.v9.2.Expression.Desi DevExpress.Wpf.Carousel.v9.2.VisualStudio.De DevExpress.Wpf.Carousel.v9.2.xml DevExpress.Wpf.Charts.v9.2.Design.dll DevExpress.Wpf.Charts.v9.2.dll DevExpress.Wpf.Charts.v9.2.dll.Design.dll DevExpress.Wpf.Charts.v9.2.dll.VisualStudio. DevExpress.Wpf.Charts.v9.2.Expression.Design DevExpress.Wpf.Charts.v9.2.VisualStudio.Desi DevExpress.Wpf.Charts.v9.2.xml DevExpress.Wpf.Core.v9.2.dll DevExpress.Wpf.Core.v9.2.xml DevExpress.Wpf.DemoBase.v9.2.dll DevExpress.Wpf.Docking.v9.2.Design.dll DevExpress.Wpf.Docking.v9.2.dll DevExpress.Wpf.Docking.v9.2.dll.Design.dll DevExpress.Wpf.Docking.v9.2.dll.VisualStudio DevExpress.Wpf.Docking.v9.2.Expression.Desig DevExpress.Wpf.Docking.v9.2.VisualStudio.Des DevExpress.Wpf.Docking.v9.2.xml DevExpress.Wpf.Editors.v9.2.Design.dll DevExpress.Wpf.Editors.v9.2.dll DevExpress.Wpf.Editors.v9.2.dll.Design.dll DevExpress.Wpf.Editors.v9.2.dll.VisualStudio DevExpress.Wpf.Editors.v9.2.Expression.Desig DevExpress.Wpf.Editors.v9.2.VisualStudio.Des DevExpress.Wpf.Editors.v9.2.xml DevExpress.Wpf.Grid.v9.2.Design.dll DevExpress.Wpf.Grid.v9.2.dll DevExpress.Wpf.Grid.v9.2.dll.Design.dll DevExpress.Wpf.Grid.v9.2.dll.VisualStudio.De DevExpress.Wpf.Grid.v9.2.Expression.Design.d DevExpress.Wpf.Grid.v9.2.VisualStudio.Design DevExpress.Wpf.Grid.v9.2.xml DevExpress.Wpf.Layout.v9.2.Core.dll DevExpress.Wpf.Layout.v9.2.Core.xml DevExpress.Wpf.NavBar.v9.2.Design.dll DevExpress.Wpf.NavBar.v9.2.dll DevExpress.Wpf.NavBar.v9.2.dll.Design.dll DevExpress.Wpf.NavBar.v9.2.dll.VisualStudio. DevExpress.Wpf.NavBar.v9.2.Expression.Design DevExpress.Wpf.NavBar.v9.2.VisualStudio.Desi DevExpress.Wpf.NavBar.v9.2.xml DevExpress.Wpf.Printing.v9.2.Design.dll DevExpress.Wpf.Printing.v9.2.dll DevExpress.Wpf.Printing.v9.2.dll.Design.dll DevExpress.Wpf.Printing.v9.2.dll.VisualStudi DevExpress.Wpf.Printing.v9.2.Expression.Desi DevExpress.Wpf.Printing.v9.2.VisualStudio.De DevExpress.Wpf.Printing.v9.2.xml DevExpress.Xpo.v9.2.Compact.dll DevExpress.Xpo.v9.2.Design.dll DevExpress.Xpo.v9.2.dll DevExpress.Xpo.v9.2.Linq.dll DevExpress.Xpo.v9.2.Linq.xml DevExpress.Xpo.v9.2.Providers.Compact.dll DevExpress.Xpo.v9.2.Providers.dll DevExpress.Xpo.v9.2.xml DevExpress.XtraBars.v9.2.Design.dll DevExpress.XtraBars.v9.2.dll DevExpress.XtraBars.v9.2.xml DevExpress.XtraCharts.v9.2.Design.dll DevExpress.XtraCharts.v9.2.dll DevExpress.XtraCharts.v9.2.UI.dll DevExpress.XtraCharts.v9.2.UI.xml DevExpress.XtraCharts.v9.2.Web.Design.dll DevExpress.XtraCharts.v9.2.Web.dll DevExpress.XtraCharts.v9.2.Web.xml DevExpress.XtraCharts.v9.2.xml DevExpress.XtraEditors.v9.2.Design.dll DevExpress.XtraEditors.v9.2.dll DevExpress.XtraEditors.v9.2.xml DevExpress.XtraGauges.v9.2.Core.dll DevExpress.XtraGauges.v9.2.Core.xml DevExpress.XtraGauges.v9.2.Design.Win.dll DevExpress.XtraGauges.v9.2.Presets.dll DevExpress.XtraGauges.v9.2.Win.dll DevExpress.XtraGauges.v9.2.Win.xml DevExpress.XtraGrid.v9.2.Design.dll DevExpress.XtraGrid.v9.2.dll DevExpress.XtraGrid.v9.2.xml DevExpress.XtraLayout.v9.2.Design.dll DevExpress.XtraLayout.v9.2.dll DevExpress.XtraLayout.v9.2.xml DevExpress.XtraNavBar.v9.2.Design.dll DevExpress.XtraNavBar.v9.2.dll DevExpress.XtraNavBar.v9.2.xml DevExpress.XtraPivotGrid.v9.2.Core.dll DevExpress.XtraPivotGrid.v9.2.Core.xml DevExpress.XtraPivotGrid.v9.2.Design.dll DevExpress.XtraPivotGrid.v9.2.dll DevExpress.XtraPivotGrid.v9.2.xml DevExpress.XtraPrinting.v9.2.Design.dll DevExpress.XtraPrinting.v9.2.dll DevExpress.XtraPrinting.v9.2.xml DevExpress.XtraReports.v9.2.Design.dll DevExpress.XtraReports.v9.2.dll DevExpress.XtraReports.v9.2.Import.dll DevExpress.XtraReports.v9.2.Web.dll DevExpress.XtraReports.v9.2.Web.xml DevExpress.XtraReports.v9.2.xml DevExpress.XtraRichEdit.v9.2.Design.dll DevExpress.XtraRichEdit.v9.2.dll DevExpress.XtraRichEdit.v9.2.Extensions.dll DevExpress.XtraRichEdit.v9.2.Extensions.xml DevExpress.XtraRichEdit.v9.2.Printing.dll DevExpress.XtraRichEdit.v9.2.xml DevExpress.XtraScheduler.v9.2.Core.dll DevExpress.XtraScheduler.v9.2.Core.xml DevExpress.XtraScheduler.v9.2.Design.dll DevExpress.XtraScheduler.v9.2.dll DevExpress.XtraScheduler.v9.2.Extensions.dll DevExpress.XtraScheduler.v9.2.Extensions.xml DevExpress.XtraScheduler.v9.2.iCalendarExcha DevExpress.XtraScheduler.v9.2.iCalendarExcha DevExpress.XtraScheduler.v9.2.OutlookExchang DevExpress.XtraScheduler.v9.2.Reporting.dll DevExpress.XtraScheduler.v9.2.Reporting.xml DevExpress.XtraScheduler.v9.2.VCalendarExcha DevExpress.XtraScheduler.v9.2.xml DevExpress.XtraSpellChecker.v9.2.Core.dll DevExpress.XtraSpellChecker.v9.2.Core.xml DevExpress.XtraSpellChecker.v9.2.Design.dll DevExpress.XtraSpellChecker.v9.2.dll DevExpress.XtraSpellChecker.v9.2.xml DevExpress.XtraTreeList.v9.2.Design.dll DevExpress.XtraTreeList.v9.2.dll DevExpress.XtraTreeList.v9.2.xml DevExpress.XtraVerticalGrid.v9.2.Design.dll DevExpress.XtraVerticalGrid.v9.2.dll DevExpress.XtraVerticalGrid.v9.2.xml DevExpress.XtraWizard.v9.2.dll DevExpress.XtraWizard.v9.2.xml

1,978

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 其他语言讨论
社区管理员
  • 其他语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧