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
710
how to set a grid to act like a select list.
posted

I want to make a grid control act like a select list.  That is, I want to be able to highlight rows, but not be able to edit them.  I want to create both a single row selection list, where only one row can be highlighted, or a multi-row select list, where multiple rows can be selected at the same time.

I am close.  I have

 GrdCtl.DisplayLayout.Override.RowSelectors    = DefaultableBoolean.False;      GrdCtl.DisplayLayout.Override.SelectTypeCol   = SelectType.None;      GrdCtl.DisplayLayout.Override.SelectTypeCell  = SelectType.None;      GrdCtl.DisplayLayout.Override.CellClickAction = CellClickAction.RowSelect;    GrdCtl.DisplayLayout.Override.BorderStyleRow = UIElementBorderStyle.None;          GrdCtl.DisplayLayout.Override.BorderStyleCell = UIElementBorderStyle.None;

 GrdCtl.DisplayLayout.ViewStyle = ViewStyle.SingleBand;

 GrdCtl.DisplayLayout.Override.SelectTypeRow = AllowMultiSelect?SelectType.Extended:SelectType.Single;

This mostly works, but I have some weird behaviors, I think associated with the active cell/row.

 Sometimes I see an outlined, not highlighted, row that appears the be the active row.  I would like it to look like other non-hihglighted rows.

I think the highlighted row and the active row are usualy the same row, but it looks highlighted so that is okay, but sometimes it seems to have the active appearance, which looks unhighlighted, but with a border.  That is not okay.  And in this case, if I move the mouse (button up) off of the row it changes to the highlighted row appearance.  

So what do I need to do to make this work like a row-selection control? 

 

thanks