Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
90 views
Hi,
i am binging scheduler with ef datasource.but it always insert pk 00000-0000.And i have another problem.i add resource which i want to save email it automatically adds combobox?how i can change it with textbox?any solution?

  <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="ENDDATE"
                    DataKeyField="RESERVATIONID" DataSourceID="EntityDataSource1"
                    DataStartField="STARTDATE" DataSubjectField="SUBJECT">
                    <ResourceTypes>
                        <telerik:ResourceType DataSourceID="EntityDataSource1" KeyField="NAMESURNAME"
                            Name="AD SOYAD" TextField="NAMESURNAME" ForeignKeyField="NAMESURNAME" />
                        <telerik:ResourceType DataSourceID="EntityDataSource1" KeyField="PHONE"
                            Name="TELEFON" TextField="PHONE" ForeignKeyField="PHONE" />
                    </ResourceTypes>
                </telerik:RadScheduler>
                <asp:EntityDataSource ID="EntityDataSource1" runat="server"
                    ConnectionString="name=CCEntities" DefaultContainerName="CCEntities"
                    EnableDelete="True" EnableFlattening="False" EnableInsert="True"
                    EnableUpdate="True" EntitySetName="RESERVATIONS">
                </asp:EntityDataSource>
Teoman
Top achievements
Rank 1
 asked on 12 Sep 2011
2 answers
662 views

Hi

I have a RadGrid in which is some data. One of the columns of data is an nvarchar(MAX) filed in which there could be a little to a lot of text, at the prerogative of the user.

I'm trying find a way to read the text out of the grid, modify it to be truncated down to say the first 50 characters, and put it back in the cell.

I found this page on this site that talks about this exact issue. Alas the code here does work.

http://www.telerik.com/help/aspnet/grid/grdaccessingcellsandrows.html

The code on this page says I can read the cell value with this syntax

TableCell cell = dataItem["ColumnUniqueName"];

Alas this does not work as 'dataItem' does not exist.

I have tried this code in my grids ItemDataBound method,

protected void rgNotes_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem && e.Item.OwnerTableView.DataSourceID == "dsNotes")
    {
        TableCell cell = dataItem["NoteText"];
    }
}

I even tried
TableCell cell = e.Item["NoteText"];

to no avail.

Anyone here have a solution to this, what should be a pretty obvious' issue?

Brad



Brad
Top achievements
Rank 1
 answered on 12 Sep 2011
1 answer
69 views
How to add Paste Options drop down tool?
Rumen
Telerik team
 answered on 11 Sep 2011
10 answers
103 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
106 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
93 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
190 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
70 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
405 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
124 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
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?