Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
745 views

I have this

 

 

for (int i = 0; i < RadUpload1.UploadedFiles.Count; i++)

 

{

 

        TextBox1.Text = TextBox1.Text +

"\n"+RadUpload1.UploadedFiles[i].FileName;

 

}

This FileName method returns the file name ONLY. How can i get the full source path?

For example if i upload from : c:/upload/test.jpg

I want to print out the whole "c:/upload/test.jpg" , not just "test.jpg"

Thank you!

Nencho
Telerik team
 answered on 07 Jul 2015
12 answers
501 views
How can I change the default "blue" color of the metrotouch skin?

I need to have this color as the main color in the metrotouch skin hex #157164

Thanks in advance.
Vessy
Telerik team
 answered on 07 Jul 2015
1 answer
180 views

Hi,I'm playing with one website and here is the thing:

On this page are plenty of divs, each with different content. I want to load the core (div headers, user info etc.) and after that, when user see this core, I want to async load content of each div. After that I want refresh content of divs, but in different timespan. 

Can I do that somehow with Telerik Ajax? I tried something with AjaxPanel, but the content shows after the full page load.

Thank you very much for your advice.

Maria Ilieva
Telerik team
 answered on 07 Jul 2015
2 answers
242 views

Hi,

Is there a way to change specified column's cells Background color ?

For example, I would like to represent holidays' period by changing the column's cells color.

 Thanks, RĂ©mi.

Rémi
Top achievements
Rank 1
 answered on 07 Jul 2015
4 answers
136 views
I need a solution to work for a dynamically loaded user control that contains the grid and the context menu. When using...

<
ClientEvents OnRowContextMenu="RowSelected" />

... and having the javascipt method embedded on the .ascx, the application throws error "RowSelected is undefined." I read on another post to use RegisterClientScriptBlock in the user control code behind which does get works for getting the RowSelected method recognized; however, the .show method of the context menu is undefined. When I code the following using RegisterClientScriptBlock, I get the undefined error for .show()

$find(
"<%= GridContextMenu.ClientID %>").show(args.get_domEvent());

...so I then tried...

document.getElementById('"

+ GridContextMenu.ClientID + "');

...which didn't work either.

So, the back to the original question: How do I get a context menu to work for a rad grid that is on a dynamically loaded user control?

I thought I'd make this a Post. I had asked the question in a reply to another Post, which may have not been appropriate.

http://www.telerik.com/community/forums/thread/b311D-bbktgd.aspx

Thanks for any help!

John D

Dimitar
Telerik team
 answered on 07 Jul 2015
1 answer
82 views
Dear Team,

We have implemented video upload and preview functionalities. User should be able to upload any video and should be able to preview it. We are using Telerik Rad Media Player. I'm able to preview MP4 format videos. When I try to play WMV, MOV format videos, some icon to download adobe flash player is getting displayed. Adobe flash player is already there in my machine and it is enabled in my browser. We are using IE.

Please let me know if I have to do any settings in my machine/application.

Thanks,
Phani
Maria Ilieva
Telerik team
 answered on 07 Jul 2015
1 answer
108 views

I have an edit page that is able to edit administrators of a site, on reload or edit of the admin I need to load the name in the autocomplete box and then disable so they cannot change it on edit.  Problem is I can seem to figure out how to reload the autocompletebox with the text.

 

myDataTable = New DataTable
        myDataTable = getReader(sql)
 
        If myDataTable.Rows.Count > 0 Then
            HFAdminId.Value = myDataTable.Rows(0)(0)
            txtItemSearch.Text = myDataTable.Rows(0)(0).ToString()
            ddlLocations.SelectedValue = myDataTable.Rows(0)(2)
       End If
 
Also tried this but to no avail.
 
   myDataTable = New DataTable
        myDataTable = getReader(sql)
 
        If myDataTable.Rows.Count > 0 Then
            HFAdminId.Value = myDataTable.Rows(0)(0)
            txtItemSearch.Entries(0).Text = myDataTable.Rows(0)(1).ToString
            ddlLocations.SelectedValue = myDataTable.Rows(0)(2)
         end if
 
Both gave me this error
 
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
 Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
 
Source Error:

Bozhidar
Telerik team
 answered on 07 Jul 2015
1 answer
249 views

I am trying to check to see if the autocomplete box has no value before I go on in code, but the 2 methods I tried do not seem to work. I have it in single mode selection and getting the value fine but when checking for it, the code always escapes to else statement.

 

If txtItemSearch.Entries(0).Value = String.Empty Then
           ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "alert('You must specify an administrator.');", True)
       Else
           Dim adminId As Integer = Convert.ToInt32(txtItemSearch.Entries(0).Value)
           Dim locationId As String = ddlLocations.SelectedValue
           'Dim siteAdmin As Integer = boolToInt(chkSiteAdmin.Checked)
           'Dim contact As Integer = boolToInt(chkContact.Checked)
           'Dim email As Integer = boolToInt(chkEmail.Checked)
 
 
If txtItemSearch.Entries.count < 0 Then
           ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "OpenWindow", "alert('You must specify an administrator.');", True)
       Else
           Dim adminId As Integer = Convert.ToInt32(txtItemSearch.Entries(0).Value)
           Dim locationId As String = ddlLocations.SelectedValue
           'Dim siteAdmin As Integer = boolToInt(chkSiteAdmin.Checked)
           'Dim contact As Integer = boolToInt(chkContact.Checked)
           'Dim email As Integer = boolToInt(chkEmail.Checked)
 
 
