Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
142 views
Hi forum!

I'm trying to change the minutesperrow property throught a combobox. Whenever i change the selected index of the combo it goes to server side code (vb.net) and do RadScheduler1.MinutesPerRow = RadComboBox2.SelectedValue but nothing happens. can anyone help me please?

radcombo code:
<telerik:RadComboBox ID="RadComboBox2" runat="server" AutoPostBack="True">
<Items>
<telerik:RadComboBoxItem Text="10min" Value="10" />
<telerik:RadComboBoxItem Text="20min" Value="20" />
<telerik:RadComboBoxItem Text="30min" Value="30" />
<telerik:RadComboBoxItem Text="40min" Value="40" />
<%--<telerik:RadComboBoxItem Text="50min" Value="50" />
<telerik:RadComboBoxItem Text="60min" Value="60" />
<telerik:RadComboBoxItem Text="90min" Value="90" />
<telerik:RadComboBoxItem Text="120min" Value="120" />--%>
</Items>

radscheduler code:
<telerik:RadScheduler ID="RadScheduler1" runat="server" 
    Culture="Portuguese (Portugal)" DataEndField="Data_Consulta" 
    DataKeyField="Consulta_id" DataSourceID="SqlDataSource1" 
    DataStartField="Data_Consulta" DataSubjectField="Boletim_id" 
    DayEndTime="20:00:00" ShowFullTime="True" Skin="Windows7" 
    StartInsertingInAdvancedForm="True" WorkDayEndTime="20:00:00" 
    DayView-DayEndTime="20:00:00" DayView-WorkDayEndTime="20:00:00" 
    WeekView-WorkDayEndTime="20:00:00" WeekView-DayEndTime="20:00:00" 
    MultiDayView-WorkDayEndTime="20:00:00" MultiDayView-DayEndTime="20:00:00" 
    MinutesPerRow="10">
    <TimelineView StartTime="08:00:00" />
    <WeekView DayEndTime="20:00:00" WorkDayEndTime="20:00:00" />
    <MultiDayView DayEndTime="20:00:00" NumberOfDays="7" UserSelectable="True" 
        WorkDayEndTime="20:00:00" />
    <DayView DayEndTime="20:00:00" WorkDayEndTime="20:00:00" />
</telerik:RadScheduler>
server-side code:
Protected Sub RadComboBox2_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox2.SelectedIndexChanged
    RadScheduler1.MinutesPerRow = RadComboBox2.SelectedValue
    'RadScheduler1.GetCallbackResult()
End Sub
 Many Thanks, FEST
Veronica
Telerik team
 answered on 11 Sep 2011
1 answer
125 views
hi, is there any easy way to show the expanded nodes so that when you save the data, refresh the page and coming back, you still have the same nodes expanded as when you left?. In more details, I have a radtreeview and the user can add or edit nodes, expanding direferents branches. Then when the user clicks the Save button the data is saved on the database and the radtreeview is shown with all nodes collapsed.
In the code I must do some business cheks so when the user clicks the Save button I save the data, I deletes all nodes in the radtreeview, I create (populate) the radtreeview again bringing the data from the database; then I try to expand those nodes that were expanded but this last thing does not work.
The code I use is the next:

