Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
166 views
Hello,

I would like to add a simple combox (not telerik) with items in it as an additional field to the RadUpload control.

Here is my code:

<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MultiFileUploadPrototype._Default" %>
  
<%@ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
    <head id="Head1" runat="server">
        <link rel="stylesheet" type="text/css" href="styles.css" />
    </head>
    <body class="BODY">
          
        <form runat="server" id="mainForm" method="post">
  
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        
        <telerik:RadProgressManager ID="Radprogressmanager1" runat="server" />
  
        <table>
            <tr>
                <td class="TopCell" colspan="2">
                </td>
            </tr>
            <tr>
                <td class="BodyCell">
                    <div class="FileDetails">
                        <telerik:RadAsyncUpload runat="server" 
                                                id="RadAsyncUpload1"
                                                OnClientFileUploaded="onClientFileUploaded" 
                                                MultipleFileSelection="Automatic">
                        </telerik:RadAsyncUpload>
                    </div>
                </td>
                <td class="BodyCell RightCell">             
                    <div class="uploadedfiles">
                        <div>
                            <asp:Label ID="labelNoResults" runat="server" Visible="True">No uploaded files</asp:Label>
                            <asp:Repeater runat="server" ID="Repeater1">
                                <ItemTemplate>
                                    Category: <%#((Telerik.Web.UI.UploadedFile)Container.DataItem).GetFieldValue("TextBox").ToString()%>,<br />
                                    File name: <%# DataBinder.Eval(Container.DataItem, "FileName").ToString() %>,<br />
                                    File size: <%# DataBinder.Eval(Container.DataItem, "ContentLength").ToString() %><br />
                                    <br />
                                    <br />
                                </ItemTemplate>
                            </asp:Repeater>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="BottomCell" colspan="2">
                    <asp:Button ID="buttonSubmit" runat="server" CssClass="RadUploadButton" OnClick="buttonSubmit_Click" Text="Submit" />
                </td>
            </tr>
  
        </table>
              
            <telerik:RadProgressArea runat="server" ID="ProgressArea1"></telerik:RadProgressArea>
  
            <script type="text/javascript">
  
                var $ = $telerik.$;
  
                function onClientFileUploaded(radAsyncUpload, args) {
                    var $row = $(args.get_row());
                    var categoryInputName = radAsyncUpload.getAdditionalFieldID("TextBox");
                    var categoryInputType = "text";
                    var categoryInputID = categoryInputName;
                    var categoryInput = createInput(categoryInputType, categoryInputID, categoryInputName);
                    var categoryLabel = createLabel(categoryInputID, "Category");
  
//                    var subCategoryInputName = radAsyncUpload.getAdditionalFieldID("ComboBox");
//                    var subCategoryInputID = subCategoryInputName;
//                    var subCategoryInput = createComboBox(subCategoryInputID);
//                    var subCategoryLabel = createLabel(subCategoryInputID, "Category");
                      
                    $row.append("<br/>");
                    $row.append(categoryLabel);
                    $row.append(categoryInput);
//                    $row.append("<br/>");
//                    $row.append(subCategoryLabel);
//                    $row.append(subCategoryInput);
                }
  
                function createInput(inputType, inputID, inputName) {
                    var input = '<input type="' + inputType + '" id="' + inputID + '" name="' + inputName + '" />';
                    return input;
                }
  
//                function createComboBox(inputID) {
  
//                    var cmbBox = '<telerik:RadComboBox id="' + inputID + '" />';
//                    return cmbBox;
//                }
  
                function createLabel(forArrt, labelName) {
                    var label = '<label for=' + forArrt + '>' + labelName + ': </label>';
                    return label;
                }
  
                  
            </script>
             
        </form>
</body>
</html>

Please help.

Thanks,
Richard
Top achievements
Rank 1
 answered on 18 Jan 2012
1 answer
94 views
Hello,
i make a RadTreeView so:
<telerik:RadTreeView ID="RadTreeView1" Runat="server" DataFieldID="playerID"
                  DataFieldParentID="parentID" DataSourceID="ObjectDataSource1"
                  DataTextField="playerName" DataValueField="Route"
                  onnodedatabound="RadTreeView1_NodeDataBound" 
                    Width="100%" oncontextmenuitemclick="RadTreeView1_ContextMenuItemClick">

