Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
173 views

Hello,

 

Inside a RadScheduler (ID= "Radscheduler1")

I have a RadComboBox (ID="acbProjet") with an 'OnSelectedIndexChanged' Inside Advanced Insert Form.

I have also an other RadDropDownList (ID="RadDropDownListTypeHeure") depending on the choice of the RadComboBox.

        protected void acbProjet_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
          // ??? RadDropDownList rddl = (RadDropDownList) RadScheduler.FindControl("RadDropDownListTypeHeure");
          // ??? RadDropDownListTypeHeure = (RadComboBox)e.Container.FindControl("RadDropDownListTypeHeure");
        }

 

HOW can i access the RadDropDownList for update the datasource ?

THANK you for your HELP

 

 

Peter Milchev
Telerik team
 answered on 29 Sep 2016
7 answers
180 views
Hi,

like the subject says, I'm trying to have an AJAX ComboxBox, among other controls, inside a RadPanelBar but it seems it doesn't work, since I'm getting a JavaScript error about a variable bestWidth that is set to -2.

<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager> 
    <div> 
        <asp:UpdatePanel ID="UpdatePanel1" runat="server"
        <ContentTemplate> 
                
           <telerik:RadPanelBar ID="RadPanelBar1" runat="server"
                   <Items> 
                       <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1"
                        <Items> 
                            <telerik:RadPanelItem> 
                            <ItemTemplate>                                  
                                <cc1:ComboBox ID="ComboBox1" runat="server" AutoCompleteMode="Append" AutoPostBack="true" DropDownStyle="DropDown"
                                </cc1:ComboBox>                                    
                            </ItemTemplate> 
                            </telerik:RadPanelItem> 
                        </Items>                       
                       </telerik:RadPanelItem> 
                        
                        <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2"
                        <Items> 
                            <telerik:RadPanelItem> 
                            <ItemTemplate> 
                                <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
                            </ItemTemplate> 
                            </telerik:RadPanelItem> 
                        </Items> 
                       </telerik:RadPanelItem> 
                   </Items> 
            </telerik:RadPanelBar>      
        </ContentTemplate> 
        </asp:UpdatePanel> 
    </div> 
    </form> 
</body> 

Thanks in advance for your help.

Dax
Sneha
Top achievements
Rank 1
 answered on 29 Sep 2016
14 answers
945 views
I'm apparently missing something here.  Trying to change the sort order of a grid that uses GroupByExpressions with no luck.

I started with the following:
<GroupByExpressions>
    <telerik:GridGroupByExpression>
        <GroupByFields>
            <telerik:GridGroupByField FieldName="OrderID" />
        </GroupByFields>
        <SelectFields>
            <telerik:GridGroupByField FieldName="OrderID" HeaderText="Order ID" />
            <telerik:GridGroupByField FieldName="CustLastFirst" HeaderText="Customer" />
            <telerik:GridGroupByField FieldName="Total" HeaderText="Order Total" FormatString="{0:C}" />
        </SelectFields>
    </telerik:GridGroupByExpression>
</GroupByExpressions>


Then I tried adding this:
<SortExpressions>
    <telerik:GridSortExpression FieldName="CustLastFirst" SortOrder="Ascending" />
</SortExpressions>

And I tried variations of this, but get either no action or a type mismatch error:
<GroupByFields>
    <telerik:GridGroupByField FieldName="OrderID" />
    <telerik:GridGroupByField FieldName="CustLastFirst" />
</GroupByFields>


Any suggestions?  Thanks!


Kostadin
Telerik team
 answered on 29 Sep 2016
9 answers
176 views
Hello! Please note that ClientSettings-Scrolling-SaveScrollPosition="true" not working since Q3 2015. Please fix!!!
Pavlina
Telerik team
 answered on 29 Sep 2016
