Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
63 views
Hi,

I have the below itemcommand event of radgrid for copying a record based on ID.

if (e.CommandName == "Copy")
{
SHTemplateUI copyTemplate = new SHTemplateUI();
copyTemplate.CopyTemplateByIdUI(Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["StudentHistoryTemplateID"]));
this.LoadTemplateList();
}
This copies the record with the same name.

Now i want to make some changes.when i click on copy it should popup a radwindow and ask for the new file name.Once i enter the file name it should check whether the file name already exists.If not copy record with the new file name.

Can anybody help please? 
Arjun
Top achievements
Rank 1
 answered on 27 Jul 2011
1 answer
103 views
I have a drop down that holds around 6000 items. 

If EnableAutomaticLoadOnDemand is set to "True" OnSelectedIndexChanged for RadComboBox1.SelectedItem is NULL.
This is not the case if EnableAutomaticLoadOnDemand is set to "False"

Because I have so many items in my dropdown I have EnableAutomaticLoadOnDemand set to "True". Is this expected behavior? and if so how can I workaround this?

Thanks


Here are the properties I have set on the Combo-box.

<telerik:RadComboBox runat="server" ID="RadComboBox1" Height="400px"
                           Width="750px" MarkFirstMatch="true" DataSourceID="SessionDataSource1"
                           EnableLoadOnDemand="true" OnItemDataBound="RadComboBox1_ItemDataBound"
                           ShowMoreResultsBox="true" EnableVirtualScrolling="true" ItemsPerRequest="20"
                           EnableAutomaticLoadOnDemand="True" DataTextField="AssetDescription"
                           DataValueField="AssetDescription"
          style="margin-bottom: 0px" AutoPostBack="true" OnSelectedIndexChanged="RadComboBox1_IndexChanged"
          HighlightTemplatedItems="true"
          >
Dimitar Terziev
Telerik team
 answered on 27 Jul 2011
0 answers
71 views
Hi, I would like to ask your advice on the following question:

Which technology do you advice me to use Telerik or Silverlight for the web business applications where the number of web forms exceed 500? Thank you. Z.
Zura Chikhladze
Top achievements
Rank 1
 asked on 27 Jul 2011
1 answer
289 views
Hi,

I would like to use RadAsyncUpload control to upload multiple files to Amazon S3. I have included RadAsyncUpload control in my web application. I am able to select multiple files to upload and it uploads the selected files successfully to Amazon S3 ( it stores the files temporarily to temp folder) but when I try to download files from amazon S3, I get the corrupted file as the contenttype of the file never gets set properly. I am using the serverside event . "FileUploaded" to get the selected file's name, content type and content length. The content length is returned as an integer and when I convert that into the byte(), it gives me the wrong result. Here is my code:

 

 

 

Protected Sub RadAsyncUpload1_FileUploaded(ByVal sender As Object, ByVal e As Telerik.Web.UI.FileUploadedEventArgs) Handles RadAsyncUpload1.FileUploaded

        Dim counter As Integer = Session("counter")

        Dim newrow As DataRow = dt.NewRow
        Dim buffer As Byte() = New Byte(e.File.ContentLength - 1) {}

        If e.IsValid Then
            S3Conn = New AWSAuthConnection(S3AWSAccessKeyId, S3SecretAccessKeyId)
            counter = counter + 1

            If Not S3Conn Is Nothing Then
                S3Conn.createBucket(S3Bucket, Nothing)

                Dim metadata As SortedList = New SortedList()
                metadata.Add("filename", e.File.FileName)

                Dim s3key As String = "test/" & Session("dbid") & "_" & Session("recid") & "_" & CStr(counter)
                Dim obj As S3Object = New S3Object(buffer, metadata)

                Dim headers As New SortedList
                headers.Add("Content-Type", buffer)
                headers.Add("x-amz-acl", "public-read")

                S3Conn.put(S3Bucket, s3key, obj, headers)
            End If
            Session("counter") = counter
            S3Conn = Nothing
        End If

       
    End Sub

Peter Filipov
Telerik team
 answered on 27 Jul 2011
1 answer
118 views
Hi,

I have a RadTabStrip where I set the OnClientTabSelected as such:
<telerik:RadTabStrip ID="tabstrip1" runat="server" SelectedIndex="0" MultiPageID="multipage1" OnClientTabSelected="OnSelected">

The javascript implementation of the "OnSelected" method is the following:

function OnSelected(sender, args) {
   var ajaxManager = $find("<%= ajax1.ClientID %>");
   ajaxManager.ajaxRequest("test");
}

A very simple implementation.
My AjaxManager is implemented as such:

<telerik:RadAjaxManager ID="ajax1" runat="server" OnAjaxRequest="ajax1_AjaxRequest">
        <AjaxSettings>
            blablabla code here
        </AjaxSettings>
    </telerik:RadAjaxManager>

The serverside event of "AjaxRequest" has an empty implementation with a breakpoint inside.

When I execute this code and I change tabs, the javascript function is called correctly, but the serverside event is never called.

I tried the exact same code using a button instead of the tabstrip, and it works fine.

I tried it with the OnClientTabSelected event, and no dice either.
Is this a bug? Am I missing something?

Thank you.
Dimitar Terziev
Telerik team
 answered on 27 Jul 2011
10 answers
241 views
Hi All

