Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
157 views
This sounded like such a simple request but I simply can't figure it out.

I want to prevent the user from selecting certain file types (I'm trying to implement a blacklist type of validation rather than the whitelist method that the telerik control comes with out-of-the-box).

OK, so there's no set_cancel() method for OnClientFileSelected. A shame, but moving on.

I though, OK, if they select an invalid file type, I'll just remove it, so came up with this ....
var fileExtensionBlacklist = "<%=DisallowedFileTypes %>";
function OnClientFileSelected(sender, e)
{
    if("<%=UseBlacklist %>" == "True")
    {
        var selectedFileName = e.get_fileName();
        var selectedExtension = selectedFileName.split(".").pop();
        if (fileExtensionBlacklist != "" && fileExtensionBlacklist.indexOf(selectedExtension) > -1)
        {
            try { $find("<%=RadAsyncUpload1.ClientID %>").deleteFileInputAt(e.get_rowIndex()); } catch (ex) { }
        }
    }
}
function OnClientFileUploadFailed(sender, e)
{
    e.set_handled(true);
}
This doesn't work, the attempt to delete the file input generates an error reporting "HtmlPage_NotEnabled" in a line of javascript that calls Content.Page.MarshalUploads(). This appears to be something to do with Silverlight, but I can't stop it from happening.

Working to a deadline, I moved on.

So, I thought, "OK, if I can't stop 'em selecting these files, I can at least, stop 'em from being uploaded".

So, I modified the code to this ...
function OnClientFileUploading(sender, e)
{
    if("<%=UseBlacklist %>" == "True")
    {
        var selectedFileName = e.get_fileName();
        var selectedExtension = selectedFileName.split(".").pop();
        if (fileExtensionBlacklist != "" && fileExtensionBlacklist.indexOf(selectedExtension) > -1)
        {
            e.set_cancel(true);
        }
    }
}
Tried that and Yay! the file is mared red as a failed upload!

Then I click on the button on my page to actually do the postback and process the uploaded files. Get what I find in my server-side list of uploaded files, yep. The file that I had set cancel on. What's more it shows it IsValid as true.

Is this God's punishment for me working on a Sunday? If it is, he's picking on the wrong bloke, I have no choice; he should go smite the guy who said I had to.

If anyone can offer any suggestions as to what I'm doing wrong, I'd love to hear 'em.

--
Stuart


Stuart Hemming
Top achievements
Rank 2
 answered on 30 Nov 2011
1 answer
124 views
I am attempting to create a custom skin for all of the ASP.NET AJAX Controls so that all the controls have a unified look and feel that matches the rest of my site. I have found all of the sprite.gif files inside of C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX\Skins, but it seems like a tedious task to take all of these and edit them to fit my color scheme. I have tried on multiple occasions to use the Visual Style Builder to create a custom skin, these endeavors have always ended horribly, that tool simply does not work. Then I found the .psd files located at telerik.com/skins, these seemed to be exactly what I was looking for, I could restyle the entire control at one time, then theoretically slice it up into the sprite.gif files that would work with the css for the control. But this is where I get stuck, once you have the .psd altered the way you want it to look, how then do you convert/slice those into the sprite files that the css will know how to use?

Thanks
Bozhidar
Telerik team
 answered on 30 Nov 2011
2 answers
122 views
Hi,
    I have dragged a rad upload control. When I run my solution I could see all the controls corresponding to Upload. But my "select" button doesnot work. So I am not being able to select any file. Can somebody please help me on this regard?

PFB my code

 

<div>

 

 

 

<telerik:RadProgressManager ID="RadProgressManager1" Runat="server" />

 

 

 

<telerik:RadUpload ID="radUploadFile" Runat="server"

 

 

 

AllowedFileExtensions=".zip" ControlObjectsVisibility="None"

 

 

 

MaxFileInputsCount="1" Skin="WebBlue" TargetFolder="~/Files"

 

 

 

OverwriteExistingFiles="True">

 

 

 

</telerik:RadUpload>

 

 

 

</div>

Thanks,
Kishan

 

 

Ben Hobgood
Top achievements
Rank 1
 answered on 30 Nov 2011
3 answers
121 views
Hi team

Any one have idea regarding raddatepicker history removal please verify the attachment
Princy
Top achievements
Rank 2
 answered on 30 Nov 2011
1 answer
91 views
I am using Radchart with chart type as line, my chart takes time to load, so i want to show a loading panel until the chart loads, to indicate its processing.
Princy
Top achievements
Rank 2
 answered on 30 Nov 2011
1 answer
53 views
Hi,

I have a RadGrid with filtering of columns enabled. I have set the CurrentFilterFunction so that that filter function gets selected as default instead of the 'NoFilter'. I would like to use the Enter key to apply the selected filter function. Now when I press Enter key the filter function list open up instead of getting selected.

Thanks,
Raji
Shinu
Top achievements
Rank 2
 answered on 30 Nov 2011
1 answer
46 views

Hello!

 

Setup:

  1. 2 levels of grouping using the GroupByExpressions collection of the MasterTableView within the declarative portion of a page
  2. MasterTableView.GroupLoadMode set to “Client”
  3. MasterTableView.GroupsDefaultExpanded set to “false”

 

When I expand any of the top/1st level groups, I am expecting that the child/2nd level groups are shown expanded/collapsed based on their Expanded property. Instead what happens is that the child/2nd level groups are all shown as expanded.

 

Is this behavior expected or is there a fix/workaround that you can provide?

 

Thanks in advance,

Brent

 

<tlr:RadGrid runat="server" ID="grdDoubleGroupings" AutoGenerateColumns="true" 
    AllowSorting="true" 
    OnNeedDataSource="grdDoubleGroupings_NeedDataSource"
>
    <MasterTableView 
        GroupLoadMode="Client" 
        AllowMultiColumnSorting="true" 
        AllowNaturalSort="false" 
        GroupsDefaultExpanded="false"
    >
        <GroupByExpressions>
            <tlr:GridGroupByExpression>
                <GroupByFields>
                    <tlr:GridGroupByField FieldName="Category" />
                </GroupByFields>
                <SelectFields>
                    <tlr:GridGroupByField FieldName="Category" />
                </SelectFields>
            </tlr:GridGroupByExpression
            <tlr:GridGroupByExpression>
                <GroupByFields>
                    <tlr:GridGroupByField FieldName="Subcategory" />
                </GroupByFields>
                <SelectFields>
                    <tlr:GridGroupByField FieldName="Category" />
                    <tlr:GridGroupByField FieldName="Subcategory" />
                </SelectFields>                 
            </tlr:GridGroupByExpression>
        </GroupByExpressions>
    </MasterTableView>
</tlr:RadGrid>

Shinu
Top achievements
Rank 2
 answered on 30 Nov 2011
21 answers
592 views
I created a Tooltip based on the "Load On Demand" example.  In the tooltip I have an asp:Label and an asp:TextBox.  The values for these fields can change each time the tooltip is displayed.  When I initially display the tooltip, the label and textbox have the expected values.  However, when the tooltip is displayed the next time and I set different values for the label and textbox, the label shows the new value, but the textbox contains the original value.

This behavior can be observed by making the following changes to Load On Demand example code:

In the ProductDetails.ascx, add the following row to the "Product Wrapper" table:

<tr> 
    <td> 
        <asp:TextBox ID="txtDT" runat="server" /> 
        <asp:Label ID="lblDT" runat="server" /> 
    </td> 
</tr> 

In the ProductDetails.ascx.cs, add the following code to the ShowCurrentDetails() method:

String dt = DateTime.Now.ToLongTimeString(); 
txtDT.Text = dt
lblDT.Text = dt

The label's value is changes on each time the tooltip is displayed, but the textbox's value retains the original timestamp.

I also added the following code to the method UpdateToolTip(...) in Default.CS.aspx.cs, but it didn't help:

panel.Update();  

Any ideas on what I'm doing wrong?
Williams
Top achievements
Rank 1
 answered on 30 Nov 2011
1 answer
58 views
Hi Telerik Team,

I have a radgrid for which i am setting its height in aspx page everything works fine. But if the number of items in the Grid decreases it leaves whitespace which looks ugly.

Can anyone tell me the approch how to remove that whitespace...

when i remove scrolling and static headers its working fine..But i need them because in some cases i have 600 records..

Thanku Plz do reply its urgent...Its all over my project....

Princy
Top achievements
Rank 2
 answered on 30 Nov 2011
1 answer
458 views
I have a grid that i want to be able to click the row and it becomes selected.  On initial load of the page it does not work.  Once I sort a column or click on another button on the page the functionality works I am able to click on a row and it becomes selected.
Any help or suggestions would be greatly appreciated.

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

    <AjaxSettings>

 

        <telerik:AjaxSetting AjaxControlID="RadGrid1">

 

            <UpdatedControls>

 

                <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

            </UpdatedControls>

 

        </telerik:AjaxSetting>

 

    </AjaxSettings>

 

</telerik:RadAjaxManager>

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" MinDisplayTime="500" Transparency="25" BackColor="#ffffff" runat="server" CssClass="ajaxloader" />

 

<telerik:RadGrid ID="RadGrid1" runat="server"

 

AllowSorting="True" GridLines="None"

 

AutoGenerateColumns="false"

 

OnNeedDataSource="RadGrid1_NeedDataSource">

    <MasterTableView Width="100%" DataKeyNames="Id">

 

        <Columns>
            <telerik:GridClientSelectColumn UniqueName="ClientSelect" HeaderStyle-Width="5%" />

            <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Name" UniqueName="DisplayName" DataType="System.String" HeaderStyle-Width="20%" />

 

            <telerik:GridBoundColumn DataField="FileDateTime" HeaderText="Created Date/Time" UniqueName="Created" DataType="System.DateTime" HeaderStyle-Width="20%" DataFormatString="{0:MM/dd/yy hh:mm tt}" />

 

            <telerik:GridBoundColumn DataField="LastSentDateTime" HeaderText="Last Used" UniqueName="Sent" DataType="System.DateTime" HeaderStyle-Width="20%" DataFormatString="{0:MM/dd/yy hh:mm tt}" />
            <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="30%" HeaderText="Message Type" AllowFiltering="false" UniqueName="MessageFormat" SortExpression="MessageFormat">
                <ItemTemplate>
                    <asp:ImageButton ID="ibtnPhone" runat="server" ImageUrl="~/Images/pc_icon_phone.gif" CommandName="ListenPhone" ToolTip="Listen to message" />

 

                    <asp:ImageButton ID="ibtnSMS" runat="server" ImageUrl="~/Images/pc_icon_txt.gif" CommandName="ViewSMS" ToolTip="View SMS Message" />
                <
/ItemTemplate>

 

                <HeaderStyle HorizontalAlign="Left" />

 

                <ItemStyle HorizontalAlign="Left" />
            </telerik:GridTemplateColumn>
        </Columns>

 

    </MasterTableView>
    <ClientSettings>
        <Selecting AllowRowSelect="True" />

 

    </ClientSettings>

 

</telerik:RadGrid>

Shinu
Top achievements
Rank 2
 answered on 30 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?