Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
469 views
I am trying to get a simple AsyncUpload to show the image after it's uploaded to the temporary folder.  is there a way to do this and do you have any examples of this?
I am using the Q2 2010 version

I'm using this
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Thumbnail" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingExamplePanel">
    </telerik:RadAjaxLoadingPanel>
    <span class="info"></span>
    <div class="imageContainer">        
        <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server" Skin="Forest" TargetFolder="~/images/Boats" 
            OnClientFileUploaded="fileUploaded" OnClientDeleting="clientDeleting"
            onfileuploaded="RadAsyncUpload1_FileUploaded1">
        </telerik:RadAsyncUpload>   

        <telerik:RadBinaryImage ID="Thumbnail" runat="server" />




and











 protected void RadAsyncUpload1_FileUploaded1(object sender, FileUploadedEventArgs e)
        {
            Stream fileStream = e.File.InputStream;           
            byte[] imageData = new byte[e.File.InputStream.Length];
            fileStream.Read(imageData, 0, (int)e.File.InputStream.Length);
            Thumbnail.DataValue = imageData;            
            fileStream.Close();
        }

Boyan Dimitrov
Telerik team
 answered on 29 Apr 2014
2 answers
204 views
We have a RadMaskedTextbox that we use to populate a telephone number and from the image you can see the styling of the error message.  What we would really like is to format the error message to be similar to the error styling found with a RadTextBox (InputType="Email").  Is this possible? 

We have attempted to enter the phone number into a RadTextBox with InputType="Tel" but we lose the masked aspect of it and certainly doesn't look like a phone number.  We would also like to apply the same error look and feel to RadDatePicker.  Tried setting the InputType="Date" and it doesn't format the value or it doesn't pop-up the calendar item.

Is it possible to use the HTML5 "required" with any of the RadInput?

Any suggestions. 
Kostadin
Telerik team
 answered on 29 Apr 2014
1 answer
270 views
Hi,

I am writing a dialog that displays 4 tabs using a RadTabStrip/RadMultiPage. Inside each tab is a different control. (the dialog itself is wrapped in an AJAX panel) Inside the Boundary page I want to nest another radmultiview which can be toggled back and forth between two different views. The javascript that I've written which I would have thought would work is changing the selected index but it is not actually changing the view on the screen. Is there something wrong about what I'm doing?

Javascript to switch the view on the Boundary page (gets called from a button click from on the first of the two views on that page):

function SwitchToNew()
        {
            if (EditOffering._BoundaryMultiPageObj)
            {
                EditOffering._BoundaryMultiPageObj.set_selectedIndex(1);
            }
        }

How the Tabs/Views are set up:

               <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Default" MultiPageID="RadMultiPage1" Width="100%" SelectedIndex="0">
                    <Tabs>
                        <telerik:RadTab Text="Basic Info" PageViewID="BasicInfoPage" Value="basic" runat="server"></telerik:RadTab>
                        <telerik:RadTab Text="Types" PageViewID="TypesPage" Value="types" runat="server"></telerik:RadTab>
                        <telerik:RadTab Text="Boundary" Value="boundaryMain" PageViewID="BoundaryPage" runat="server"></telerik:RadTab>
                        <telerik:RadTab Text="(Optional) Walkin Location" Value="walkin" PageViewID="WalkinPage" runat="server"></telerik:RadTab>
                    </Tabs>
                </telerik:RadTabStrip>
                <telerik:RadMultiPage runat="server" ID="RadMultiPage1">
                    <telerik:RadPageView runat="server" ID="BasicInfoPage">
                        <BcgAlert:InfoTab runat="server" ID="InfoTab1" />
                    </telerik:RadPageView>
                    <telerik:RadPageView runat="server" ID="TypesPage">
                        <BcgAlert:TypesTab runat="server" ID="TypesTab1" />
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="BoundaryPage" runat="server">
                        <telerik:RadMultiPage runat="server" ID="BoundaryMultiPage" SelectedIndex="0">
                            <telerik:RadPageView runat="server" ID="ExistingBoundaryPage">
                                <BcgAlert:ExistingBoundaryTab runat="server" ID="ExistingBoundaryTab1" />
                            </telerik:RadPageView>
                            <telerik:RadPageView runat="server" ID="NewBoundaryPage">
                                <BcgAlert:NewBoundaryTab runat="server" ID="BoundaryTab1" />
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="WalkinPage" runat="server">
                        <BcgAlert:WalkinTab runat="server" ID="WalkinTab1" />
                    </telerik:RadPageView>
                </telerik:RadMultiPage>





