问题DataGrid中自动生成的列宽 [英] Problem with width of auto-generated columns in DataGrid

查看:193
本文介绍了问题DataGrid中自动生成的列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许世界和平会更容易些,但我有生成列具有自动的宽度一个问题,当一个DataGrid没有行。列标题都挤了它们之间没有间隔。我试着加入以下CSS无济于事:

  td.gridHeader
{
  填充左:20像素;
  填充右:20px的;
}


解决方案

我beleive标题被渲染为<第i个不< TD取代。

  th.gridHeader
{
  填充左:20像素;
  填充右:20px的;
}

我也假设您已经应用< HeaderStyle的CssClass =gridHeader/>在DataGrid标记。我不认为人们使用DataGrid中anymnore?或者它实际上是一个GridView?

Maybe world peace would be easier, but I have a problem with the widths of auto generated columns when a DataGrid has no rows. The column headings all squeeze up with no spacing between them. I've tried adding the following CSS to no avail:

td.gridHeader
{
  padding-left:20px;
  padding-right: 20px;        
}

解决方案

I beleive headings are rendered as <th> not <td>.

th.gridHeader
{
  padding-left:20px;
  padding-right: 20px;        
}

I also assume you have applied <HeaderStyle CssClass="gridHeader" /> in the DataGrid markup. I didn't think people used DataGrids anymnore? or is it actually a GridView ?

这篇关于问题DataGrid中自动生成的列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