This is a migrated thread and some comments may be shown as answers.

When selecting from a ListBox it also highlights text on the page

2 Answers 36 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Jonathan Days
Top achievements
Rank 1
Jonathan Days asked on 12 Jul 2012, 03:16 PM
We have a listbox with SelectionMode="Multiple" turned on, however when you select multiple items it also selects other parts of the screen and manages to select other parts of the screen, it selects from the listbox too but everything selected goes blue as expected but lots of screen does too,

I hope you can help.

<
telerik:RadListBox ID="radOrderID" runat="server" Width="900px" Height="200px" EmptyMessage="Select an Order"
                            Skin="Outlook" SelectionMode="Multiple" AutoPostBack="true">
                            <ItemTemplate>
                                <table cellspacing="0" cellpadding="0" class="multicomboBoxOrder">
                                    <tr>
                                        <td class="col1">
                                            <%#DataBinder.Eval(Container.DataItem, "OrderNo")%>
                                        </td>
                                        <td class="col2">
                                            <%#DataBinder.Eval(Container.DataItem, "Description")%>
                                        </td>
                                        <td class="col3">
                                            <%#DataBinder.Eval(Container.DataItem, "CustomerHeaderRef")%>
                                        </td>
                                        <td class="col4">
                                            <%#DataBinder.Eval(Container.DataItem, "Department")%>
                                        </td>
                                        <td class="col5">
                                            <%#Format(DataBinder.Eval(Container.DataItem, "OutstandingValueToInvoice"), "0.00")%>
                                        </td>
                                        <td class="col6">
                                            <%#Format(DataBinder.Eval(Container.DataItem, "OutstandingValueToInvoiceShipped"), "0.00")%>
                                        </td>
                                        <td class="col7">
                                            <%#DataBinder.Eval(Container.DataItem, "CurrencySell")%>
                                        </td>
                                        <td class="col8">
                                            <%#DataBinder.Eval(Container.DataItem, "OrderSource")%>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </telerik:RadListBox>

2 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 17 Jul 2012, 08:22 AM
Hello Jonathan,

I guess you are talking about the case where you use the Shift key to select multiple items. This triggers the default browser behavior, which is responsible for selecting the items on the page. Unfortunately this is out of our scope and we cannot prevent it.
 
Greetings,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
william
Top achievements
Rank 1
answered on 01 Jun 2016, 12:44 PM

 

For anyone else who has this problem and stumbles across this page, I found that this javascript in my pageLoad() function fixed the behavior for me. 

window.onload = function () {
                document.onselectstart = function () {
                    return false;
                }
            }

However, as it is, it disables all text selection on the entire webpage.

Tags
ListBox
Asked by
Jonathan Days
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
william
Top achievements
Rank 1
Share this question
or