4 answers
334 views
I have in a page the code below for a radwindow used as a modal popup. For some reason no matter what I do the validators will not fire when I click the btnAddUserToRoleSave button. Is there some trick to using validators in a modal window box? Thanks.




<telerik:RadWindowManager ID="rwmManagerUsers" runat="server" Style="z-index: 3" >
<Windows>  
<telerik:RadWindow ID="rwManagerUsers_SelectUsers" runat="server" 
    OnClientClose="rwManagerUsers_SelectUsers_OnClientClose" 
    Modal="true"
    AutoSize="true"
    Behaviors="Close"
    v>
<ContentTemplate>
        <asp:ValidationSummary ID="vsAddUserToRoleValidationSummary" runat="server" 
            EnableClientScript="true" 
            ShowMessageBox="true"
            ValidationGroup="vgAddUserToRoleForm"
            HeaderText="ERROR! The user cannot be set due to the following reasons:
            " />
        <table>
            <tr>
                <td><asp:Label ID="lblSelectedUser" Text="User:" runat="server"></asp:Label></td>
                <td>
                    <telerik:RadComboBox ID="ddlSelectedUser" runat="server" DataTextField="DisplayName" DataValueField="UserName"></telerik:RadComboBox>
                    <asp:RequiredFieldValidator ID="rfvSelectedUser"  runat="server"
                        Text="*" 
                        ErrorMessage="A User must be selected."
                        ToolTip="A User must be selected."
                        ControlToValidate="ddlSelectedUser"
                        ValidationGroup="vgAddUserToRoleForm"
                        InitialValue="-1"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="lblSelectedLocation" Text="Location:" runat="server"></asp:Label></td>
                <td>
                    <telerik:RadComboBox ID="ddlSelectedLocation" runat="server" DataTextField="Description" DataValueField="LocationCode"></telerik:RadComboBox>
                    <asp:RequiredFieldValidator ID="rfvSelectedLocation" runat="server"
                        Text="*" 
                        ErrorMessage="A Location must be selected."
                        ToolTip="A Location must be selected."
                        ControlToValidate="ddlSelectedLocation" 
                        ValidationGroup="vgAddUserToRoleForm"
                        InitialValue=""></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Button ID="btnAddUserToRoleSave" runat="server" Text="Add User To Role" OnClick="btnAddUserToRoleSave_Click" ValidationGroup="vgAddUserToRoleForm" />
                    <asp:Button ID="btnAddUserToRoleCancel" runat="server" Text="Cancel" OnClientClick="rwManagerUsers_Cancel();cancelEvent()" />
                </td>
            </tr>        
        </table>
</ContentTemplate>
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
Marin Bratanov
Telerik team
 answered on 29 Sep 2016
1 answer
105 views
Hi, I am new to Sitefinty , and I have inserted "Facebook Like Widget" but I noticed that this is generating an error in the template , and I am trying to click on it on the page and the counter is showing zero . and nothing happened . the website is still running on my local . please advise.
Danail Vasilev
Telerik team
 answered on 29 Sep 2016
2 answers
284 views

Hi, i have a RadDatePicker, how can i change the date textfield edit behaviour?

When I edit my selected date by using the date textfield (not by using the datepicker), when i click on the date textfield, the whole date is highlighted.

Can I make it not highlight the whole date instead?

Attached image (1.png) shows that the current behavior. Click once, whole date is highlighted.

Attached image (2.JPG) is the behavior which I want.

 

I am using Telerik 2016.2.607.45.

Thank you.

 

Elvis
Top achievements
Rank 1
 answered on 29 Sep 2016
3 answers
2.0K+ views

I am opening the popup window with the below code from Server side

var url = string.Format("../UserPopup.aspx?user_Ids={0}&fromDate={1}&toDate={2}", user_Ids, fromDate, toDate);
string script = string.Format("function f(){{openDialog('{0}', {1}, {2}, {3});Sys.Application.remove_load(f);}}Sys.Application.add_load(f);",
                                     url,
                                     "true",   
                                     1000,
                                     300);
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "someKey", script, true)

