社区
C#
帖子详情
DataGrid的标题问题!
junes8250
2004-03-16 09:00:56
DataGrid的Dock=Fill,ShowHeader=true,可是就是显示不出来标题,
请指教!
...全文
109
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
中实现自定义列
标题
。 一、自定义列
标题
文本 1.1 使用AutoGenerateColumns属性 ...
从
Datagrid
的
标题
居中说起
本文主要探讨了在.NET框架中如何实现
Datagrid
标题
栏文字居中的
问题
。针对这一需求,文章提供了两种实现方式:一是通过在
标题
文本前后添加空格来达到居中的效果;二是利用Label控件动态调整位置以实现居中。 #### 第...
easyui
datagrid
标题
列宽度自适应
总的来说,解决“easyui
datagrid
标题
列宽度自适应”的
问题
,需要理解EasyUI的工作原理,掌握CSS和JavaScript的相关知识,并具备一定的编程实践能力。正确配置和应用这些技术,能帮助开发者创建出更符合用户体验的...
flex
datagrid
标题
栏添加 checkbox 和 数据行 checkbox 连动
总的来说,实现Flex
DataGrid
标题
栏添加复选框并使其与数据行的复选框联动,涉及到自定义HeaderRenderer和CellRenderer,以及对数据源和事件处理的深入理解。这需要开发者具备良好的Flex编程基础和组件定制能力。...
在jquery easyui中的
datagrid
中添加searchbox!
在
标题
和描述中提到的“在jQuery EasyUI中的
datagrid
中添加searchbox”,我们将详细讲解如何实现这一功能。 首先,你需要确保已经在项目中引入了jQuery库和EasyUI的相关CSS及JS文件。通常,这些文件包括`jquery.js`...
C#
111,110
社区成员
642,556
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章