Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
105 views

Folks

Enviromnent: VS 2010 with RadControls for ASP.NET AJAX Q2 2011 SP1. I am using below link as a prototype for my project.

http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/gridattachmentcolumn/defaultcs.aspx

In my project, Download options works if they are not inside edit table. Below declarations works.

<div style="margin-bottom: 5px;">
        <telerik:RadComboBox ID="FileNamesComboBox1" runat="server" DataSourceID="SqlDataSource1"
            DataTextField="FileName" DataValueField="ID" CssClass="rgExpXLS">
        </telerik:RadComboBox>
                
        <asp:LinkButton ID="LinkButton_Dwnload" runat="server" OnClick="DownloadButton_Click"
            Text="DownLoad"></asp:LinkButton>
    </div>
 
 protected void DownloadButton_Click(object sender, EventArgs e)
 
         {
             int attachmentId = Int32.Parse(FileNamesComboBox1.SelectedValue);
             string fileName = FileNamesComboBox1.SelectedItem.Text;
 
             SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ConnectionString);
             SqlCommand comm = new SqlCommand("SELECT [BinaryData] FROM [FileData] WHERE [ID] = @ID", conn);
             comm.Parameters.Add(new SqlParameter("@ID", attachmentId));
 
             SqlDataAdapter adapter = new SqlDataAdapter(comm);
             DataSet data = new DataSet();
             adapter.Fill(data);
 
             byte[] binaryData = (byte[])data.Tables[0].Rows[0]["BinaryData"];
             int ii = attachmentId;
             Response.Clear();
             Response.ContentType = "application/octet-stream";
             Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
             Response.BinaryWrite(binaryData);
       
             Response.End();
              
         }

__________________________

But if the download options are within Edit Table, it does not work. Declaration and code:

<EditFormSettings EditFormType="Template">
                <FormTemplate>
                    <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
                        style="border-collapse: collapse; background: white;">
                        <tr>
                            <td>
                                <div style="margin-bottom: 5px;">
                                    <telerik:RadComboBox ID="FileNamesComboBox" runat="server" DataSourceID="SqlDataSource1"
                                        DataTextField="FileName" DataValueField="ID">
                                    </telerik:RadComboBox>
                                    <asp:LinkButton ID="LinkButtonEditTable" runat="server"
                                                      OnClick="DownloadLinkButtonEditTable_Click"
                                        Text="Download from Edit Table" Font-Size="Medium" ForeColor="Red"></asp:LinkButton>
                                </div>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
 
        protected void DownloadLinkButtonEditTable_Click(object sender, EventArgs e)
 
        {
             LinkButton btn = sender as LinkButton;
             if (btn.NamingContainer is GridEditableItem )
            {
              // Edit mode 
             GridEditableItem container = (GridEditableItem)btn.NamingContainer;
             RadComboBox SLurlComboBox = (RadComboBox)container.FindControl("FileNamesComboBox");
             int attachmentId = Int32.Parse(SLurlComboBox.SelectedValue);
             int ii = attachmentId;
              string fileName = SLurlComboBox.SelectedItem.Text;
             SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["TelerikConnectionString"].ConnectionString);
             SqlCommand comm = new SqlCommand("SELECT [BinaryData] FROM [FileData] WHERE [ID] = @ID", conn);
             comm.Parameters.Add(new SqlParameter("@ID", attachmentId));
 
             SqlDataAdapter adapter = new SqlDataAdapter(comm);
             DataSet data = new DataSet();
             adapter.Fill(data);
 
             byte[] binaryData = (byte[])data.Tables[0].Rows[0]["BinaryData"];
             Response.Clear();
             Response.ContentType = "application/octet-stream";
             Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
             Response.BinaryWrite(binaryData);
            Response.End();
            
            
        }

 

My project requires download be done within Edit Table. Attached is the error message while trying to download from Edit Table;

Any help will be appreciated. Thanks

gc_0620


Veli
Telerik team
 answered on 06 Oct 2011
1 answer
73 views
HI,
  I am trying to create a custom skin for the combobox control. I follow the instruction in "Tutorial: Creating a Custom Skin" and soon find out that the content in the telerik install directory (on my machine c:\program files (x86)\telerik\RadControls for ASP.NET AJAX Q2 2011\Skins) is so different.I am using telerik verion 2011.2.915.40. It says in the tutorial: copy files from \ComboBox directory to MySkin\ComboBox directory. According to the tutorial, these files include: default.gif, rcbArrowCell.gif, rcbmoreresults.gif, but I find on my machine these files under the combobox  directory: default.gif, rcbSprite.png, rcbSpriteIE6.png. There must be some problem with the version of skins, therefore the CSS selectors are different. And that is why I never succeed in creating a custom skin that works no matter what control I tried on. I wonder since the skin files installed on my machine must be the newest version since I use the most updated version of Ajax Controls,  the help documents and tutorials may not be new enough. Could you give some advice please. I've been spending too much time trying to plow into the issue.