Below is the code for closing the popup window from javascript. The below code is not working.

function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.radWindow;
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;
            return oWindow;
        }
 
function Close() {
var result = window.confirm("Are you sure you want to close the window!");
if (result == true) {
    var oWindow = GetRadWindow();
    oWindow.argument = null;
    oWindow.onunload = refreshParent;
    oWindow.close();
    return false;
    }
 }
 
 function refreshParent() {
     window.opener.location.reload();
 }

How can I close the popup window from client side and refresh the parent page?

 

FYI: I am using RadWindow as popup for this.

Marin Bratanov
Telerik team
 answered on 29 Sep 2016
9 answers
290 views
Hi,
I have a RadListView that is populated from a database. It displays data in a grid format. The RadListView contains paging and has the OnNeedDataSource property set that is used to populate the RadListView with data. PLease see below for the code.

<telerik:RadListView ID="RadListView1" runat="server"

ItemPlaceholderID="ProductsContainer" DataKeyNames="ProductId" AllowPaging="true" PageSize="12"

OnItemCommand="RadListView1_ItemCommand" OnNeedDataSource="RadListView1_NeedDataSource">

<LayoutTemplate>

<fieldset id="FieldSet1" style="border: none; padding: 0px;">

<asp:PlaceHolder ID="ProductsContainer" runat="server"></asp:PlaceHolder>

<div style="clear: both">

</div>

<div style="border-top: dashed 0px #CACACA; padding-top: 30px;">

<div style="float: left; margin-left: 0%;">

<asp:Button runat="server" ID="btnFirst" CommandName="Page" CommandArgument="First"

Text="<<" Enabled="<%#Container.CurrentPageIndex > 0 %>" CssClass="Button_Grid_Pager"></asp:Button>

<asp:Button runat="server" ID="btnPrev" CommandName="Page" CommandArgument="Prev"

Text="<" Enabled="<%#Container.CurrentPageIndex > 0 %>" CssClass="Button_Grid_Pager"></asp:Button>

<span style="vertical-align: middle; line-height: 22px; display: inline-block;">&nbsp;&nbsp;Page

<%#Container.CurrentPageIndex + 1 %>

of

<%#Container.PageCount %></span>&nbsp;&nbsp;

<asp:Button runat="server" ID="btnNext" CommandName="Page" CommandArgument="Next"

Text=">" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" CssClass="Button_Grid_Pager"></asp:Button>

<asp:Button runat="server" ID="btnLast" CommandName="Page" CommandArgument="Last"

Text=">>" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>" CssClass="Button_Grid_Pager"></asp:Button>

</div>

<div style="border: none; padding-top: 2px;">

<span style="vertical-align: middle; font-weight: normal; line-height: 22px; padding-left: 15px;">Items per page:&nbsp;&nbsp;</span>

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

OnSelectedIndexChanged="cmbPageSize_SelectedIndexChanged"

AutoPostBack="true" Width="60px" Skin="Default"

SelectedValue="<%#Container.PageSize %>">

<Items>

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

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

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

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

 

</Items>

</telerik:RadComboBox>

</div>

</div>

</fieldset>

</LayoutTemplate>

<ItemTemplate>

<fieldset class="item">

<asp:Panel ID="ItemContainer" runat="server">

<asp:ImageButton ID="imgbtnProductDetails" runat="server" ImageUrl='<%# "prodimages/" & Eval("ProdRef") & "-1_Grid.jpg"%>'

AlternateText='<%# Eval("ImageAltText") %>' Width="240px"

CommandName="SelectProduct" CommandArgument='<%# Eval("ProductId")%>' Enabled='<%# IIf(Eval("IsVoucher") = True, False, True)%>' />

</asp:Panel>

</fieldset>

</ItemTemplate>

</telerik:RadListView>


