Hello,
I currently have a page with a RadGrid and a label which tells the last time that the RadGrid was refreshed. The RadGrid has a refresh command item, and the problem is that pressing the refresh button refreshes the RadGrid but does not update the label. In the RadGrid's PreRender event I have included the following code:
RefreshLabel.Text = "Last Refreshed: " + System.DateTime.Now.ToString();
The text of the label changes when I manually refresh the page, but not when I press the RadGrid's refresh button. Is there some quirk to RadGrid's which would prevent the text of the label from changing? Or is there some other event that I should put this code in? I have tried putting the same code in the RadGrid's NeedDataSource event as well, to no avail.
Thank you for any help that can be provided.
Dear Team,
We are using RadCloudUpload control for uploading Images and Videos. The same control should allow both Image and Video upload.
But if user is uploading an Image, file size should be restricted to 10MB, for Video upload file max file size restriction should be 200MB.
Is there a way to implement file size validation on client side based on content type? Please suggest. Thanks in advance.
<
telerik:RadCloudUpload
ID
=
"RadCloudUpload1"
runat
=
"server"
CssClass
=
"btn btn-green center-block"
OnClientUploadFailed
=
"onClientUploadFailed"
OnClientValidationFailed
=
"onClientUploadFailed"
OnFileUploaded
=
"RadCloudUpload1_FileUploaded"
DropZones
=
"#dragDrop"
OnClientFilesUploaded
=
"fileUploaded"
ProviderType
=
"Azure"
MaxFileSize
=
"10486000"
AllowedFileExtensions
=
".jpg,.jpeg,.png,.gif,.mpg,.mp4,.avi,.mov,.qt,.3gp,.m4v,.mpg,.mpeg,.mp4v,.h264,.wmv,.mpg4,.movie,.m4u,.flv,.dv,.mkv,.mjpeg,.asf,.ogv,.mts,.mvi"
MultipleFileSelection
=
"Automatic"
>
</
telerik:RadCloudUpload
>
Hi,
I am doing BatchEdit for Nesting grid with template control in RadGrid. I have some postback event for control in template columns, but if I set AutoPostback="True" for control and when I click on on any row for edit current clicked row gets lost and when I again click on row same row it open as usual.
Below is my code snippet
<telerik:RadGrid ID="VarianceMgmntGrid" runat="server" ShowStatusBar="true" AutoGenerateColumns="False"
PageSize="7" AllowSorting="false" AllowMultiRowSelection="False" AllowPaging="True"
OnDetailTableDataBind="VarianceMgmntGrid_DetailTableDataBind" OnNeedDataSource="VarianceMgmntGrid_NeedDataSource" OnBatchEditCommand="VarianceMgmntGrid_BatchEditCommand" OnItemUpdated="VarianceMgmntGrid_ItemUpdated">
<ClientSettings AllowExpandCollapse="true">
</ClientSettings>
<MasterTableView DataKeyNames="ReconTypeID,InstrumentTypeId" AutoGenerateColumns="False" ShowFooter="true" ShowHeader="true">
<DetailTables>
<telerik:GridTableView DataKeyNames="ReconTypeID,VarReasonCodeID,InstrumentTypeId" Name="ProductType" Width="100%">
<DetailTables>
<telerik:GridTableView DataKeyNames="ReconTypeID,VarReasonCodeID,InstrumentTypeId,OTCVarId" Name="ReasonCodeProduct" Width="100%">
<DetailTables>
<telerik:GridTableView EditMode="Batch" DataKeyNames="OTCVarId,VarReasonCodeID,ReconTypeID,InstrumentTypeId" Name="ReasonCodeDetailsProduct" Width="100%" CommandItemDisplay="Top" EditMode="Batch" EditFormSettings-EditColumn-AutoPostBackOnFilter="false" AutoGenerateColumns="False" HorizontalAlign="NotSet" AllowAutomaticInserts="True">
<BatchEditingSettings EditType="Row" />
<Columns>
<telerik:GridTemplateColumn DataField="BrokerValue" UniqueName="BrokerValue" HeaderText="Broker"
HeaderStyle-Width="90px">
<ItemTemplate>
<asp:Label ID="lblBrokerInner" runat="server" Text='<%# LibFMA.Functions.FormatCurrency(Eval("BrokerValue"), True, 2)%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txtBrokerInner" runat="server" Width="110px AutoPostBack="true" OnTextChanged="BrokerValue_TextChanged"
CssClass="RightAligned">
</telerik:RadTextBox>
</EditItemTemplate>
<HeaderStyle CssClass="OTCs_gridHeader_left" HorizontalAlign="Left" Font-Bold="true"
ForeColor="WhiteSmoke" />
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn DataField="SystemValue" UniqueName="SystemValue" HeaderText="System"
HeaderStyle-Width="90px">
<ItemTemplate>
<asp:Label ID="lblSystemInner" runat="server" Text='<%# LibFMA.Functions.FormatCurrency(Eval("SystemValue"), True, 2)%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txtSystemInner" runat="server" Width="110px" AutoPostBack="true" OnTextChanged="BrokerValue_TextChanged"
CssClass="RightAligned">
</telerik:RadTextBox>
</EditItemTemplate>
<HeaderStyle CssClass="OTCs_gridHeader_left" HorizontalAlign="Left" Font-Bold="true"
ForeColor="WhiteSmoke" />
</telerik:GridTemplateColumn>
Please do the needful for same.
Hi,
Does RadAsyncUpload have anything simillar to MaxUploadSize of Silverlight based control ?
I want to limit the users max 4GB of file. MaxFileSize is an integer allows me to limit max 2GB.
Can you tell me how can I come over these issues ?
Regards
Not sure why.
protected void Button1_Click(object sender, EventArgs e)
{
try
{
Executefirst();
Button1.Enabled = false; }
catch { }
finally { Executelast(); }
}
<
asp:Button
ID
=
"Button1"
runat
=
"server"
CssClass
=
"button"
input
=
""
OnClick
=
"Button1_Click"
Text
=
"Process Files"
AutoPostBack
=
"true"
type
=
"button"
/>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
OnItemDeleted
=
"RadGrid1_ItemDeleted"
OnItemInserted
=
"RadGrid1_ItemInserted"
OnItemUpdated
=
"RadGrid1_ItemUpdated"
OnPreRender
=
"RadGrid1_PreRender"
AllowAutomaticUpdates
=
"True"
AutoGenerateColumns
=
"False"
OnBatchEditCommand
=
"RadGrid1_BatchEditCommand"
DataSourceID
=
"SqlDataSource1"
GroupPanelPosition
=
"Top"
CellSpacing
=
"-1"
GridLines
=
"Both"
Width
=
"1200px"
Height
=
"400px"
AllowPaging
=
"True"
>
<
MasterTableView
CommandItemDisplay
=
"TopAndBottom"
DataKeyNames
=
"ID"
DataSourceID
=
"SqlDataSource1"
HorizontalAlign
=
"NotSet"
EditMode
=
"Batch"
AutoGenerateColumns
=
"False"
>
<
BatchEditingSettings
EditType
=
"Cell"
/>
<
CommandItemSettings
ShowAddNewRecordButton
=
"false"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ID"
FilterControlAltText
=
"Filter ID column"
HeaderText
=
"ID"
SortExpression
=
"ID"
UniqueName
=
"ID"
DataType
=
"System.Int32"
ReadOnly
=
"True"
Display
=
"False"
>
<
ColumnValidationSettings
>
<
ModelErrorMessage
Text
=
""
/>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Employee_code"
FilterControlAltText
=
"Filter Employee_code column"
HeaderText
=
"Employee_code"
SortExpression
=
"Employee_code"
UniqueName
=
"Employee_code"
>
<
ColumnValidationSettings
>
<
ModelErrorMessage
Text
=
""
/>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Client"
FilterControlAltText
=
"Filter Client column"
HeaderText
=
"Client"
SortExpression
=
"Client"
UniqueName
=
"Client"
>
<
ColumnValidationSettings
>
<
ModelErrorMessage
Text
=
""
/>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Matter"
FilterControlAltText
=
"Filter Matter column"
HeaderText
=
"Matter"
SortExpression
=
"Matter"
UniqueName
=
"Matter"
>
<
ColumnValidationSettings
>
<
ModelErrorMessage
Text
=
""
/>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"invalidemployee"
DataType
=
"System.Boolean"
FilterControlAltText
=
"Filter invalidemployee column"
HeaderText
=
"Invalid Employee"
SortExpression
=
"invalidemployee?"
UniqueName
=
"invalidemployee"
ReadOnly
=
"True"
>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"invalidmatter"
DataType
=
"System.Boolean"
FilterControlAltText
=
"Filter invalidmatter column"
HeaderText
=
"Invalid Client/Matter"
SortExpression
=
"invalidmatter?"
UniqueName
=
"invalidmatter"
ReadOnly
=
"True"
>
</
telerik:GridCheckBoxColumn
>
</
Columns
>
</
MasterTableView
>
<
PagerStyle
Mode
=
"NextPrev"
/>
</
telerik:RadGrid
>
<table cellspacing="4"> |
<tr> |
<td rowspan="2" style="vertical-align: top;"> |
Browse to an image and click to preview. |
<telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="500px" Height="300px" |
OnClientItemSelected="OnClientItemSelected" EnableOpenFile="true" OnClientFileOpen="LoadImageEditor" > |
<Configuration ViewPaths="~/images" UploadPaths="~/images" |
DeletePaths="~/images" MaxUploadFileSize="5242880" /> |
</telerik:RadFileExplorer> |
</td> |
<td> |
<fieldset style="width: 270px; height: 270px"> |
<telerik:dialogopener runat="server" id="DialogOpener1"></telerik:dialogopener> |
<legend>Preview</legend> |
<img id="pvwImage" src="" alt="" style="display: none; margin: 10px; width: 250px; |
height: 225px;" /> |
</fieldset> |
</td> |
</tr> |
</table> |
function OnClientItemSelected(sender, args) |
{ |
var pvwImage = $get("pvwImage"); |
var imageSrc = args.get_item().get_url(); |
if (imageSrc.match(/\.(gif|jpg)$/gi)) |
{ |
pvwImage.src = imageSrc; |
pvwImage.style.display = ""; |
} |
else |
{ |
pvwImage.src = imageSrc; |
pvwImage.style.display = "none"; |
} |
} |
function LoadImageEditor(sender, e) |
{ |
var pvwImage = $get("pvwImage"); |
if (!pvwImage.src.match(/\.(gif|jpg)$/gi)) return; |
var args = {}; |
args.imageSrc = e.get_item().get_path(); |
$find('<%= DialogOpener1.ClientID %>').open('ImageEditor', args); |
e.set_cancel(true); |
} |
function ImageEditor_Callback(sender, args) |
{ |
if(typeof(args) == "undefined") return; |
$find('<%= FileExplorer1.ClientID %>').refresh(); |
} |
ImageManagerDialogParameters imageEditorParameters = new ImageManagerDialogParameters(); |
imageEditorParameters.ViewPaths = new string[] { "~/images" }; |
imageEditorParameters.UploadPaths = new string[] { "~/images" }; |
imageEditorParameters.DeletePaths = new string[] { "~/images" }; |
imageEditorParameters.MaxUploadFileSize = 5000000; |
DialogDefinition imageEditor = new DialogDefinition(typeof(ImageEditorDialog), imageEditorParameters); |
imageEditor.Width = Unit.Pixel(832); |
imageEditor.Height = Unit.Pixel(520); |
imageEditor.ClientCallbackFunction = "ImageEditor_Callback"; |
DialogOpener1.DialogDefinitions.Add("ImageEditor", imageEditor); |
I use a FileExplorer to list images on a folder with its ExplorerMode="Thumbnails". The snapshot is as : http://i.imgur.com/cpKRY9j.png
<
telerik:RadFileExplorer
runat
=
"server"
ID
=
"RadFileExplorer2"
Height
=
"200px"
Width
=
"100%"
DisplayUpFolderItem
=
"true"
VisibleControls
=
"Toolbar,FileList,ContextMenus"
ExplorerMode
=
"Thumbnails"
EnableCreateNewFolder
=
"false"
AvailableFileListControls
=
"All"
>
<
Configuration
ViewPaths
=
"~/File/Product/5/Image/L"
UploadPaths
=
"~/File/Product/5/Image/L"
DeletePaths
=
"~/File/Product/5/Image/L"
AllowMultipleSelection
=
"true"
EnableAsyncUpload
=
"true"
MaxUploadFileSize
=
"20971520"
SearchPatterns
=
"*.jpg"
/>
</
telerik:RadFileExplorer
>
I want to swap two images by renaming its name. The rename operation is succeeded but its image is wrong.
The image seems to be caching and show the old image after ranamed.
These client functions have be tested such as clearFolderCache(), refresh(), loadFolder(path) on OnClientMove() client event (see official help).
Unfortunately, it's not working.
Please kindly give some advices for this, thanks.
I have a RadAsyncUpload , i just want to show an image on this button.Itried using
#AsyncUpload1 .ruButton
{
/*it is an example URL*/
background-image: url("../Images/eClose.png");
}
but no luck.
<telerik:RadAsyncUpload ID="AsyncUpload1" Width="5px" runat="server" Localization-Remove="" HideFileInput="true" Skin="Office2010Silver" OnClientFileUploaded="AsyncUpload1_OnClientFileUploaded"
MaxFileSize="10485760" OnFileUploaded="AsyncUpload1_FileUploaded" MultipleFileSelection="Disabled" OnClientValidationFailed="validationFailed"
AutoAddFileInputs="false" UploadedFilesRendering="BelowFileInput">
<Localization Select="Attach" />
</telerik:RadAsyncUpload>
Please help