Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1175
Can I make a cell with a value list read only?
posted

I have a column with a value list, when the user clicks the cell it goes into edit mode so I added this code

 e.Layout.Bands[0].Columns["Column Format"].CellClickAction = CellClickAction.CellSelect;

after adding that it only goes into edit mode after the user selects an item in the value list, but I don't want the user to be able to edit the text at any point.

here is the code I use for the value list

 ValueList vl;

if (!e.Layout.ValueLists.Exists("Formats"))

{

vl = e.Layout.ValueLists.Add("Formats");

vl.ValueListItems.Add("#"); vl.ValueListItems.Add("#.0");

vl.ValueListItems.Add("#.00");

vl.ValueListItems.Add("#.000");

vl.ValueListItems.Add("#.0000");

}

e.Layout.Bands[0].Columns["Column Format"].ValueList = e.Layout.ValueLists["Formats"];

Thank you, Jamie

Parents
No Data
Reply
  • 45049
    posted

    Set the cell's Activation to NoEdit or ActivateOnly to keep it from being edited.  Alternately, you can set the CellActivation property on the whole column to apply to all cells in the column.

Children