在Telerik ASP.NET Ajax中:
GridDateTimeColumn c = new GridDateTimeColumn();
c.EnableRangeFiltering = true;
这会添加一个日期范围过滤器" From:"和" To:"日历控制输入。控件水平对齐:
From: _____ [CAL] To: ____ [CAL] [FILTER]
有没有办法可以垂直堆叠控件?像:
From: ______ [CAL]
TO: ______ [CAL] [FILTER]
目前,水平内联对齐会显着增加列宽,并影响用户使用网格的体验。
答案 0 :(得分:2)
一些hacky解决方案,但仍然是一个解决方案......
protected void rgMyGrid_ItemCreated(object sender, GridItemEventArgs e)
{
var fi = e.Item as GridFilteringItem;
if (fi == null) return;
var litTo = fi["DateCol"].Controls[3] as LiteralControl;
if (litTo != null) litTo.Text = "<br /><span style=\"padding-right:17px\">To:</span>";
}
您显然需要在网格定义中添加OnItemCreated事件处理程序。
DateCol
是GridDateTimeColumn
答案 1 :(得分:2)
事先不知道你的GridDateTimeColumns的UniqueName,下面的非常hacky代码应该可以解决这个问题:)
protected void rgMyGrid_ItemCreated(object sender, GridItemEventArgs e)
{
var fi = e.Item as GridFilteringItem;
if (fi == null) return;
foreach (var litTo in from Control c in fi.Controls where c.Controls.Count == 6 select (LiteralControl) c.Controls[3])
litTo.Text = "<br /><span style=\"padding-right:17px\">To:</span>";
}
这里的关键是知道有6个控件构成范围过滤控件集合。