<div class="div100">
           <telerik:RadAutoCompleteBox ID="txtItemSearch" runat="server" Width="260px" OnClientRequesting="requesting" AllowCustomEntry="false" DropDownPosition="Automatic" CssClass="centAutocomplete"
                   EmptyMessage="Enter Last Name First Name to Search"  InputType="Text"  HighlightFirstMatch="true" TextSettings-SelectionMode="Single" DropDownWidth="250px">
                   <WebServiceSettings path="../AutoComplete.asmx" Method="FindAdmin" />
           </telerik:RadAutoCompleteBox>
           <asp:HiddenField ID="HFAdminId" runat="server" />
       </div>

 

Bozhidar
Telerik team
 answered on 07 Jul 2015
1 answer
55 views
How would can you use IsSeparater="True" with databound menu items?  what needs be stored in the database table?
Hristo Valyavicharski
Telerik team
 answered on 07 Jul 2015
4 answers
236 views


I want to know how to implement custom filter in RadGrid.

I have a Ajaxfied RadGrid and datasource is binded in NeedDatasource event. The RadGrid has five columns..

In that, I want to change the filter of one of the column to selectable filter..

So, I added a FilterTemplate and added the RadComboBox inside to it..

Initially, I hardcoded all the RadComboBox item in the design time itself.. Binded a javascript to clientside_selectedchanged event.. This approach worked fine..

When I binded RadComboBox with collection (List) in the code behind.. The filtering didn't work.. I binded the RadComboBox in GridItemDataBound or GridItemCreated event.. But no luck..

Any help.. will be very much useful to me.. I spent nearly two days but I didn't any direction... I'm nearing to my deadline.. so I have no other option left out other than this forum..

Custom Filter Code

The following is sample code which I copied from my project and pasted here.. I have changed the field names alone..

Filter Template:

<telerik:GridBoundColumn DataField="DepartmentDescription" Groupable="true" HeaderText="Program" UniqueName="DepartmentDescription">

    <FilterTemplate>

        <telerik:RadComboBox ID="RadComboBoxDepartmentDescription" runat="server"

            AppendDataBoundItems="true"

            DataTextField="DepartDesc"

            DataValueField=" DepartDesc "

            OnClientSelectedIndexChanged="RadComboBoxDepartmentDescriptionIndexChanged"

            OnDataBound="RadComboBoxAllFilters_OnDataBound"

            SelectedValue='<%#TryCast(Container,GridItem).OwnerTableView.GetColumn("DepartmentDescription ").CurrentFilterValue%>'

            Width="100px">

            <Items>

                <telerik:RadComboBoxItem Text="All" Value="" />

            </Items>

        </telerik:RadComboBox>

        <telerik:RadScriptBlock ID="RadScriptBlockProgram" runat="server">

            <script type="text/javascript">



                function RadComboBoxDepartmentDescriptionIndexChanged(sender, args) {

                    var tableView = $find("<%# TryCast(Container,GridItem).OwnerTableView.ClientID%>");

                    tableView.filter("DepartmentDescription", args.get_item().get_value(), "EqualTo");

                }

            </script> 

        </telerik:RadScriptBlock>

    </FilterTemplate>

    <ItemStyle Wrap="False" />

    <HeaderStyle Wrap="false" />

</telerik:GridBoundColumn>





RadGrid DataBinding Code

protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{

(sender as RadGrid).DataSource = employeeList;  //This is a list of employee of values.. which comes from service layer.. of type .. List<Employee>

}



RadGrid UI Code


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

        <AjaxSettings>

            <telerik:AjaxSetting AjaxControlID="RadGrid1">

                <UpdatedControls>

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

                </UpdatedControls>

            </telerik:AjaxSetting>

        </AjaxSettings>

    </telerik:RadAjaxManager>

    <div>

        <telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="True" AllowSorting="true"

            OnNeedDataSource="RadGrid1_NeedDataSource"

..other code I removed it.. like the grid events and bound columns definitions

        </telerik:RadGrid>



RadComboBox Filter DataBinding Code in the Code Behind:

Protected Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound

If TypeOf e.Item Is Telerik.Web.UI.GridFilteringItem Then

    'Populate Filters by binding the combo to datasource

    Dim filteringItem As Telerik.Web.UI.GridFilteringItem = CType(e.Item, Telerik.Web.UI.GridFilteringItem)

    Dim myRadComboBox As Telerik.Web.UI.RadComboBox = DirectCast(filteringItem.FindControl("RadComboBoxDepartmentDescription"),Telerik.Web.UI.RadComboBox)



    myRadComboBox.DataSource = departmentList; //This is a collection which comes from service layer… and the type is List<Department>

    myRadComboBox.DataTextField = " DepartmentDescription"
    myRadComboBox.DataValueField = " DepartmentDescription"

    myRadComboBox.DataBind()

End If



Even I pasted the same code in ItemCreated Event as well but no luck…

 

Eyup
Telerik team
 answered on 07 Jul 2015
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?