thank you very much.
Dimitar Terziev
Telerik team
 answered on 06 Oct 2011
1 answer
285 views
Hi,

I have a radgrid and have a GridBoundColumn in it.
In edit mode whenever I type anything in the textbox I can see related entries from the past.
I want to disable the AutoComplete for the textbox/GridBoundColumn.
Can you please suggest how to do it?
A code sample would really help.

Thanks.
Jayesh Goyani
Top achievements
Rank 2
 answered on 06 Oct 2011
6 answers
185 views
A growing number of people (including us) have been using CSS3 (proprietary-only for now) rounded corners and some Telerik controls play nicely with it and some do not. It would be handy if you could start adding compatibility for these.

<Telerik:RadGrid ... style="-moz-border-radius: 3ex;-webkit-border-radius: 3ex;" /> is how I would define it (if you try it and view it in Chrome or FireFox, you'll see that it doesn't play very nicely).

Many thanks!!
-Shane
atul
Top achievements
Rank 1
 answered on 06 Oct 2011
3 answers
114 views

Hi everyone,
I've a small issue with my radgrids. This is the scenario

2 radgrids in the page: the first one with "temporary" records, while the second one with the "confirmed" records. In the first grid there's a commandbutton in the footer which allows the user to confirm, in one click, all the records. When the user confirms, then I need to refresh the 2 radgrids and I've achieved this task by writing this piece of code:

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadGridSales" />
        <telerik:AjaxUpdatedControl ControlID="RadGridSoldlConfirmed" />
    </UpdatedControls>
</telerik:AjaxSetting>

The problem is that if the user clicks on the Header of the first radgrid in order to sort the rows the 2 radgrid are being refreshed, while I need to refresh only the first one in this particular case.
The same if the user clicks on another commandbutton which allows it to delete a single row (so one commandbutton for each row) or the complete grid (another commandbutton in the footer).

So, there's a way to refresh the two radgrids only on certains condition?
I hope it's clear what I've just described and don't hesitate to ask for more clarifications.
Thank you in advance to everyone who would help me.

Regards
Iana Tsolova
Telerik team
 answered on 06 Oct 2011
2 answers
33 views
Hi,
I have a requirement to split the telerik grid and scroll the one section at run time.Is there any property or any way to do that???? 
Iana Tsolova
Telerik team
 answered on 06 Oct 2011
8 answers
144 views
In Firefox, when I try to click on the radnumerictextbox,
I cannot edit the text because the item is "selected" when I Single click on the text box.
The problem seems to appear if I EnableDragAndDrop.

URL: http://www.ximnet.com.my/telerik/test_listbox.aspx
Video Demo: http://www.ximnet.com.my/telerik/listbox_firefox_drag_drop_textbox.swf

Is there anything I can do to prevent this?

ASPX Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test_listbox.aspx.vb" Inherits="test_listbox" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server"><telerik:RadScriptManager ID="RSM" runat="server" />
    <telerik:RadListBox ID="RadListBox1" runat="server" AllowTransfer="true" EnableDragAndDrop="true" AutoPostBackOnTransfer="true"
                    Height="200px"  SelectionMode="Multiple" OnTransferred="RadListBox1_Transferred"
                    TransferToID="RadListBox2" Width="215px">
                    <ButtonSettings ShowTransferAll="false" VerticalAlign="Middle" />
                    <ItemTemplate>
                         
                        <span class="product-title">
                            <%# DataBinder.Eval(Container, "Text")%></span> <span class="bearing">1 bearing</span>
                    </ItemTemplate>
                    <Items>
                        <telerik:RadListBoxItem Text="Spinning Reel 1" Value="reel1_thumb.png" Price="99" Selected="true" />
                        <telerik:RadListBoxItem Text="Spinning Reel 2" Value="reel2_thumb.png" Price="199" />
                        <telerik:RadListBoxItem Text="Spinning Reel 3" Value="reel3_thumb.png" Price="99" />
                        <telerik:RadListBoxItem Text="Spinning Reel 4" Value="reel4_thumb.png" Price="299" />
                        <telerik:RadListBoxItem Text="Spinning Reel 5" Value="reel5_thumb.png" Price="199" />
                        <telerik:RadListBoxItem Text="Spinning Reel 6" Value="reel6_thumb.png" Price="99" />
                        <telerik:RadListBoxItem Text="Spinning Reel 7" Value="reel7_thumb.png" Price="299" />
                        <telerik:RadListBoxItem Text="Spinning Reel 8" Value="reel8_thumb.png" Price="199" />
                    </Items>
                </telerik:RadListBox>
                <telerik:RadListBox runat="server" EnableDragAndDrop="true" ID="RadListBox2" Height="200px" Width="270px"
                    SelectionMode="Multiple">
                    <ItemTemplate>
                         
                        <span class="detail-title">
                            <%# DataBinder.Eval(Container, "Text")%></span>
                        <ul class="details">
                            <li>
                                <label>
                                    Price:</label>
                                <span>
                                    <%# Convert.ToInt32(DataBinder.Eval(Container, "Attributes['Price']")).ToString("C0") %></span>
                            </li>
                            <li>
                                <label>
                                    Quantity:</label>
                                <telerik:RadNumericTextBox  runat="server" ID="QuantityTextBox" Width="40px" MinValue="1"
                                    MaxValue="10" ShowSpinButtons="true" Value="1" NumberFormat-DecimalDigits="0" />
                            </li>
                        </ul>
                    </ItemTemplate>
                    <Items>
                        <telerik:RadListBoxItem Text="Spinning Reel 9" Value="reel9.png" Price="99" />                   
                    </Items>
                </telerik:RadListBox>
    </form>
</body>
</html>


VB Code:
Imports Telerik.Web.UI
 
Partial Class test_listbox
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            RadListBox1.DataBind()
            RadListBox2.DataBind()
        End If
    End Sub
    Protected Sub RadListBox1_Transferred(ByVal sender As Object, ByVal e As RadListBoxTransferredEventArgs)
        For Each item As RadListBoxItem In e.Items
            'Update the image
            If e.SourceListBox Is RadListBox1 Then
                item.Value = item.Value.Replace("_thumb", "")
            Else
                item.Value = item.Value.Replace(".png", "_thumb.png")
            End If
 
            'Databind the item in order to evaluate the databinding expressions from the template
            item.DataBind()
        Next
    End Sub
End Class
Ricardo Pinto
Top achievements
Rank 1
 answered on 06 Oct 2011
10 answers
808 views
I've got a FileExplorer page that presents users with the files in their home directory using the Custom File Provider example. It works great. However, I'm doing checks to make sure that a person has logged in through our system to make sure they are authenticated so I can show them their home directory.

Since the FileExplorer uses callbacks, doing a response.redirect to the login page gives the "Response.Redirect cannot be called in a Page callback." error.

Originally, I was using this:

Response.Redirect(ConfigurationManager.AppSettings("SSOLogin") & "?Source=" & Request.Url.ToString)

I then changed it to:
If Page.IsCallback Then
   Response.Clear()
   Response.StatusCode = 302
   Response.Status = "302 Moved Temporarily"
   Response.RedirectLocation = ConfigurationManager.AppSettings("SSOLogin") & "?Source=" & Request.Url.ToString
   Response.End()
Else
   Response.Redirect(ConfigurationManager.AppSettings("SSOLogin") & "?Source=" & Request.Url.ToString)
End If
However, the FileExplorer doesn't appear to redirect correctly. The test I am performing is simply clicking on a folder in the left hand menu while being logged out. It correctly gives me back the 302 status code and the Location header, but FileExplorer just keeps spinning on the grid side as if it's going to do something. I'm doing most of the testing in IE9.

Any suggestions???
Adam
Dobromir
Telerik team
 answered on 05 Oct 2011
1 answer
112 views
Hello All,
I want my RadEditor to be without wrapping, as it wraps the text when reaches to the end but I want a horizontal scroll to continue writing on the same line.
I used new css with property

body
{
    word-wrap: normal;
    color: black;
    background-color: Olive;
    padding:3px;
    background-image: none;
    margin: 0px;
    text-align: left;
    background-color:Red;   
}
but it is not working.
Dobromir
Telerik team
 answered on 05 Oct 2011
3 answers
76 views
When one uses the RAD Editor's Media Manager to import new images or videos, they are provided with a popup that has editable text boxes for the media height and width.  These boxes are pre-populated with default values.

How do we change the default values that are pre-populated into those text boxes?  Is there a configuration file (like the tools_xml) or a property we can set on the RadEditor object to set default values of our own choosing?
Dobromir
Telerik team
 answered on 05 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?