if (!DuplicateExists)
                    {
                        oBF.SaveManageLines(oAIlevel3List);
  
                        // Delete all nodes in the RadTreeView.
  
                        for (int a = 0; a < trTaxonomy.Nodes.Count; a++)
                        {
                            RadTreeNode oAICategory = trTaxonomy.Nodes[a];
                            for (int b = 0; b < oAICategory.Nodes.Count; b++)
                            {
                                RadTreeNode level1Node = oAICategory.Nodes[b];
                                if (level1Node.Nodes != null && level1Node.Nodes.Count > 0)
                                {
                                    for (int c = 0; c < level1Node.Nodes.Count; c++)
                                    {
                                        RadTreeNode level2Node = level1Node.Nodes[c];
                                        if (level2Node.Nodes != null && level2Node.Nodes.Count > 0)
                                        {
                                            for (int d = 0; d < level2Node.Nodes.Count; d++)
                                            {
                                                level2Node.Nodes.Clear();
                                            }
                                        }
                                    }
                                    level1Node.Nodes.Clear();
                                }
                            }
                            oAICategory.Nodes.Clear();
                        }
                        trTaxonomy.Nodes.Clear();                        
  
                        // Create the RadTreeeView again, bringing the values from the DB.
  
                        string[] ParamArray = new string[4];
                        int iLevelID = 1;
                        ParamArray[0] = iLevelID.ToString();
                        ParamArray[1] = "0";
                        ParamArray[2] = _PartnershipID.ToString();
                        ParamArray[3] = "1";
                        //BusinessFascade.Taxonomy oBF = new BusinessFascade.Taxonomy();
                        oBF = new BusinessFascade.Taxonomy();
                        dsAICategory = oBF.GetAllCategory(ParamArray);
                        foreach (AICategory ai in dsAICategory)
                        {
                            rootNode = new RadTreeNode(ai.Name);
                            rootNode.Value = ai.ID.ToString();
                            rootNode.Text = ai.Name + " (" + ai.TaxonomyCount + ")";
                            rootNode.Expanded = false;
                            rootNode.Checkable = false;
                            rootNode.AllowEdit = false;
                            rootNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                            trTaxonomy.Nodes.Add(rootNode);
                        }
                        rootNode = new RadTreeNode("State");
                        rootNode.Value = "-999";
                        rootNode.Text = "State";
                        rootNode.Expanded = false;
                        rootNode.Checkable = false;
                        rootNode.AllowEdit = false;
                        rootNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                        trTaxonomy.Nodes.Add(rootNode);
  
                        //Added node to show State Source Income Categories
                        rootNode = new RadTreeNode("State Source Schedule");
                        rootNode.Value = "-2";
                        rootNode.Text = "State Source Schedule";
                        rootNode.Expanded = false;
                        rootNode.Checkable = false;
                        rootNode.AllowEdit = false;
                        rootNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
                        trTaxonomy.Nodes.Add(rootNode);
  
  
                        // Expand the nodes. Review why is not working.
                        for (int w = 0; w < oAICategoryList.Count; w++)
                        {
                            ExpandNode(oAICategoryList[w]);
                        }
                        for (int z = 0; z < level1NodeList.Count; z++)
                        {
                            ExpandNode(level1NodeList[z]);
                        }
                        for (int y = 0; y < level2NodeList.Count; y++)
                        {
                            ExpandNode(level2NodeList[y]);
                        }
                        trTaxonomy.ExpandAllNodes();
                    }
                }
Andres
Top achievements
Rank 1
 answered on 11 Sep 2011
1 answer
113 views
Hi,

I am using radtextbox with PasswordStrengthSettings to check my password strength. (from the demo

Input / Password Strength Check)


OnClientPasswordStrengthCalculating="CalculatingStrength"

If the strength is 100 then user should be allowed to save the data. So how can I do this?

Thanks

Jayesh Goyani
Top achievements
Rank 2
 answered on 10 Sep 2011
1 answer
223 views

I'm trying to use JQuery to enable a Telerik RadComboBox based on the selection of another Telerik RadComboBox.

Use case: User comes to page, ddlRequired is enabled, ddlListItems is disabled. If user selects "Required" then I want ddlListItems to then be enabled. Conversely, if "Optional" is selected, I want to disable ddlListItems.


<telerik:RadComboBox ID="ddlRequired" runat="server" Width="80px" ShowDropDownOnTextboxClick="true" EnableEmbeddedSkins="false" Skin="Classic"  OnClientSelectedIndexChanged="OnSelectedIndexChanged">
                   
<Items>
                       
<telerik:RadComboBoxItem Text="Required" Value="1" />
                       
<telerik:RadComboBoxItem Text="Optional" Value="0" />
                   
</Items>
               
</telerik:RadComboBox>

               
<telerik:RadComboBox ID="ddlListItems" runat="server" Width="200px" ShowDropDownOnTextboxClick="true" EnableEmbeddedSkins="false" Skin="Classic" Enabled="false">
                   
<ItemTemplate>
                       
<asp:TextBox ID="txtBoxQ1" runat="server" Width="160"/>
                   
</ItemTemplate>
                   
<Items>
                       
<telerik:RadComboBoxItem />
                       
<telerik:RadComboBoxItem />
                   
</Items>
               
</telerik:RadComboBox>

Here's where I've left off after trying several approaches. I realize it's not complete.

function OnSelectedIndexChanged()
{
   
var ddl = $find("<%=ddlListItemsQ1.ClientID%>");
    ddl
.set_enabled(false);
}

Jayesh Goyani
Top achievements
Rank 2
 answered on 10 Sep 2011
1 answer
86 views
Hey,
How can I do something like the attached photo, and handle the search icon onClick event in server-side?
Jayesh Goyani
Top achievements
Rank 2
 answered on 10 Sep 2011
