Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
103 views
I'm working with a simple handler derived from AsyncUpload handler, whose entire code is below. In this code, the attempt to read the temp file created by the call to base.Process() as an image fails intermittently. When this fails, the file exists, the file stream can be opened, but the FileStream.Length is 0. Is there any way to work around this? I would expect the temp file to be accessible after the call to base.Process(). If it helps, this appears to only happen after I have already uploaded a file within the last few minutes.

public class MyAsyncImageUpload : AsyncUploadHandler
{
    protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
    {
        var result =base.Process(file, context, configuration, tempFileName);
         
        int imageWidth = 0;
        int imageHeight = 0;
        var imageExists = File.Exists(context.Server.MapPath("~/App_Data/RadUploadTemp" + "/" + tempFileName));
        using (var fs = new FileStream(context.Server.MapPath("~/App_Data/RadUploadTemp" + "/" + tempFileName), FileMode.Open, FileAccess.Read))
        {
            var imageByteSize = fs.Length;
            using (var image = Image.FromStream(fs))
            {
                imageWidth = image.Size.Width;
                imageHeight = image.Size.Height;
            }
        }
 
           return result;
    }
}
  
JohnH
Top achievements
Rank 1
 asked on 17 Oct 2012
4 answers
217 views
Hello All, 

I am using a grid with 'GridClientSelectColumn' to display a column of checkboxes. Also this displays a checkbox on the header which is again useful to me. I want to call a javascript function on the individual checkboxes . I would also like to call another javascript function when the checkbox in header is checked\unchecked. 

I could not find any help about how to do this. It might be an easy thing and I am missing something .

Please advise.
Thanks in advance. 

Regards
Yogendra
Yogendra
Top achievements
Rank 1
 answered on 17 Oct 2012
5 answers
255 views

Hi,

I'm attempting to show the end user some feedback on the items they've checked in a combobox and I want to send the checkedItems to a ListBox underneath showing what the user has checked. I'm having no luck with what I am trying.

Something like this:

ListBox1.Items.Add(ComboBox.CheckedItems.ToString());
Nencho
Telerik team
 answered on 17 Oct 2012
1 answer
165 views
Hi, 

I use following combobox

<telerik:RadComboBox ID="rcbDaysOfWeek" runat="server" Width="150px"
    CheckBoxes="true" EnableCheckAllItemsCheckBox="true"
    EmptyMessage="No day selected">
    <Localization AllItemsCheckedString="All days" CheckAllString="Select all"  />
    <Items>
        <telerik:RadComboBoxItem Text="Monday" Value="1" Checked="true" />
        <telerik:RadComboBoxItem Text="Tuesday" Value="2" Checked="true" />
        <telerik:RadComboBoxItem Text="Wednesday" Value="3" Checked="true" />
        <telerik:RadComboBoxItem Text="Thursday" Value="4" Checked="true" />
        <telerik:RadComboBoxItem Text="Friday" Value="5" Checked="true" />
        <telerik:RadComboBoxItem Text="Saturday" Value="6" Checked="true" />
        <telerik:RadComboBoxItem Text="Sunday" Value="7" Checked="true" />
    </Items>
</telerik:RadComboBox>

Could you advice me how can I manage to have my custom message if I select 4 days - I want to have "1347" instead of "4 items checked". I want to have values of those selected checkboxed written in the message... 

Thanks a lot... 
Kalina
Telerik team
 answered on 17 Oct 2012
4 answers
135 views
I have created and added tabs in code behind, yet the javascript on tab selected does not show the attribute.

Here is my code:
            var tabPanel = new RadTabStrip();
            tabPanel.OnClientTabSelected = "onTabSelected";
            var newTab = new RadTab() {Text = "All", Selected = true};
            newTab.Attributes["type"] =  "0";
            tabPanel.Tabs.Add(newTab);
 
....
....
            foreach (var department in deparmentsDt)
            {
                var newTab = new RadTab() {Text = department.strDepartmentGroup_Name};
                newTab.Attributes["type"] = department.intDepartmentGroup_ID.ToString();
                tabPanel.Tabs.Add(newTab);
            }


And then my javascript is simply:
function onTabSelected(sender, args) {
    var tab = args.get_tab();
    var attr = tab.get_attributes();
    alert(attr.get_count()+" - " +attr.getAttribute("type") + " - " + tab.get_text());
}


count is always 0 and getattribute is always undefined.

Any help would be appreciated.

Thanks
Loren 
Kate
Telerik team
 answered on 17 Oct 2012
0 answers
62 views
wouh sexy :p

Very nice job
arnaud
Top achievements
Rank 1
 asked on 17 Oct 2012
5 answers
317 views
Hi support,

