<
telerik:RadAsyncUpload
ID
=
"radUpload"
runat
=
"server"
MultipleFileSelection
=
"Automatic"
AllowedFileExtensions
=
".pdf"
MaxFileInputsCount
=
"5"
Localization-Select
=
"Browse"
Localization-Remove
=
"Delete Document"
ReadOnlyFileInputs
=
"true"
OnClientValidationFailed
=
"validationFailed"
TemporaryFileExpiration
=
"5"
OnClientFileSelected
=
"fileSelected"
OnClientDeleting
=
"fileDelete"
OnClientFileUploaded
=
"fileUploaded"
></
telerik:RadAsyncUpload
>
function
keyboardSupport(sender, args) {
var $fileInput = $(args._fileInputField);
var $fakeInput = $fileInput.nextAll("input[class='ruFakeInput']");
var $selectButton = $fileInput.nextAll("input[class='ruButton ruBrowse']");
$selectButton.attr(
'aria-required', 'true');
$fileInput.attr(
'aria-required', 'true');
$(
'label[for$="_DocumentFileUploadfile0"]').text('<%=GetLocalResourceObject("UploadDocumentLabelResource.Text") %>');
$fakeInput.attr(
"tabindex", "-1");
$selectButton.attr(
"tabindex", "-1");
$fileInput.focus(
function(e) {
$selectButton.css(
"border", "1px dotted");
});
$fileInput.blur(
function(e) {
$selectButton.css(
"border", "0px");
});
if (navigator.userAgent.indexOf("MSIE") != -1) {
$fileInput.keydown(
function(e) {
if (e.keyCode == Sys.UI.Key.space) {
$fileInput.click();
}
if (e.keyCode == Sys.UI.Key.enter) {
e.preventDefault();
}
if (e.keyCode == Sys.UI.Key.tab && e.shiftKey == false) {
$fakeInput.focus();
}
if (e.keyCode == Sys.UI.Key.tab && e.shiftKey == true) {
var $checkbox = $(".ruCheck", args.get_row());
if ($checkbox[0] != undefined) {
e.preventDefault();
$checkbox.focus();
}
else {
$fileInput.parent().focus();
}
}
});
}
I want that it should prevent enter key and upload doc on space bar . Above code works fine till upload of doc But after dialogue box opens and i uploaded doc now if i press tab ideally it should go to next control in my case which is another next button but its not working like this it.after doc upload if i press tab it remains in upload control and if press tab twive it go to next button and then if i press enter key it dnt do postback but it clears uploaded file and remain focused in upload control.
I tried changing EnableFileInputSkinning property also it doesnt help.
one more thing if i use $selectButton.click() in place of $fileInput.click(); it works fine in IE9 but in IE8 and IE7 dialogue box doesnt open.
<
telerik:RadGrid
EnableViewState
=
"false"
OnPreRender
=
"RadGrid1_PreRender"
ExportSettings-ExportOnlyData
=
"true"
ExportSettings-IgnorePaging
=
"true"
ExportSettings-Csv-ColumnDelimiter
=
"Semicolon"
DataSourceID
=
"EntityDataSourcePesee"
AutoGenerateColumns
=
"false"
ID
=
"RadGrid1"
Width
=
"1604px"
AllowFilteringByColumn
=
"True"
AllowSorting
=
"True"
ShowFooter
=
"True"
AllowPaging
=
"true"
PageSize
=
"5"
runat
=
"server"
GridLines
=
"None"
EnableLinqExpressions
=
"false"
OnItemCommand
=
"RadGrid1_ItemCommand"
OnItemCreated
=
"RadGrid1_ItemCreated"
Culture
=
"fr-FR"
EnableHeaderContextMenu
=
"true"
EnableHeaderContextFilterMenu
=
"true"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
NextPageToolTip
=
"Page suivante"
PrevPageToolTip
=
"Page précédente"
FirstPageToolTip
=
"Première page"
LastPageToolTip
=
"Dernière page"
PageSizeLabelText
=
"Nombre de pesées par page :"
PagerTextFormat
=
"{4} Pesées {2} à {3} sur {5} au total"
/>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
AutoGenerateColumns
=
"false"
IsFilterItemExpanded
=
"false"
PageSize
=
"10"
AllowFilteringByColumn
=
"True"
ShowFooter
=
"True"
TableLayout
=
"Auto"
CommandItemDisplay
=
"Bottom"
>
<
CommandItemSettings
ExportToCsvText
=
"Exporter la sélection"
ShowAddNewRecordButton
=
"false"
ShowRefreshButton
=
"false"
ShowExportToCsvButton
=
"true"
/>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"PES_DATE"
SortOrder
=
"Descending"
/>
</
SortExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderTooltip
=
"Trier la colonne"
FilterControlWidth
=
"50px"
DataField
=
"SITE.SIT_LIBELLE"
HeaderText
=
"Site de pesage"
FilterImageToolTip
=
"Filtrer"
SortExpression
=
"it.SITE.SIT_LIBELLE"
UniqueName
=
"SIT_LIBELLE"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderTooltip
=
"Trier la colonne"
FilterControlWidth
=
"50px"
DataField
=
"PES_DATE_ENTREE"
HeaderText
=
"Date d'entrée de la pesée"
FilterImageToolTip
=
"Filtrer"
SortExpression
=
"PES_DATE_ENTREE"
UniqueName
=
"PES_DATE_ENTREE"
>
<
HeaderStyle
Width
=
"160px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
HeaderTooltip
=
"Trier la colonne"
FilterControlWidth
=
"50px"
DataField
=
"PES_DATE"
HeaderText
=
"Date de sortie de la pesée"
FilterImageToolTip
=
"Filtrer"
SortExpression
=
"PES_DATE"
UniqueName
=
"PES_DATE"
>
<
HeaderStyle
Width
=
"160px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"PES_TEMPS_PRESENCE"
SortExpression
=
"PES_TEMPS_PRESENCE"
FilterImageToolTip
=
"Filtrer"
InitializeTemplatesFirst
=
"false"
FilterControlToolTip
=
"hh:mm:ss"
DataType
=
"System.String"
DataField
=
"PES_TEMPS_PRESENCE"
>
<
HeaderTemplate
>
<
asp:LinkButton
ToolTip
=
"Trier la colonne"
CssClass
=
"Button"
ID
=
"btnSortTempsPresence"
Text
=
"Temps de présence (hh:mm:ss)"
CommandName
=
'Sort'
CommandArgument
=
'PES_TEMPS_PRESENCE'
runat
=
"server"
/>
</
HeaderTemplate
>
<
ItemTemplate
>
<%# formatTempsPresence((int?)Eval("PES_TEMPS_PRESENCE")) %>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
HeaderTooltip
=
"Trier la colonne"
FilterControlWidth
=
"30px"
DataField
=
"PES_NUM_BON"
HeaderText
=
"N° Bon de pesée"
FilterImageToolTip
=
"Filtrer"
SortExpression
=
"PES_NUM_BON"
UniqueName
=
"PES_NUM_BON"
>
</
telerik:GridBoundColumn
>
....
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"false"
/>
<
ClientEvents
OnFilterMenuShowing
=
"FilterMenuShowing"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
<
asp:EntityDataSource
ID
=
"EntityDataSourcePesee"
runat
=
"server"
ConnectionString
=
"name=PeseesEntities"
DefaultContainerName
=
"PeseesEntities"
EntitySetName
=
"PESEE"
Include
=
"SITE"
EnableUpdate
=
"false"
EnableDelete
=
"false"
EnableInsert
=
"false"
>
</
asp:EntityDataSource
>
Hello,
I have a problem with the custom sort in Oracle data base with a empty string and your RadGrid. When I use a custom sort in your RadGrid, the object result list it’s ok, but in the grid, the result isn’t the same. But, if I use buttons to sort the grid with the same query, the result it’s correct in my grid. I think the grid sort again my objects list in the SortCommand.
In Sql server, I have no problem with the same query. In Oracle, the empty value isn’t sort of the same order as Sql Server. But why the grid sorts again my list of objects ?
Exemple code for custom sort :
Private Sub grdDetailTelerik_SortCommand(sender As Object, e As Telerik.Web.UI.GridSortCommandEventArgs) Handles grdDetailTelerik.SortCommand
Dim sortingField As String = e.SortExpression
Dim sortingOrder As String = e.NewSortOrder
ActualResultPage = 0
SetLastViewPage(0)
SortColumn = sortingField
SortDirection = sortingOrder
grdDetailTelerik.DataSource = GetData(True) 'Get all of objet with my query
grdDetailTelerik.Rebind()
End Sub
Custom sort :
SortColumn = Code
SortDirection = Ascending
Result list of Objet(Oracle) :
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 099.9.0
Code = 099.9.0
Code = String.empty
Code = String.empty
Result list of Objet (Sql Server) :
Code = String.empty
Code = String.empty
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 001.0.0
Code = 099.9.0
Code = 099.9.0
Result in grid(Oracle), the order of sort isn’t ok in this example, my empty string is in top, but :
Page 1 :
oracle_page1.png
Page 2 :
oracle_page2.png
Result in grid (Sql server) is ok:
Page 1 :
sql_page1.png