4 answers
453 views
I'm trying to Display the selected record in a asp.formview on the same page as the RadGrid.
When I click the 'Select' (GridButtonColumn) Button no Redirect occurs.
If I type in the entire Page URL with a QueryString value (http://10.0.0.110/Listing1.aspx?id=781) the formview displays the record.

Here is the code:

<telerik:RadGrid ID="RadGrid1" runat="server" 
                    AllowFilteringByColumn="True" 
                    AllowPaging="True" 
                    AllowSorting="True"
                    DataSourceID="SqlDataSource1" 
                    GridLines="None" 
                    Height="700px" 
                    PageSize="20"
                    <ClientSettings AllowColumnsReorder="True"
                        <Selecting AllowRowSelect="True" /> 
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
                    </ClientSettings
                    <MasterTableView datasourceid="SqlDataSource1" DataKeyNames="id"
                        <Columns
                            <telerik:GridButtonColumn CommandName="Redirect" Text="Select" ButtonType="PushButton" UniqueName="ButtonColumn"
                                <HeaderStyle Width="70px" /> 
                            </telerik:GridButtonColumn>  
                        </Columns
                        <RowIndicatorColumn
                            <HeaderStyle Width="20px"></HeaderStyle
                        </RowIndicatorColumn
                        <ExpandCollapseColumn
                            <HeaderStyle Width="20px"></HeaderStyle
                        </ExpandCollapseColumn
                        <NoRecordsTemplate
                            Sorry No Records Found, Modify your search and try again. 
                        </NoRecordsTemplate
                    </MasterTableView
                    <PagerStyle Position="TopAndBottom" /> 
                </telerik:RadGrid
CodeBehind:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    
        if (e.CommandName == "Redirect"
        
            GridDataItem item = (GridDataItem)e.Item; 
            string value = item.GetDataKeyValue("id").ToString(); // Get the value in clicked row   
            // Save the required  value in session   
            string url = "listing1.aspx?id=" + value; 
            Response.Redirect(url); 
        
    }

Thank you in advance!
Mike
M
Top achievements
Rank 1
 answered on 10 Sep 2011
1 answer
165 views
Hi all,

This is the first time I have used Telerik RadGrid and I am having trouble getting the basic sort to work.  I have a 5 column grid that is bound to an Entity Framework Entity.  I will post all my code below.  What is happening is, I click on the column header, I can see it go to the DelegateGrid_SortCommand code and the sortexpression and oldsortorder values look correct but after stepping out of the code the column is still not sorted.  BTW.   I got this code from the sample on the website.

I am not sure what I am missing.  I have 3 different grids on this page that will all need to have sort working.

Thanks in advance you for your help.

Rhonda

ASP Page code
<asp:ScriptManager ID="ScriptManager2" runat="server"></asp:ScriptManager>
  
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="DelegateGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="DelegateGrid" LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
  
   <asp:Panel ID="pnlDelegateMain" runat="server" Visible="true">
       <asp:Panel ID="pnlDelegate" runat="server" CssClass="roundedPanel" Visible="true">
            <div style="padding: 0 0 10px 20px; text-align: left">
                <asp:Label ID="pnlDelegateText" Font-Size="Small" Text="My Delegates" runat="server"></asp:Label>
            </div>
        </asp:Panel>
       <telerik:RadGrid ID="DelegateGrid" runat="server" Skin="WF" EnableEmbeddedSkins="false" AllowSorting="true" OnSortCommand="DelegateGrid_SortCommand" OnItemDataBound="DelegateGrid_ItemDataBound"  Visible="true" >
            <MasterTableView Width="100%" CommandItemDisplay="Bottom" AutoGenerateColumns="false">
                <Columns>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Delegate Name" UniqueName="Name" SortExpression="Name"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Apps" HeaderText="Applications" UniqueName="Apps"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LastVerified" HeaderText="Last Verified" UniqueName="LastVerified" SortExpression="LastVerified"></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ActionRequired" HeaderText="Action Required" UniqueName="ActionRequired" SortExpression="ActionRequired"></telerik:GridBoundColumn>
                    <telerik:GridHyperLinkColumn HeaderText = "Edit Delegate" DataTextField="Name" ItemStyle-HorizontalAlign="Left" UniqueName="EditDelegate" HeaderStyle-Font-Bold="false" HeaderStyle-Wrap="false" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="Delegate.aspx?Id={0}" HeaderStyle-Width="150px"></telerik:GridHyperLinkColumn>
                </Columns>
            </MasterTableView>
            <HeaderStyle BackColor="#666666" Font-Names="verdana, arial" Font-Size="Small" Height="20px" />
        </telerik:RadGrid>
        <asp:Panel ID="pnlAddDelegate" runat="server" Visible="true">
            <div class="portalPanel">
                <asp:HyperLink ID="AddDelegate" runat="server" NavigateUrl="~/Delegate.aspx" Text="+ Add New Delegate"></asp:HyperLink>
            </div>
        </asp:Panel>
        <asp:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server"
                BehaviorID="RoundedCornersBehavior1"
                TargetControlID="pnlDelegate"
                Radius="10"
                Corners="TopLeft, TopRight" />
                <br /><br />
    </asp:Panel>



Code behind.

public List<Entities.Delegate> delegates;
protected void Page_Load(object sender, EventArgs e)
{
   if (!Page.IsPostBack)
   {
       PopulateDelegatesGrid();
   }
}
  
  
public void PopulateDelegatesGrid()
        {
           delegates = BusinessUtility.GetDelegatesByManager("0");
  
            DelegateGrid.DataSource = delegates;
            DelegateGrid.DataBind();
        }
  
  
protected void DelegateGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridCommandItem)
            {
                GridCommandItem cmditm = (GridCommandItem)e.Item;
  
                cmditm.Visible = false;
                //hide add new button
                cmditm.FindControl("InitInsertButton").Visible = false;//hide the text
                cmditm.FindControl("AddNewRecordButton").Visible = false;//hide the image
  
                //hide Refresh button
                cmditm.FindControl("RefreshButton").Visible = false;//hide the text
                cmditm.FindControl("RebindGridButton").Visible = false;//hide the image
            }
  
            if (e.Item is GridDataItem)
            {
                GridDataItem dataBoundItem = e.Item as GridDataItem;
                string Name = dataBoundItem["Name"].Text;
                  
                foreach (Entities.Delegate d in delegates)
                {
                    if (Name == d.Name)
                    {
                        string AppList = string.Empty;
  
                        var applicationsNew = d.Applications;
  
                        foreach (ApplicationBase a in applicationsNew)
                        {
                            AppList = AppList + a.Name + " (" + a.WamId + ")</br>";
                            dataBoundItem["Apps"].Text = AppList;
                        }
                    }
                }
            }
        }
  
        protected void DelegateGrid_SortCommand(object source, GridSortCommandEventArgs e)
        {
            GridSortExpression sortExpression = new GridSortExpression();
            switch (e.OldSortOrder)
            {
                case GridSortOrder.None:
                    sortExpression.FieldName = e.SortExpression;
                    sortExpression.SortOrder = GridSortOrder.Descending;
                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpression);
                    break;
                case GridSortOrder.Ascending:
                    sortExpression.FieldName = e.SortExpression;
                    sortExpression.SortOrder = DelegateGrid.MasterTableView.AllowNaturalSort ? GridSortOrder.None : GridSortOrder.Descending;
                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpression);
                    break;
                case GridSortOrder.Descending:
                    sortExpression.FieldName = e.SortExpression;
                    sortExpression.SortOrder = GridSortOrder.Ascending;
                    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpression);
                    break;
            }
  
            e.Canceled = true;
            DelegateGrid.Rebind();
  
        }

