动态加载时将 CssStyle 应用于 Infragistics WebDataGrid 列

发布于 2024-12-06 19:13:25 字数 361 浏览 8 评论 0原文

我正在尝试右对齐 WDG 中的一列。我已经完成了 Infragistics 教程,所以我知道我需要添加一个新的 CSS 样式...

tbody > tr > td.ColumnRight
{
    text-align: right;
}

然后在我的列上应用 CssStyle="ColumnRight"

但是,我的 WDG 位于动态加载的用户控件上。

当页面出现时,右对齐尚未生效。

直到您刷新页面(F5)后它才起作用 - 但这是不可取的,确实需要在首次加载时就位样式。

这显然是动态加载的问题,但是有什么想法如何解决它吗?

非常感谢任何帮助!

I'm trying to right-align a column in my WDG. I've been through the Infragistics tutorials, so I know that I need to added a new CSS style as such...

tbody > tr > td.ColumnRight
{
    text-align: right;
}

Then on my column apply CssStyle="ColumnRight"

However, my WDG is on a usercontrol which is dynamically loaded.

When the page comes up the right-align has not taken hold.

It does not work until you refresh the page (F5) - but this is undesirable, really need the style in place upon first-load.

Its obviously a problem with the dynamic loading, but any ideas how to fix it?

Any help much appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无声静候 2024-12-13 19:13:25

为了研究这个问题,我将使用元素检查器(例如 IE 开发人员工具或 Firefox 上的 fire bug 提供的元素检查器)查看应用于单元格的 css。这应该可以帮助您了解您的 css 是否正在加载以及其他内容是否优先。

另外,当您动态加载 UserControl 时,它是在完整的回发还是 AJAX 回调(例如更新面板内部)上?如果在 AJAX 调用中将调用更改为完整回发,是否会改变行为?

该行为在多个 Web 浏览器中是否一致,还是仅发生在一种浏览器中?

对于更具体的建议,我需要有关如何动态加载 UserControl 以及 CSS 位置的更多详细信息。它是否在另一个文件中,页面/用户控件上的样式?

For looking into this, I would look at the css that is applied to the cells by using an element inspector like provided by the developer tools for IE or fire bug on Firefox. This should help you to know if your css is being loaded and something else is taking precedence.

Also, when you dynamically load the UserControl is it on a full post back or an AJAX call back such as inside of an update panel? If in an AJAX call and you change the call to be a full post back, does it change the behavior?

Is the behavior consistent across multiple web browsers or does it only occur in one browser?

For more specific suggestions, I would need more details on how you are dynamically loading the UserControl and where the CSS is. Is it in another file, a style on the page/user control?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文