Infragistics UltraWinGrid 禁用第一列

发布于 2024-12-25 03:18:57 字数 297 浏览 3 评论 0原文

我有一个 infragistics UltraWinGrid,我想禁用第一列或将其设置为“只读”。有什么方法可以做到这一点?

我尝试过(这些都不起作用):

        _ultraGridRetailers.DisplayLayout.Bands[0].Columns[0].CellActivation = Activation.Disabled;
        _ultraGridRetailers.Rows[0].Cells[0].Activation = Activation.Disabled;

I have an infragistics UltraWinGrid and I want to disable the first column or make it "readonly". What is the way to do this?

I tried (none of these worked):

        _ultraGridRetailers.DisplayLayout.Bands[0].Columns[0].CellActivation = Activation.Disabled;
        _ultraGridRetailers.Rows[0].Cells[0].Activation = Activation.Disabled;

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

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

发布评论

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

评论(2

婴鹅 2025-01-01 03:18:57

对于任何具体问题,最好联系 Infragistics 的支持人员,但有关于您的问题:博客一个

尝试调试您的应用程序,看看您是否太早设置此行为或者是否正在重置它在指向的代码之后的代码中。根据博客文章,这应该是实现目标的方法,如果它不起作用,您最好联系支持人员并提交开发问题。

For any specific question it will be better to contact the support of Infragistics, but there is regarding your question: Blog one

Try to debug your aplication and see if you are setting this behavior too early or if you are reseting it in code after the pointed one. According to the blog post this should be the way to acieve the goal, and if it is not working you better contact the support and submit a development issue.

物价感观 2025-01-01 03:18:57

我尝试过的是挂钩 UltraGrid 的 InitializeLayout 事件,如下所示,并在那里设置所需的列属性,这对我来说确实有效:

private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
    //Make the column disabled or
    e.Layout.Bands[0].Columns[0].CellActivation = Activation.Disabled;
    //Make the column readonly
    e.Layout.Bands[0].Columns[0].CellActivation = Activation.ActivateOnly;
}

如果上述内容对您不起作用,很可能有些东西会覆盖这些设置在您申请的后期阶段。

What I have tried is hooking to the InitializeLayout event of the UltraGrid like the following, and setting there the desired properties of the columns, which does work for me correctly:

private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
    //Make the column disabled or
    e.Layout.Bands[0].Columns[0].CellActivation = Activation.Disabled;
    //Make the column readonly
    e.Layout.Bands[0].Columns[0].CellActivation = Activation.ActivateOnly;
}

If the above doesn't work for you, most probably something overrides those settings in a later stage of your application.

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