I'm in the process of creating a custom email client using the Telerik grid and treeview controls. I have modeled some of the UI on the Telerik WebMail sample, in that the grid of email headers allows single selection in order to display the message body below. However, I also need to support multiple selection of rows and to be able to drag and drop those selected rows. I am able to do this, but there is a disturbing side effect when multiple rows are selected (via ctrl-click or select-click - no drag to select, that is turned off). Whenever additional rows are selected, it looks as if the grid is selected in much the same way as an HTML table would be if the user had clicked and dragged on the rows. The functionality of dragging and dropping works, but the highlighting of other rows that were not meant to be selected is very distracting to the user. I don't notice this behavior on other Telerik samples that demonstrate multiple selection and/or drag-drop, so I'm at a loss as to what is causing the problem on my end. Perhaps the combination of single selection and multiple selection is causing the behavior.
In any case, I have included a screenshot of what the grid looks like after the multiple selections are made in order to illustrate the problem. The rows that have a green background are the ones that I've actually meant to select, yet all of the other rows are "selected" as well - as if the user had intentionally dragged to select them.
Here is code related to the way the grid is set up in the ASPX file.
Notice that I also allow double clicking a row to bring up a pop-up window. Finally, the grid is inside of a RadPane which is inside of a RadSplitter. Hopefully, that doesn't make any difference in this case.
Does anyone know a way around this issue? Any help will be appreciated.
In any case, I have included a screenshot of what the grid looks like after the multiple selections are made in order to illustrate the problem. The rows that have a green background are the ones that I've actually meant to select, yet all of the other rows are "selected" as well - as if the user had intentionally dragged to select them.
Here is code related to the way the grid is set up in the ASPX file.
<
telerik:RadGrid
runat
=
"server"
ID
=
"rgrdEmails"
Height
=
"100%"
BorderWidth
=
"0"
AutoGenerateColumns
=
"false"
GridLines
=
"Both"
ShowGroupPanel
=
"true"
OnNeedDataSource
=
"rgrdEmails_NeedDataSource"
AllowMultiRowSelection
=
"True"
OnRowDrop
=
"rgrdEmails_RowDrop"
OnSelectedIndexChanged
=
"rgrdEmails_SelectedIndexChanged"
>
<
ClientSettings
AllowDragToGroup
=
"True"
EnableRowHoverStyle
=
"true"
AllowRowsDragDrop
=
"True"
EnablePostBackOnRowClick
=
"true"
>
<
Selecting
AllowRowSelect
=
"true"
EnableDragToSelectRows
=
"False"
/>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
/>
<
ClientEvents
OnRowDblClick
=
"grdDblClick"
OnRowDropping
=
"onRowDropping"
/>
</
ClientSettings
>
<
MasterTableView
TableLayout
=
"Fixed"
Width
=
"100%"
GroupLoadMode
=
"Client"
DataKeyNames
=
"EmailId"
ClientDataKeyNames
=
"EmailId,Subject"
AdditionalDataFieldNames
=
"Date"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"DateResult"
HeaderValueSeparator
=
":"
SortOrder
=
"Descending"
/>
</
GroupByFields
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldName
=
"DateResult"
HeaderText
=
"Date"
FormatString
=
"{0:d}"
/>
</
SelectFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
Columns
>
<
telerik:GridDragDropColumn
runat
=
"server"
HeaderStyle-Width
=
"18px"
/>
<
telerik:GridBoundColumn
DataField
=
"From"
HeaderText
=
"From"
HeaderStyle-Width
=
"120px"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Subject"
HeaderText
=
"Subject"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Received"
HeaderText
=
"Date"
HeaderStyle-Width
=
"150px"
GroupByExpression
=
"DateResult Date GROUP BY DateResult"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"EmailId"
Visible
=
"false"
></
telerik:GridBoundColumn
>
<
telerik:GridCalculatedColumn
UniqueName
=
"Date"
DataType
=
"System.DateTime"
DataFields
=
"Received"
Expression
=
"Received.ToShortDateString()"
HeaderText
=
"Date"
Visible
=
"false"
>
</
telerik:GridCalculatedColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Notice that I also allow double clicking a row to bring up a pop-up window. Finally, the grid is inside of a RadPane which is inside of a RadSplitter. Hopefully, that doesn't make any difference in this case.
Does anyone know a way around this issue? Any help will be appreciated.