I have been trying to control the scroll height of a grid using javascript,
I have encountered some problems as the grids are held within pageviews and the client height always returns 0 when in a container of some kind!!!
To work around this is used the row count of the grid to determine the scroll height:
function GridCreated(sender, args) {
                   var scrollArea = sender.GridDataDiv;
                   var masterTable = sender.get_masterTableView();                 
                   var itemCount = masterTable.get_dataItems().length;
                     
                   if (itemCount == 0) {
                       scrollArea.style.height = 17 + "px";
                   }else if (itemCount < 10) {
                       scrollArea.style.height = Math.round((itemCount * 24)) + "px"
                   }
                     
               }

However i am not 100% happy with this as if the row size increases in height the grid will not render correctly.
Is there a work around to get the client height within a page view/container.

Your help would be most appricated.

Best Regards

Cush
Cush
Top achievements
Rank 1
 answered on 27 Jul 2011
2 answers
142 views
Hi,

Here's the situation:

I have a search box in a master page. I expose the click event of the search button to my actual page that contains a radtabstrip control. The event then takes the keyword, and creates a new table for that keyword with the value "keyword" (let's call it SearchTab). This also means that I'm also creating a corresponding PageView that sends the keyword as a querystring to the page that's set in the "ContentURL" property, let's call it "SearchPage".

This web form contains a simple label, for which the value is retrieved from the querystring.

If the user puts a keyword and the tabstrip control does not contain a tab with the the value keyword, then I will create a new tab, otherwise, I will go and select the already existing tab.

On to the problem:

When I do a search for a new keyword, all works fine and dandy.
When I do a search for an already existing keyword, and I go to select the existing tab, nothing is displayed in the tab anymore. This keeps happening if i change tabs again and then go back to that same tab. I also tried w/ and w/o AutoPostback.

Here's the simple sample code that I'm using:

edit: I actually removed the code that sets the contentURL and replaced it by a simple calendar just to check if it might be related to that, and that's what I ended up copying. Sorry about the error, but it doesn't make a difference (just in case you're wondering).

if (RadTabStrip1.FindTabByValue(keyword) == null)
{
    // Create new tab and corresponding pageview and then select it.
   RadTab SearchTab = new RadTab(String.Format("Search: {0}", keyword), keyword);
   RadPageView SearchPage = new RadPageView();
 
   SearchPage.ID = keyword;
   SearchPage.Controls.Add(new Calendar());
   SearchTab.PageViewID = SearchPage.ID;
 
   RadMultiPage1.PageViews.Add(SearchPage);
   RadTabStrip1.Tabs.Add(SearchTab);
 
   RadTabStrip1.FindTabByValue(keyword).Selected = true;
   RadMultiPage1.FindPageViewByID(keyword).Selected = true;
}
else
{
    // Select the already existing tab
   RadTabStrip1.FindTabByValue(keyword).Selected = true;
   RadMultiPage.FindPageViewByID(keyword).Selected = true;
}


Any ideas on why this is not working?

Thank you.
Dimitar Terziev
Telerik team
 answered on 27 Jul 2011
2 answers
89 views

I need to use the DockToggleCommand in order for the user to switch how the user will view the data within the dock. (ie. Grid Format vs. Chart Format).  The command button would autopostback and switch views depending ont he State of the toggle button. How do I need to check for the state of the ToggleCommand server side so I can return the correct data format and change the command graphic to an appropriate icon?

The following code gets fired but always returns "Primary".

protected void RadDock_Command(object sender, DockCommandEventArgs e)
{
    
    if (e.Command.Name == "MyCustomCommand")
    {
        RadDock rd = (RadDock)sender; 
         DockToggleCommand toggleCommand = e.Command as DockToggleCommand;
        string strState = toggleCommand.State.ToString();
        TextBox1.Text = strState;
    }
      
      
}




Michael
Top achievements
Rank 1
 answered on 27 Jul 2011
7 answers
155 views
I am running version 2011.2.712.40 which I think is the latest version. When my project loads the first time I get the following error:

Microsoft JScript runtime error: Unable to get value of the property 'tHead': object is null or undefined

The highlighted code is in the RadTreeList prototype.
Telerik.Web.UI.RadTreeList.prototype=
...
_getTableHeaderRow:function(b){var c=null;
if(b.tHead){for(var a=0;
a<b.tHead.rows.length;
a++){if(b.tHead.rows[a]!=null){if(b.tHead.rows[a].cells[0]!=null){if(b.tHead.rows[a].cells[0].tagName!=null){if(b.tHead.rows[a].cells[0].tagName.toLowerCase()=="th"){c=b.tHead.rows[a];
break;
}}}}}}return c;
},
...

The declaration of the RadTreeList looks like this:

                <telerik:RadTreeList ID="myData" runat="server" DataSourceID="sqlData" DataKeyNames="ID" ParentDataKeyNames="ParentID" AutoGenerateColumns="false" OnDataBound="myData_DataBound">
                    <Columns>
...
                    </Columns>
 
                    <NoRecordsTemplate>
                        <span>There is no data selected!</span>
                    </NoRecordsTemplate>
                </telerik:RadTreeList>


Is there something I am missing that would cause this error as it does not happen on version 2011.1.519.40?
Martin
Telerik team
 answered on 27 Jul 2011
3 answers
80 views
Hello,

I'm wonder if there is any chart which behaves exactly as the the Pie chart but in different shap (Please view the attached image for illustration)?

Regards,
Bader
Evgenia
Telerik team
 answered on 27 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?