Jayesh Goyani
Top achievements
Rank 2
 answered on 10 Sep 2011
1 answer
96 views
Hi;
I am using Telerik RadTreeView We have an unusual requirment of having two hyperlink in a single node.
please tell me how can i achive this functionality.
for More details please refer to screenCapture.
please reply ASAp as we have golive on Monday
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 09 Sep 2011
5 answers
578 views

I have some pages in my Project and then I created a Master page and begin to add my pages to the Master page

When suddenly appear this error message:

 

Error Creating Control - telerik:radajaxmanager'AjaxSettings' could not be initialized. Details: [A]Telerik.Web.UI.RadAjaxManager cannot be cast to [B]Telerik.Web.UI.RadAjaxManager. Type A originates from 'Telerik.Web.UI, Version=2008.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' in the context 'LoadNeither' at location 'C:\Documents and Settings\y.ramirez\Configuración local\Datos de programa\Microsoft\VisualStudio\9.0\ProjectAssemblies\1o26-o5n01\Telerik.Web.UI.dll'. Type B originates from 'Telerik.Web.UI, Version=2008.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4' in the context 'LoadNeither' at location 'C:\Documents and Settings\y.ramirez\Configuración local\Datos de programa\Microsoft\VisualStudio\9.0\ProjectAssemblies\0kkaeir201\telerik.web.ui.dll'.

 

I solve the problem by doing the following:


1. remove the toolbox tag for Telerik controls in VS.
2. remove the Reference of Telerik from the Project in VS.
3. Exit VS with save changes option.
4. Use  "Register RadControls for ASPNET AJAX Q1 2008 items in the Visual Studio toolbox"

 

But when I close VS and then open it the error appears once again.

What can I do?

 

bernard
Top achievements
Rank 1
 answered on 09 Sep 2011
9 answers
950 views
Hello,

I am using RadListBox. I am creating the control at run time and all the properties are set at run-time. CheckBox property is set to true.

Items in the checked list box are loaded at run time. We have also added a default "All" item at 0th index in the RadListBox.

When user clicks on "All", we want all the items in the list to be checked.
If the user unchecks-"All", all the items should be unchecked
If the user unchecks any other item in the list, then that item and "All" should be unchecked.

How do we implement the above scenarios?

Regards,
Whidbey boy

Larry
Top achievements
Rank 1
 answered on 09 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?