Boyan Dimitrov
Telerik team
 answered on 29 Apr 2014
1 answer
104 views
Hi.I am using Telerik version Q12013.Any one please help me to draw chart like this using C# code.
I have to generate the chart at runtime,by binding datasource .
Danail Vasilev
Telerik team
 answered on 29 Apr 2014
1 answer
104 views
How to draw the spline chart (line appearnce-smooth) in Q12013 using C# code 
Danail Vasilev
Telerik team
 answered on 29 Apr 2014
3 answers
161 views
Problem is I am Adding a AddNew link button in CommandItem Template So Export buttons not  visible 

Then using the following code works Crome and IE but firefox is showing those buttons again any suggestions !!!!

 <CommandItemTemplate>
  <asp:LinkButton ID="lnkAdd" runat="server" Text="Add New" CommandName="AddNew"></asp:LinkButton>
<asp:Button ID="expbexcel" CommandName="ExportToExcel" CssClass="rgExpXLS" runat="server" />   
 <asp:Button ID="expbdoc" CommandName="ExportToWord" CssClass="rgExpDOC" runat="server" />    
<asp:Button ID="expbpdf" CommandName="ExportToPdf" CssClass="rgExpPDF" runat="server" />   
 <asp:Button ID="expbcsv" CommandName="ExportToCsv" CssClass="rgExpCSV" runat="server" />
 </CommandItemTemplate>

Thanks 
SR.
Shinu
Top achievements
Rank 2
 answered on 29 Apr 2014
1 answer
186 views
I'm using RadGrid in ASPX, .net 4.5. The data comes up and displays in my grid fine, but I cannot update, insert, or delete records. I have followed the sample version as closely as I can:

http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx

When I try to modify data in the grid, then hit Save, the grid reloads and the data is unchanged.

Originally I had the grid wrapped in ajax panel, but when these problems occurred, I removed it. That made not much difference; though when I was using ajax panel, often times clicking the Save icon did absolutely nothing. Or appeared to do nothing. So with that gone, the page/grid does normal postbacks EXCEPT that none of my event handlers are being called. Page_Load gets called, but nothing else (for example RadGrid1_BatchEditCommand, RadGrid1_ItemUpdated). It seems these should be getting called. 