I had added the TableLayoutCssFile property to the <telerik:RadEditor ID="Editor" Runat="server" ...> to customize the "Css Class Layout" dropdown (according to http://www.telerik.com/community/forums/aspnet-ajax/editor/table-wizard-css-style-selector.aspx). Everything works good, but this classes are visible in the "Apply Css" dropdown.

I don't want them to be visible but at the same time I want to have an opportunity to customize the "Apply Css" dropdown.

I found a workaround. It is modification of the <classes> section, but using this method meaning that there are 2 places that I need to edit, which is outside the requirement.

Please advise.
Rumen
Telerik team
 answered on 17 Oct 2012
1 answer
182 views
Hello!  I am using the RadOrgChart with Group Items Overlap to display some information based on our hierarchy.  I have it functioning correctly however the rows are too wide for the screen as shown in the snapshot NoGroupColumnCount.png.  I tried setting the GroupColumnCount to 3 and that resulted in the group items restricted to 3 per line within the nodes as shown in WithGroupColumnCount.png.  Is there a way to limit the number of nodes per line instead of the overlapped group items?
Plamen
Telerik team
 answered on 17 Oct 2012
1 answer
263 views
Hi All,

Here's what I got:

I have a RadCombobox that has three specific challenges:  (1) the recordset is so large that I need LoadOnDemand-style functionality and (2) the combobox needs to be inside a asp.net repeater.  Since it needs to be in a repeater, I do not see this demo working: http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultvb.aspx

Here is the technique I'm currently attempting:

1.  Here is the RadCombobox declaration:

<telerik:RadComboBox ID="PositionRCB" Runat="server" OnClientItemsRequesting="onItemsRequesting" DataSourceID="PositionDS" DataTextField="Info" DataValueField="PK" MarkFirstMatch="True" Width="125px" ShowToggleImage="True" Filter="Contains" EnableAutomaticLoadOnDemand="True" ItemsPerRequest="15">
</telerik:RadComboBox>

2. When the user types, OnClientItemsRequesting fires:

<script type="text/javascript">
 
    function onItemsRequesting(sender, eventArgs) {
 
        var positionText = eventArgs.get_text();
        document.getElementById("<%= HiddenTB_Position.ClientID %>").value = positionText
         
    }
 
</script>  


3.  The JS above writes the user's typing to the following hidden textbox:

<asp:TextBox ID="HiddenTB_Position" runat="server" Text="Grot"></asp:TextBox>


4. Then, I'm trying to get the following DS declaration to update my RadCombobox:

<asp:SqlDataSource ID="PositionDS" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseCargoMM1 %>" SelectCommand="usp_PickCity" SelectCommandType="StoredProcedure">
    <SelectParameters>
        <asp:ControlParameter ControlID="HiddenTB_Position" PropertyName="Text" Type="String" Name="Param1" />
    </SelectParameters>
</asp:SqlDataSource>

So, the bottom line is that the EnableAutomaticLoadOnDemand the property does not seem to be "re-firing" my datasource with the users typed values.  I'm wondering if (1) their is a way to force these RadComboboxes in the repeaters to fire when the JS above fires or (2) their is another technique that might work.

Thanks a ton for the help!

Jim
Kalina
Telerik team
 answered on 17 Oct 2012
5 answers
206 views
<MasterTableView AutoGenerateColumns="False" DataKeyNames="CustomerID">
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </ExpandCollapseColumn>                                 
                                <CommandItemTemplate>
                               <asp:Button ID="LinkButton1" runat="server" ButtonCssClass="button" Text="Print Selected" OnClientClick="PrintRadGrid(); return false;" />         
                                </CommandItemTemplate>                              
                                <Columns>
                                    <telerik:GridBoundColumn HeaderText="Customer ID" DataField="CustomerID" UniqueName="CustomerID">
                                    </telerik:GridBoundColumn>  
                                     <telerik:GridBoundColumn HeaderText="Invoice #" DataField="InvoiceNumber" UniqueName="InvoiceNumber">
                                    </telerik:GridBoundColumn>                                  
                                    <telerik:GridBoundColumn HeaderText="Ship To Terms" DataField="ShipToTerms" UniqueName="ShipToTerms">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderText="Ship Via" DataField="ShipVia" UniqueName="ShipVia">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn HeaderText="OrderStatus" DataField="OrderStatus" UniqueName="OrderStatus">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridButtonColumn CommandName="Print" ButtonType="PushButton" ButtonCssClass="button" UniqueName="Print" Text="Print" />                                                    
                                 </Columns>       


 protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "Print")
        {
            CODE
        }
}

I want to Print the row data when i click the button

 can anyone help with this code it..............

Thanks in advance
Suren

Daniel
Telerik team
 answered on 17 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?