I want to know how I can, dynamically (code behind) always display an image in item position / grid position 0 in the RadListView, so that it is always displayed on every page, in the same position, of the RadListView....for example see below where (X) is where I want to display the image on every page...

X......... item1.....item2
item3....item4.....item4
item6....item7.....item8

Thanks for your time.
Bhavya
Top achievements
Rank 1
 answered on 29 Sep 2016
1 answer
166 views

Hi I have been able to hide hidden files but i cant seem to get the directories to hide my files code is -

public override DirectoryItem ResolveDirectory(string virtualPath)
{

        DirectoryItem basedir = base.ResolveDirectory(virtualPath);
    
     

        string physicalPath;
physicalPath = this.GetPhysicalFromVirtualPath(virtualPath);

if (physicalPath == null)
return null;

DirectoryItem result = new DirectoryItem(PathHelper.GetDirectoryName(physicalPath),
virtualPath,
virtualPath,
virtualPath,
GetPermissions(physicalPath),
GetFiles(virtualPath),
new DirectoryItem[] { }// Directories are added in ResolveRootDirectoryAsTree method
);

        // Update all file items with the additional information (date, owner)
        DirectoryItem oldItem = base.ResolveDirectory(physicalPath);
        List<FileItem> visibleFiles = new List<FileItem>();
        foreach (FileItem fileItem in result.Files)
        {
            // Get the information from the physical file
            FileInfo fInfo = new FileInfo(physicalPath + "\\" + fileItem.Name);
            // Add the information to the attributes collection of the item. It will be automatically picked up by the FileExplorer
            // If the name attribute matches the unique name of a grid column
            fileItem.Attributes.Add("CreationDate", fInfo.CreationTimeUtc.ToString());
            fileItem.Attributes.Add("ModifiedDate", fInfo.LastWriteTime.ToString());

            
            
            FileAttributes fileattr = File.GetAttributes(physicalPath + "\\" + fileItem.Name);
            if((fileattr & FileAttributes.Hidden) != FileAttributes.Hidden)
            {
                visibleFiles.Add(fileItem);
            }
        }

        DirectoryItem result1 = new DirectoryItem(PathHelper.GetDirectoryName(physicalPath),
                                                    virtualPath,
                                                    virtualPath,
                                                    virtualPath,
                                                    GetPermissions(physicalPath),
                                                   visibleFiles.ToArray(),
                                                    new DirectoryItem[] { }// Directories are added in ResolveRootDirectoryAsTree method
                                                );

        return result1;
}

 

Which works really well my Directory code is code is - > 

   public override DirectoryItem ResolveRootDirectoryAsTree(string path)
{

        
        

        string physicalPath;
string virtualPath = string.Empty;       

if (PathHelper.IsSharedPath(path) || PathHelper.IsPhysicalPath(path))
{
physicalPath = path;

foreach (KeyValuePair<string, string> mappedPath in MappedPaths)
{

if (physicalPath.StartsWith(mappedPath.Value, StringComparison.CurrentCultureIgnoreCase))
{


string restOfPhysicalPath = physicalPath.Substring(mappedPath.Value.Length);


virtualPath = mappedPath.Key + restOfPhysicalPath.Replace('\\', '/');


virtualPath = PathHelper.AddEndingSlash(virtualPath, '/');
break;
}
}
}
else
{
virtualPath = PathHelper.AddEndingSlash(path, '/');
physicalPath = this.GetPhysicalFromVirtualPath(path);
           
if (physicalPath == null)
return null;
}

      


        DirectoryItem result = new DirectoryItem(PathHelper.GetDirectoryName(physicalPath),
string.Empty,
virtualPath,
string.Empty,
GetPermissions(physicalPath),
new FileItem[] { }, // Files are added in the ResolveDirectory method
GetDirectories(virtualPath)
);

        return result;
}

 

Any help would be much appreciated.

Ianko
Telerik team
 answered on 29 Sep 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?