It works fine.
playerID - Primary key
parentID - for TreeView
playerName - String
Route - a value between 1 to 4 (1-Main, 2-Partial, ...)

Once a new record is inserted into the database, I get back the new playerID.

PlayerBLL players = new PlayerBLL();
        string text = SaveSQL.GetSaveSql(txtCreateMainRouteName.Text.Trim());       
 
        if (Page.IsValid)
        {
            PlayerID = players.InsertRouteAndStation(text, 1, null);
            RadTreeView1.DataSourceID = "ObjectDataSource1";
            RadTreeView1.DataBind();
        }

How can i select the new Node in the TreeView with the new playerID?

Best regards
Reiner
Bozhidar
Telerik team
 answered on 18 Jan 2012
5 answers
92 views
I'm using Telerik 2010.1.519.40 and webservices to populate a radtreeview.  However, in IE8 when I get a large amount of nodes the treeview will not render out the nodes.

Here is aspx file:

<telerik:RadTreeView ID="tvConfigArchive" runat="server" Skin="Vista" CheckBoxes="true">
      <CollapseAnimation Duration="100" Type="OutQuint" />
      <ExpandAnimation Duration="100" Type="OutQuart" />
      <WebServiceSettings Path="mws.asmx" Method="PopulateNodes" />
    </telerik:RadTreeView>

Once again, everything works fine in IE7,IE9,Chrome,Safari,etc...ONLY IE8 doesn't work?

Any ideas?
Bozhidar
Telerik team
 answered on 18 Jan 2012
1 answer
43 views
I am bulding a upload page, but I am confused as to the proper way to handle the contols. 
I dragged the Asyncupload control into my area on my page.  When I do that it looks as though I also need to
Add RadAjaxManager
Add RadScriptManager
Add RadStyleSheetManager
Add ScriptManager

When I put either of the the scriptManagers on the page I get an error that there is already a ScriptManager on the page.  And there is, it is used by the Tabstrip that I am using for navigation.

I add the other two managers and they don't seem to do anything.
I then add one of the Progress managers and it doesn't seem to do anything either.
The last control I have is the Submit button for Postback, when pressed the screen goes blank and the file selected goes
away with out any indication that an upload occured.  Since I am doing this all on my Laptop, where should I look for the uploaded file.

Bozhidar
Telerik team
 answered on 18 Jan 2012
5 answers
116 views
hi i need help in this case

i have a radcombobox in datalist and i need register this event:

var pane1 = splitter.getPaneById("<%= RadPane2.ClientID %>");
                var combo1 = $find("<%= ddltipoeval.ClientID %>");
                var paneElem1 = pane1.getContentElement();
                if (combo1 != null) { $telerik.addHandler(paneElem1, "scroll", function() { combo1.hideDropDown(); }, false); }

How do I find the radcombobox in this datalist to record the event I need?, Because I can not register as a normal radcombobox generating the error that I send attached

Ivana
Telerik team
 answered on 18 Jan 2012
6 answers
56 views
I have a very wide grid, which in Opera needs to have scrolling enabled

// Opera lops off Items grid
HttpBrowserCapabilities Lugs = Request.Browser;
if (Lugs.Type.StartsWith("Opera"))
{
    rgItems.ClientSettings.Scrolling.AllowScroll = true;
}

(all the other browsers are fine IE, Firefox, Chrome, Safari)
there is this huge whitespace in Opera which isn't in any of the other browsers above
Elliott
Top achievements
Rank 2
 answered on 18 Jan 2012
1 answer
75 views
Hi,
I am populating my scheduler at server side using a IEnumerable collection. I am binding all the appoinments on page load. Now when I navigate in between Views(Day, Week and Month), I want the navigation to happen at client side. i.e. no postbacks should happen.

Please let me know if this is possible.
Plamen
Telerik team
 answered on 18 Jan 2012
2 answers
117 views
I have a grid inside a user control.  The user control is recreated on postback.  After it is recreated the NeedDataSource always fires and the rebind reason is always "InitialLoad".  Also, none of my command handlers are called.  Am I not supposed to be recreating the control?