ASPX:

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" /><br>                <telerik:RadListBox runat="server" ID="SavedChangesList" Width="600px" Height="200px" Visible="false"></telerik:RadListBox><br>                <telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"<br>                    AllowAutomaticInserts="True" PageSize="10" Skin="Default" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"<br>                    OnItemUpdated="RadGrid1_ItemUpdated" OnPreRender="RadGrid1_PreRender" AllowAutomaticUpdates="True" AllowPaging="True"<br>                    AutoGenerateColumns="False" Width="1000px" OnBatchEditCommand="RadGrid1_BatchEditCommand" DataSourceID="sqlContractMatrix"><br>                    <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="ID" DataSourceID="sqlContractMatrix" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False"><br>                        <BatchEditingSettings EditType="Cell" /><br>                        <SortExpressions><br>                            <telerik:GridSortExpression FieldName="SiteID,ProductID" SortOrder="Descending" /><br>                        </SortExpressions><br>                        <Columns><br>                            <telerik:GridTemplateColumn HeaderText="Site" HeaderStyle-Width="150px" UniqueName="SiteID" DataField="SiteID"><br>                                <ItemTemplate><br>                                    <%# Eval("SiteName") %><br>                                </ItemTemplate><br>                                <EditItemTemplate><br>                                    <telerik:RadDropDownList runat="server" ID="ddlSites" AppendDataBoundItems="true" DataValueField="SiteID" DataTextField="SiteName" DataSourceID="sqlSites"><br>                                            <br>                                    </telerik:RadDropDownList><br>                                </EditItemTemplate><br>                            </telerik:GridTemplateColumn><br> <br>                            <telerik:GridTemplateColumn HeaderText="Product" HeaderStyle-Width="150px" UniqueName="ProductID" DataField="ProductID"><br>                                <ItemTemplate><br>                                    <%# Eval("ProductName") %><br>                                </ItemTemplate><br>                                <EditItemTemplate><br>                                    <telerik:RadDropDownList runat="server" ID="ddlProducts" DropDownWidth="250" DropDownHeight="400" DefaultMessage="Product" AppendDataBoundItems="true" DataValueField="ProductID" DataTextField="ProductName" DataSourceID="sqlProducts"><br>                                            <br>                                    </telerik:RadDropDownList><br>                                </EditItemTemplate><br>                            </telerik:GridTemplateColumn><br>                                <br>                            <telerik:GridAttachmentColumn DataSourceID="sqlContractMatrix" MaxFileSize="1048576" HeaderStyle-Width="250px"<br>                                EditFormHeaderTextFormat="Upload File:" HeaderText="HTML Template" AttachmentDataField="BinaryData"<br>                                AttachmentKeyFields="ID" FileNameTextField="TemplateFileBinary" DataTextField="TemplateFileBinary"<br>                                UniqueName="TemplateFileBinary"><br>                            </telerik:GridAttachmentColumn><br> <br>                            <%--<br>                            <telerik:GridBoundColumn DataField="TemplateFile" HeaderStyle-Width="200px" HeaderText="Template"<br>                                SortExpression="TemplateFile" UniqueName="TemplateFile"><br>                            </telerik:GridBoundColumn><br>                            --%><br> <br>                            <telerik:GridBoundColumn DataField="PDFName" HeaderStyle-Width="200px" HeaderText="PDF Name"<br>                                SortExpression="PDFName" UniqueName="PDFName"><br>                            </telerik:GridBoundColumn><br>                            <telerik:GridButtonColumn ConfirmText="Delete this record?" ConfirmDialogType="RadWindow"<br>                                ConfirmTitle="Delete" HeaderText="Delete" HeaderStyle-Width="50px" ButtonType="ImageButton"<br>                                CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"><br>                            </telerik:GridButtonColumn><br>                        </Columns><br>                    </MasterTableView><br>                </telerik:RadGrid><br>                <asp:SqlDataSource ID="sqlContractMatrix" runat="server" ConnectionString="<%$ ConnectionStrings:FitTrack %>"<br>                    DeleteCommand="DELETE FROM ContractMatrix WHERE ID = @ID" <br>                    InsertCommand="INSERT INTO ContractMatrix (SiteID, ProductID, TemplateFile, PDFName, LastModifiedDate, LastModifiedByID) VALUES (@SiteID, @ProductID, @TemplateFile, @PDFName, @LastModifiedDate, @LastModifiedByID)"<br>                    UpdateCommand="UPDATE ContractMatrix SET SiteID = @SiteID, ProductID = @ProductID, TemplateFile = @TemplateFile, PDFName = @PDFName, LastModifiedDate = GETDATE(), LastModifiedByID = @LastModifiedByID WHERE ID = @ID"><br>                    <DeleteParameters><br>                        <asp:Parameter Name="ID" Type="Int32"></asp:Parameter><br>                    </DeleteParameters><br>                    <InsertParameters><br>                        <asp:Parameter Name="SiteID" Type="Int32"></asp:Parameter><br>                        <asp:Parameter Name="ProductID" Type="Int32"></asp:Parameter><br>                        <asp:Parameter Name="TemplateFile" Type="String"></asp:Parameter><br>                        <asp:Parameter Name="PDFName" Type="String"></asp:Parameter><br>                    </InsertParameters><br>                    <UpdateParameters><br>                        <asp:Parameter Name="SiteID" Type="Int32"></asp:Parameter><br>                        <asp:Parameter Name="ProductID" Type="Int32"></asp:Parameter><br>                        <asp:Parameter Name="TemplateFile" Type="String"></asp:Parameter><br>                        <asp:Parameter Name="PDFName" Type="String"></asp:Parameter><br>                        <asp:Parameter Name="ID" Type="Int32"></asp:Parameter><br>                    </UpdateParameters><br>                </asp:SqlDataSource><br>                <br>                <!-- SQL data sources for various lookup tables --><br>                <asp:SqlDataSource ID="sqlSites" runat="server" ConnectionString="<%$ ConnectionStrings:FitTrack %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT SiteID, SiteName FROM gym.Site ORDER BY SiteID"></asp:SqlDataSource><br>                <asp:SqlDataSource ID="sqlProducts" runat="server" ConnectionString="<%$ ConnectionStrings:FitTrack %>" ProviderName="System.Data.SqlClient"></asp:SqlDataSource>

