Lena Posted September 21, 2015 Posted September 21, 2015 Hi. If I use key Ctrl and mouse click I can make multiple selections in UniDBLookupListBox. How to disable multiple selections in UniDBLookupListBox? Thanks. void __fastcall TUniForm1::UniFormBeforeShow(TObject *Sender) { //does not work UniDBLookupListBox1->DesignerMultiSelected = true;//false } Quote
Sherzod Posted September 21, 2015 Posted September 21, 2015 Hi, UniDBLookupListBox1 -> ClientEvents -> ExtEvents ... afterrender fn: function afterrender(sender, eOpts) { sender.boundList.getSelectionModel().setSelectionMode("SINGLE"); } Best regards. Quote
Lena Posted September 22, 2015 Author Posted September 22, 2015 Hi. Thank you. It’s working but sometimes when I click in empty area a see this error. //OnClick event UniDBLookupListBox void __fastcall TUniFormSeachGrSuper::UniDBLookupListBoxSechRoomsSuperClick(TObject *Sender) { try { Variant check = UniDBLookupListBoxSechRoomsSuper->KeyValue; if(check.IsNull() == true || UniDBLookupListBoxSechRoomsSuper->ItemIndex == -1) { //MainForm()->UniDBLookupComboBoxGraphicOrg->ItemIndex = - 1; MainForm()->UniDBLookupComboBoxGraohicRoom->KeyValue = - 1; MainForm()->UniDBLookupComboBoxGraphicSensor->KeyValue = - 1; UniDBLookupListBoxSechDatSuper->KeyValue = - 1; UniDBLookupListBoxSechDatSuper->ListSource = NULL; } else { MainForm()->UniDBLookupComboBoxGraohicRoom->KeyValue = -1; MainForm()->UniDBLookupComboBoxGraohicRoom->KeyValue = UniDBLookupListBoxSechRoomsSuper->KeyValue; UniDBLookupListBoxSechDatSuper->KeyValue = - 1; MainForm()->UniDBLookupComboBoxGraohicRoomCloseUp(0); UniDBLookupListBoxSechDatSuper->ListSource = UniMainModule()->DataSourceSelectDatZaPeriod; } } catch (const Exception &E) { String mis = L"Error: " + E.ClassName() + L" Message: " + E.Message; ShowMessage(mis); } } Quote
Sherzod Posted September 22, 2015 Posted September 22, 2015 Hi, Hmm, may be an error in the other... ?! Best regards. Quote
Lena Posted September 22, 2015 Author Posted September 22, 2015 Hi. When I remove line: sender.boundList.getSelectionModel().setSelectionMode("SINGLE"); error disappears Quote
Lena Posted September 22, 2015 Author Posted September 22, 2015 User see it: https://youtu.be/TqvKPA7B3-w Quote
Sherzod Posted September 22, 2015 Posted September 22, 2015 Ok. I will try analyze.. Best regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.