简体   繁体   中英

Infragistics UltraWinGrid disable first column

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;

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM