Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
45 views
Hi there,

 In the FormCreated event of RadScheduler I added a event handler for ResourceType combo box. Here is the code.
What I am trying to achieve is that when I select an item in the combo box it will automatically populate other textbox on the Advanced form.
protected void rsSchedules_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
   {
       if ((e.Container.Mode == SchedulerFormMode.AdvancedEdit) || (e.Container.Mode == SchedulerFormMode.AdvancedInsert))
       {
          
 
           RadComboBox cboItinerary = (RadComboBox)e.Container.FindControl("ResItinerary");
           cboItinerary.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(cboItinerary_SelectedIndexChanged);
           cboItinerary.AutoPostBack = true;
 
           
       }
   }


 This issue is that when I use SelectedValue to retrieve the value in SelectedIndexChange event it returned something like /wECAQ==
I am not sure where this value from. There is nothing wrong with the data binding. The expected value should be integer.

I also tried to use client API to retrieve the value. I got same result.

How could I retrieve the value from the combo box?

Thanks





























Plamen
Telerik team
 answered on 26 Apr 2012
3 answers
125 views

Hi,

I'm trying to use chart Zoom event in Asp.net. How can I obtain x-y values from Chart Zoom event args ?

First of all I  bind a data to my chart after user zooms, according to the zoom args I want to bind another data source to chart because of performance issue. How can I manage my plan ?

tnx.

Petar Marchev
Telerik team
 answered on 26 Apr 2012
1 answer
233 views
Hi,

I am trying to filter the allowed files to upload depending on the media library that has been selected. (docs, images, videos, etc)

I have the radasyncupload control in a modal window. Switching between media categories is done with a button for each cat. I tried to change the AllowedFileExtensions property there for each media type but it didn't work. Should I set it somewhere else?

Also, how could I change FileFilter description and extensions in codebehind? is it even possible? i tried using Eval("desc/ext") but I have must missed something. 


<FileFilters>
  <telerik:FileFilter Description="Images(jpg;jpeg;png;gif)" Extensions="jpg,jpeg,png,gif" />
</FileFilters>

Any suggestions would be appreciated it. I am thinking in doing a radasyncupload control for each media type and just hide/display accordingly but I would like to avoid that.

Thanks
Dimitar Terziev
Telerik team
 answered on 26 Apr 2012
1 answer
164 views
Hi,

      I have a ComboBox in my page. In this I would like to bold the font of some items using javascript on
OnClientDropDownOpening event.

Thanks 
Velkumar.
Shinu
Top achievements
Rank 2
 answered on 26 Apr 2012
2 answers
128 views
hi guys

I saw the below link

http://www.telerik.com/community/forums/aspnet/combobox/placing-single-treeview-inside-combobox-dropdown.aspx

and took the code it was in older version and i replaced to newer version and when i run the code
i am getting script error
Code Below:

aspx page
<script type="text/javascript">
        var allowClose = false;
        var comboText = null;
        var comboValue = null;

        function OnClientDropDownClosing(combobox) {
            if (allowClose == true) {
                allowClose = false;

                return true;
            }
            else {
                return false;
            }
        }

        function allowCBClose(allow) {

            allowClose = allow;
        }

        function ProcessClientClick(node) {
            alert(node.Text);
            allowCBClose(true);
        }



        function OnClientItemsRequested(combobox) {
            //var tree = document.getElementById(combobox.Items[0].Attributes.TreeID);
            var treeView = eval(combobox.Items[0].Attributes.TreeID);
            treeView.OnInit();

            //--- Doesn't work--
            //tree.OnInit();

        }
        
</script>
<div onmousedown="allowCBClose(true);">
    <telerik:RadComboBox
        Width="200px"
        DropDownWidth="200px"
        Height="200px"
        ID="ProductOptionComboBox"
        
        Runat="server"
        OnClientDropDownClosing="OnClientDropDownClosing"
        AllowCustomText="true"
        EnableLoadOnDemand="true"
        OnItemsRequested="ItemsRequested"
        OnClientItemsRequested="OnClientItemsRequested"
        >
        <ItemTemplate>
            <div onmouseup="allowCBClose(false);">
                <telerik:RadTreeView
                    ID="ProductOptionTree"
                    runat="server"
                    Height="350"
                    Width="100%"
                    
                    AutoPostBack="false"
                    BeforeClientClick="ProcessClientClick"
                    >
                </telerik:RadTreeView>
            </div>
        </ItemTemplate>
    </telerik:RadComboBox>
    </div>

C# Code
protected void Page_Load(object sender, EventArgs e)
        {

            if (ProductOptionComboBox.Items.Count == 0 )
            {
                Populate();
            }
        }

        private void Populate()
        {
            if (ProductOptionComboBox.Items.Count == 0)
            {
                ProductOptionComboBox.Items.Add(new RadComboBoxItem());
            }

            RadTreeView ProductOptionTree = (RadTreeView)ProductOptionComboBox.Items[0].FindControl("ProductOptionTree");
            ProductOptionTree.Nodes.Clear();

            // communicate the tree's clientside via the attributes collection
            ProductOptionComboBox.Items[0].Attributes["TreeID"] = ProductOptionTree.ClientID;

            RadTreeNode node = new RadTreeNode("ParentNode1");
            node.Nodes.Add(new RadTreeNode("ChildNode1"));
            ProductOptionTree.Nodes.Add(node);

            node = new RadTreeNode("ParentNode2");
            node.Nodes.Add(new RadTreeNode("ChildNode2"));
            ProductOptionTree.Nodes.Add(node);
        }

        protected void ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
        {
            Populate();
        }

Attached the Error Image

Karthik.K
Karthik Kantharaj
Top achievements
Rank 1
 answered on 26 Apr 2012
1 answer
317 views
We are trying to upload and process some excel files; there is no need to keep the file, so ideally we'd just like to keep them in memory and do what is necessary without storing the file. We are using the Excel Data Reader, and that part of it is working correctly if we use the TargetFolder setting and save the file. However, if we try to process using only the filestream, there are problems.

The documentation says that the InputStream property returns a system.io.stream object, which is what the reader expects, but when we try to load that object into the excel data reader, the error is;

"Unable to cast object of type 'System.Web.HttpInputStream' to type 'System.IO.FileStream'."

The code is
Dim stream As FileStream = lsFile.InputStream


We've tried casting the inputstream to a system.io.stream object directly, but that also throws an error. The code is using an external class to do the processing, since it's something that is done from various places within the application.

Any suggestions? Anyone out there used RadUpload and processed Excel files on the server in this way?
Bozhidar
Telerik team
 answered on 26 Apr 2012
1 answer
353 views
Hi,

   I am using user control contains rad grid and which is placed in rad window <ContentTemplate> and i have asp button on click of button at server side i need to show rad window pop up and which should contain the user control inside it..and after selecting the row from user control i need to close the pop up...how can i do it...

the code is follows.
<asp:Button ID="btnRole" LabelNumber="BTSA10001" runat="server" OnClick="btnRole_Click" />

 <telerik:radwindow id="rwCodeLabelWindow" runat="server" skin="Office2007" behaviors="Close"
        modal="true" height="550px" width="800px" title="Code and Label">
         <ContentTemplate>
        <uc:CodeLabelPopUp ID="ucCodeLabelPopUp" runat="server" />
        </ContentTemplate>
    </telerik:radwindow>


Please let me know.
rdmptn
Top achievements
Rank 1
 answered on 26 Apr 2012
5 answers
246 views
how apply right-to-left direction for  pagerstyle of TreeList?
Tsvetina
Telerik team
 answered on 26 Apr 2012
1 answer
65 views

Hello,

When I have one RadUpload, it's work :

<table> 
     <tr> 
          <td class="label_up" colspan="2"><asp:Label ID="LBL_image" runat="server" CssClass="bold">Image : </asp:Label></td> 
     </tr> 
     <tr> 
          <td></td> 
          <td style="white-space:nowrap;"
               <asp:Label runat="server" ID="info_image"></asp:Label> 
          </td> 
     </tr> 
     <tr> 
          <td class="width110"
               <asp:Image runat="server" ID="Imagea" ImageUrl="./images/7.gif"></asp:Image> 
          </td> 
          <td> 
               <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None" 
               overwriteexistingfiles="False" targetfolder="~/images/données" 
               Skin="Vista" InputSize="20" MaxFileInputsCount="1" InitialFileInputsCount="1"
               </telerik:RadUpload> 
    
               <telerik:RadButton ID="SubmitButton" runat="server" Text="Upload image" onclick="SubmitButton_Click"
               </telerik:RadButton> 
          </td> 
     </tr> 
     <tr> 
          <td></td> 
          <td> 
               <telerik:RadButton ID="DeleteButton" runat="server" OnClick="DeleteImage" ClientIDMode="Static"
               </telerik:RadButton> 
          </td> 
     </tr> 
</table>

But, if I add an another RadUpload, the fist one dissapears on the client page. :-(

<table>  
     <tr>  
          <td class="label_up" colspan="2"><asp:Label ID="LBL_image" runat="server" CssClass="bold">Image : </asp:Label></td>  
     </tr>  
     <tr>  
          <td></td>  
          <td style="white-space:nowrap;">  
               <asp:Label runat="server" ID="info_image"></asp:Label>  
          </td>  
     </tr>  
     <tr>  
          <td class="width110">  
               <asp:Image runat="server" ID="Imagea" ImageUrl="./images/7.gif"></asp:Image>  
          </td>  
          <td>  
               <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None" 
               overwriteexistingfiles="False" targetfolder="~/images/données" 
               Skin="Vista" InputSize="20" MaxFileInputsCount="1" InitialFileInputsCount="1">  
               </telerik:RadUpload>  
      
               <telerik:RadButton ID="SubmitButton" runat="server" Text="Upload image" onclick="SubmitButton_Click">  
               </telerik:RadButton>  
          </td>  
     </tr>  
     <tr>  
          <td></td>  
          <td>  
               <telerik:RadButton ID="DeleteButton" runat="server" OnClick="DeleteImage" ClientIDMode="Static">  
               </telerik:RadButton>  
          </td>  
     </tr>
     <tr>
          <td class="label_up" colspan="2">
               <asp:Label ID="LBL_documents" runat="server" CssClass="bold">Documents :</asp:Label>
          </td>
     </tr>
     <tr>
          <td colspan="2">
               <asp:Label runat="server" ID="Documents"></asp:Label>
          </td>
     </tr>
     <tr>
          <td>
               <telerik:RadUpload ID="RadUpload2" runat="server" />                        
          </td>
          <td>
               <asp:Repeater ID="repeaterResults" runat="server" Visible="False">
                    <HeaderTemplate>
                         <div class="title">Uploaded files in the target folder:</div>
                    </HeaderTemplate>
                    <ItemTemplate>
                         <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                         <%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>
                         <br />
                    </ItemTemplate>
               </asp:Repeater>
          </td>
     </tr>
     <tr>
          <td>
               <telerik:RadButton runat="server" ID="RadButton1" Text="Upload files" onclick="SubmitFileButton_Click" />
          </td>
     </tr>
</table> 

Have you an idea?
Plamen
Telerik team
 answered on 26 Apr 2012
3 answers
362 views
Hi, how would you go about adding a css class to any top level checkboxes?

Regards,
-DJ-
Bozhidar
Telerik team
 answered on 26 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?