Hi,
is there a way to fire the FileUploaded server-side event after using drag and drop?
I have to save the file to a given folder and I would like to use the SaveAs.
Thaks!
Hello,
I've been using client-side binding for several radgrids on my page. I have a need to clear all of their datasources simultaneously at some points. I want to be elegant and loop through all the grids instead of explicitly clearing them line by line.
I want to do something like this:
var
grid = document.getElementsByClassName(
'SubRadGrid'
);
$(
'.SubRadGrid'
).each(
function
(){
})
And not like this:
var
empty = [];
var
grid1 = $find(
"<%= RadGrid1.ClientID %>"
).get_masterTableView();
grid1 .set_dataSource(empty);
grid1 .dataBind();
var
grid2 = $find(
"<%= RadGrid2.ClientID %>"
).get_masterTableView();
grid2 .set_dataSource(empty);
grid2 .dataBind();
var
grid3 = $find(
"<%= RadGrid3.ClientID %>"
).get_masterTableView();
grid3 .set_dataSource(empty);
grid3 .dataBind();
I have a grid that I open up with all lines editable. I am trying to strip the first 10 characters off of the text in the ItemDataBound event. I have version 2016.3.1027.40.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem)
{
GridEditableItem editableItem = e.Item as GridEditableItem;
//string s = "This Works and is longer than 10 characters";
//if (s.Length > 10)
//{
// s = s.Substring(10);
//}
//editableItem["MasterLineItem"].Text = s;
if (editableItem["MasterLineItem"].Text.Length > 10)
{
editableItem["MasterLineItem"].ToolTip = (editableItem["MasterLineItem"].Text).Substring(10); //THIS DOES NOT WORK
}
}
}
Thanks
I have added some client script to a dropdown that automatically highlights and checks an item when pressing enter and also appends a comma after the text. The problem is that when I press enter the dropdown still remains filtered. How can I reset the dropdown to show all the items.
Here is the problem as a gif:
When I press enter Argentina gets selected, the comma is appended but the dropdown list isn't reset to show all the items. How do I do this? Any other suggestions to how can I append the comma automatically without using any hacks are also welcome.
Code:
<
telerik:RadComboBox
ID
=
"rcbCountries"
runat
=
"server"
Width
=
"287px"
CheckBoxes
=
"true"
EnableCheckAllItemsCheckBox
=
"true"
CheckedItemsTexts
=
"DisplayAllInInput"
AllowCustomText
=
"true"
EnableLoadOnDemand
=
"false"
MaxHeight
=
"400px"
Height
=
"400px"
NoWrap
=
"true"
AutoPostBack
=
"false"
EmptyMessage
=
"Partner's country"
MarkFirstMatch
=
"true"
AutoCompleteSeparator
=
", "
Filter
=
"Contains"
OnClientBlur
=
"rcbCountries_Blur"
OnClientFocus
=
"otherCB_Focus"
OnClientItemChecked
=
"rcbCheckboxChecked"
OnClientKeyPressing
=
"rcbCheckboxKeyPressed"
OnClientDropDownClosing
=
"rcbDropdownClosing"
EnableTextSelection
=
"False"
>
</
telerik:RadComboBox
>
function
rcbCheckboxKeyPressed(sender, args) {
if
(args.get_domEvent().keyCode == 13) {
var
highlighted = sender.get_highlightedItem();
if
(!highlighted)
sender.highlightMatches();
var
highlighted = sender.get_highlightedItem();
if
(highlighted) {
highlighted.check();
rcbCheckboxChecked(sender, args);
$(sender.get_element()).data(
'keep-dropdown-open'
,
true
);
}
}
}
function
rcbCheckboxChecked(sender, eventArgs) {
//hack: There is no event to handle that allows us to add a comma at the end
setTimeout(
function
() {
appendComma(sender);
}, 0);
}
function
rcbDropdownClosing(sender, args) {
if
($(sender.get_element()).data(
'keep-dropdown-open'
) ===
true
)
args.set_cancel(
true
);
}
function
appendComma(sender) {
if
(sender.get_checkedItems().length == 0)
return
;
var
text = $.trim(sender.get_text());
if
(text.length > 0 && !text.match(/,\s*$/)) {
sender.set_text(text +
", "
);
}
}
I have been getting reports of an odd problem for a few months now - where some of our grids seem to be acting up. I am not sure if it was a change in this most recent release or the one before that - but something has changed. Hoping you guys can help
Here is the scenario:
- We have RadGrids inside RadWindow / ContentTemplate areas on a screen.
- These grids use GridTemplateColumns with various Rad controls inside each column - e.g. RadCombobox and RadNumericTextbox
- On page load we bind data to these grids (along with other things on the main screen)
- On the OnItemDataBound event of the RadGrid - we find the controls in each column, set their values if needed - and for clientside processing we set attributes on some controls to reference other controls on the same line. For example, if the first column is a RadCombobox with two options, and the next column is a RadNumericTextbox that will display a default value when the value of the RadCombobox changes - then we get the ClientID of the RadCombobox and save it as an attribute on the RadCombobox
- Following this example - we wire up the OnClientSelectedIndexChanged of the RadCombobox - and handle the setting of the default value for the RadNumericTextbox from javascript - to make it quick and excel like... the user just tabs through the fields - and this event does something like this:
var myRadNumeric = $find(sender.get_attributes().getAttribute('myRadNumeric '));
myRadNumeric.set_value(defaultValue);
- The idea is to have the grid act more like Excel - so the user can just tab through and change data in each control
And here is the problem:
In the past this has always worked - AND still does - UNLESS the RadGrid is in a RadWindow/ContentTemplate. Oddly in this scenario the ClientIDs of the controls in the GridTemplateColumns that we read and saved from the RadGrids OnItemDataBound event CHANGES once the screen is rendered... so javascript cannot $find it...
We have found we can fix this by making a server call back after displaying the RadWindow (from javascript radopen()) - doing a Rebind() on the grid in question - at that point all ClientIDs are correct on both client and server...
I hope you followed that - it is a bit elaborate of a scenario. I believe we picked up this method of handing Excel like interactions with the RadGrid from an older Forum thread or suggestion - but we are not clear if the behavior we are seeing is
Temp files are not getting cleared from the App_Data folder while i'm using RADAsyncUpload control. I'm using telerik dll verison is 2015.1.310.40 and .Net framework is 4.6.2 with Visual Studio 2015.
Below is the .aspx file code
<telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" HideFileInput="true" MultipleFileSelection="Automatic"
AllowedFileExtensions=".tif,.tiff,.pdf" TemporaryFileExpiration="05:00:00">
Below is the C# code for reading the image bytes from memory stream by using telerik UploadedFile.
Byte[] byt= null;
foreach (UploadedFile file in AsyncUpload1.UploadedFiles)
{
using (MemoryStream ms = new MemoryStream())
{
file.InputStream.CopyTo(ms);
byt = ms.ToArray();
}
}
Hello everyone,
I am using a radgrid with a GridDateTimeColumn, I want to set the FirstDayOfWeek for the calendar from code behind.
Here is my column :
<telerik:GridDateTimeColumn DataField="DateDebut" HeaderText="Du" SortExpression="Du" MaxLength="50" UniqueName="DateDebut" ItemStyle-Width="80px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:yyyy-MM-dd}" />
Here is my code behind :
protected void rgDateSaisie_ItemDataBound(object sender, GridItemEventArgs e) {
if (e.Item is GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDateTimeColumnEditor editor = (GridDateTimeColumnEditor)(editMan.GetColumnEditor("DateDebut")); RadDatePicker picker = editor.PickerControl;
picker.DatePopupButton.ToolTip = "Ouvrir le calendrier";
picker.Calendar.FirstDayOfWeek = FirstDayOfWeek.Friday;
}
The toolTip message works but firstDayOfTheWeek is still sunday in the popup calendar.
What I am missing.
Thanks a lot
Hi,
We're using Telerik RadGrid to display data in our pages.
Existing system: Since this page/grid is in use on multiple places, and due to other reasons during development, this grid is created during runtime (in c#). Also a few checkbox columns on this grid is editable.
Recent requirement: On checking the checkbox in an editable checkbox column of the grid, make another text column of same row in the the grid to be editable. Basically show a textbox for user to enter some notes on why he thinks that checkbox should be checked. Similarly, when unchecked, that row's textbox to be disabled.
Issue: We're unable to get the checkbox check changed event of checkbox column, in the aspx page, to fire. This is the event in which we intend to put code to enable the textbox of that row. Tried to achieve this server side as well as client side, but nothing seems to work.
We have created a checkbox event handler in Item_Created event of grid control. But on checking the checkbox, the Item_Created event does not fire, page does post back. Also, note that we have created the CustomCheckbox class by inheriting "ITemplate" interface. The CustomCheckbox's check changed event does fire but here we do not have any info related to selected row so that we can fetch and enable/disable the cell with textbox.
The examples over the internet have the telerik grid created in design time and it works well for them. So we're guessing that this might be an issue for us since we're creating the grid at runtime. Redeveloping the entire page to create grid design time is out of question since the page is in use on multiple places. Apart from the time required to redevelop/regression test the entire page, many functionalities are in place with runtime grid. We need to fix this issue for grid created at runtime.
We have created a POC application in which we've replicated our exact issue. Unable to attach the zipped source code in this thread since only image files are allowed to be attached. Here is the link to file in dropbox: https://www.dropbox.com/sh/gv5csygr3uxpe2f/AAAaCezrFO2hUXdH6H7CPBaJa?dl=0
Please look into this and let us know a possible solution.
Let me know if any additional details are required.
Thanks,
Blessy.