社区
C#
帖子详情
DataGrid的标题问题!
junes8250
2004-03-16 09:00:56
DataGrid的Dock=Fill,ShowHeader=true,可是就是显示不出来标题,
请指教!
...全文
105
8
打赏
收藏
DataGrid的标题问题!
DataGrid的Dock=Fill,ShowHeader=true,可是就是显示不出来标题, 请指教!
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
8 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
junes8250
2004-03-16
打赏
举报
回复
更正应该是setdatabinding(),可是还是不行!
junes8250
2004-03-16
打赏
举报
回复
这个窗体是子窗体,我是在内存中创建了dataset,datatable,而且调用了setdatabing().
athossmth
2004-03-16
打赏
举报
回复
贴代码
qiume
2004-03-16
打赏
举报
回复
不会吧,只要指定了DataSource,不用做任何设置也会出来的
istring
2004-03-16
打赏
举报
回复
建议你重新依次放入控件ToolBar,DataGrid,再设置属性.
晕,.NET好像有个BUG,次序不一样效果就不同(标题显示不出).
试试吧!
junes8250
2004-03-16
打赏
举报
回复
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace WindowsApplication
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.ToolBar toolBar1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.toolBar1 = new System.Windows.Forms.ToolBar();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// dataGrid1
//
this.dataGrid1.CaptionText = "rgsrh";
this.dataGrid1.DataMember = "";
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(292, 266);
this.dataGrid1.TabIndex = 0;
//
// toolBar1
//
this.toolBar1.AccessibleRole = System.Windows.Forms.AccessibleRole.ColumnHeader;
this.toolBar1.DropDownArrows = true;
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(292, 25);
this.toolBar1.TabIndex = 1;
this.toolBar1.TextAlign = System.Windows.Forms.ToolBarTextAlign.Right;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.toolBar1,
this.dataGrid1});
this.Name = "Form1";
this.Text = "Form1";
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}
athossmth
2004-03-16
打赏
举报
回复
贴代码
junes8250
2004-03-16
打赏
举报
回复
是不是ToolBar的缘故?如果没有ToolBar就能显示标题!
DataGrid
自定义列
标题
DataGrid
自定义列
标题
DataGrid
自定义列
标题
DataGrid
自定义列
标题
DataGrid
自定义列
标题
DataGrid
自定义列
标题
从
Datagrid
的
标题
居中说起
从
Datagrid
的
标题
居中说起
easyui
datagrid
标题
列宽度自适应
NULL 博文链接:https://wusuobuai.iteye.com/blog/1860496
flex
datagrid
标题
栏添加 checkbox 和 数据行 checkbox 连动
绝对好东西,
datagrid
标题
栏及
datagrid
column 添加 checkbox
easyui
datagrid
表格 打印
easyui
datagrid
表格打印,支持formatter格式化数据的打印,还原的最初
datagrid
的表格数据
C#
111,093
社区成员
642,554
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章