C#: 
protected void RadGrid1_BatchEditCommand(object sender, Telerik.Web.UI.GridBatchEditingEventArgs e)<br>        {<br>            SavedChangesList.Visible = true;<br>        }<br> <br>        protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)<br>        {<br>            GridEditableItem item = (GridEditableItem)e.Item;<br>            string id = item.GetDataKeyValue("ID").ToString();<br>            if (e.Exception != null)<br>            {<br>                e.KeepInEditMode = true;<br>                e.ExceptionHandled = true;<br>                NotifyUser("Record with ID " + id + " cannot be updated. Reason: " + e.Exception.Message);<br>            }<br>            else<br>            {<br>                NotifyUser("Record with ID " + id + " is updated!");<br>            }<br>        }<br> <br>        protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)<br>        {<br>            if (e.Exception != null)<br>            {<br>                e.ExceptionHandled = true;<br>                NotifyUser("Product cannot be inserted. Reason: " + e.Exception.Message);<br>            }<br>            else<br>            {<br>                NotifyUser("New product is inserted!");<br>            }<br>        }<br> <br>        protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)<br>        {<br>            GridDataItem dataItem = (GridDataItem)e.Item;<br>            string id = dataItem.GetDataKeyValue("ID").ToString();<br>            if (e.Exception != null)<br>            {<br>                e.ExceptionHandled = true;<br>                NotifyUser("Product with ID " + id + " cannot be deleted. Reason: " + e.Exception.Message);<br>            }<br>            else<br>            {<br>                NotifyUser("Product with ID " + id + " is deleted!");<br>            }<br> <br>        }


Please help. Why are the data updates not occurring?
Princy
Top achievements
Rank 2
 answered on 29 Apr 2014
1 answer
120 views
I have a RadTileList that includes Tiles in the ASPX markup as well as others that are dynamically created on the server (not databound).

Why can't I remove a RadTile that was defined in the ASPX markup from the code behind?  in the snippet below - the tile reference is found - but .Remove does nothing.  

Dim tile = RadTileList1.GetAllTiles.Find(Function(x) x.ID = item.ID)
If tile IsNot Nothing Then
    RadTileList1.GetAllTiles.Remove(tile)
End If
Marin Bratanov
Telerik team
 answered on 29 Apr 2014
1 answer
299 views
Could someone tell me which version was the Resize option added to the textbox?

We have a system that is currently still using Q3 2010 (outside of our control) and while I can add it to the html without it causing an error, it doesn't actually do anything so I'm guessing it was added after this version and just want confirmation....

Thanks
Shinu
Top achievements
Rank 2
 answered on 29 Apr 2014
1 answer
742 views
Hello,

I want to add some images to my database to a binary data field.
But the image sould always the same size. But the original file can be different.
When i add the fila via Async upload, the file must first resize to my dimensions and fit the longer edge. Then the crop tool should run automatically and appears on imageEditor (no other tools) and the user sould set the crop the image by the correct aspect ratio.

At the final i want it save as a binary file to my database.

What i want is all images in my database sould 800 px x 300 px. But this is not a most common used ratio. Images must resized and cropped. This is ok but the image must always cropped by the user, because it can crop a false side if i make this automatically.

I dont want a tool inside my imageEditor. The crop will run after the upload and users will crop the image only at 800x300 and click a button to finish the proces.

So how can i make this? Is there a sample that i can use it?

Slav
Telerik team
 answered on 29 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?