This is what I'm doing:

Creating the user control with the grid inside of it.
In the NeedDataSource, I bind it to the data (and I DON'T call DataBind or Rebind())
The grid shows up fine with all data in it.
Then when I press edit, it makes the fields editable.
Once I press update (which is next to "cancel"), it posts back, the user control (that contains the grid) is recreated by me in Page_Load, and NeedDataSource is called again.  The rebind reason is always "InitialLoad".

Notes:

No where am I turning off view state.
I'm using telerik version 2011.2.915.40.
The only place I'm bind to the grid is in NeedDataSource.

Any idea on what may be happening?  All I'm looking to do is having a grid that has items which I can edit.

Here is my grid definition:

<telerik:RadGrid ID="radGridEmails" runat="server" Skin="Transparent" AutoGenerateColumns="false">
                                  <MasterTableView EditMode="InPlace" >
                                           <Columns>
                                                                                <telerik:GridEditCommandColumn />
                                                                                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn DataField="Email" HeaderText="Email" UniqueName="Email"  >
                                                                                    </telerik:GridBoundColumn>
                                                                                     
                                                                                </Columns>
                                                                            </MasterTableView>
                                                                             
                                                                        </telerik:RadGrid>

More markup in the user control:
<telerik:RadAjaxManagerProxy ID="RadAjaxManager2" runat="server"  >
            <AjaxSettings >
                <telerik:AjaxSetting AjaxControlID="radGridEmails"  >
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="radGridEmails"  />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
</telerik:RadAjaxManagerProxy>


Code in aspx Page_Load:

if (ViewState["currentlyLoadedSection"] != null)
                {
                    panelMain.Controls.Clear();
 
                    string ctrl = (string)ViewState["currentlyLoadedSection"];
                    UserControl uc = (UserControl) GetControlByType(ctrl);
                    uc.ID = ctrl;
 
                    panelMain.Controls.Add(uc);
                    Trace.Write("recreated section " + ctrl);
                }

Code in user control:

protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
 
            radGridEmails.UpdateCommand += new Telerik.Web.UI.GridCommandEventHandler(radGridEmails_UpdateCommand);
            radGridEmails.InsertCommand += new Telerik.Web.UI.GridCommandEventHandler(radGridEmails_InsertCommand);
            radGridEmails.DeleteCommand += new Telerik.Web.UI.GridCommandEventHandler(radGridEmails_DeleteCommand);
            radGridEmails.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(radGridEmails_NeedDataSource);
        }
 
protected void radGridEmails_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
 
                radGridEmails.DataSource = emailAddresses;
                Trace.Write(e.RebindReason.ToString());
 
        }
ryan
Top achievements
Rank 1
 answered on 18 Jan 2012
5 answers
93 views
Hi,

stupid question ... How can I get the list of arguments available in a named/non anonymous function?
For example, I'm calling onClientXXXX = "MyJS" on a Telerik Control and I'd like to know what is available in the eventArgs ?

Also, when i go in specific RadControls Documentation, sometimes I can get from the examples ... the methods on the eventArgs... eg : args..set_cancel(), args.get_checked()....etc but where do I get an exhaustive list of available methods/properties of those respective Args... I can't seem to find them.
Thanks
Dobromir
Telerik team
 answered on 18 Jan 2012
0 answers
97 views
On December 29 2011 a vulnerability was found in the .NET Framework (http://support.microsoft.com/kb/2638420) basically the vulnerability is related with the number of parameters that an ASP.NET application can receive, the problem is that if you have a RadGrid with more than 10 rows and 15 RadTextBox per row every request will exceed the maximum amount of parameters.

The error that I got was:
Message: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

We can fix this issue using the information of the next link: http://support.microsoft.com/kb/2661403
To fix this issue we just need to set the maximum amount of parameters the page is allowed to get to something that we calculate covers our needs, in my case 3000:
<configuration>
  <appSettings>
    <add key="aspnet:MaxHttpCollectionKeys" value="3000" />
  </appSettings>
</configuration>

Regards
Raul
Top achievements
Rank 1
 asked on 18 Jan 2012
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?