Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
188 views

I was newbie in Kendo Ui and also javascript programming. I have a simple question how to submit the value from my checkbox to dataSource transport : read?

so "getData.php" able to get "c1" value (active) and reload the page again.

Here I provide my code? Hope someone can help me. Thank You.

My checkbox :

<input type="checkbox" id="c1" name="checkbox1" class="k-checkbox" checked="checked"  value="active" onclick="checkBox()">

 

Javascript code for checkbox:

$(function() {
    var dataSource = new kendo.data.DataSource({
   transport: {
              read: {
                       url: "/getData.php",
               type: "POST"
              }
              },
                schema: {
                    model: {
                        id: "segmentID"
                              }
              }
    });
});
 
function checkBox() {
     
    var checkbox = document.getElementById("c1");
     
    if (checkbox.checked == true) {

 

        $("#grid").data("kendoGrid").dataSource.read(checkBox.value);
    } else {
        if (checkBox.value == 'active') {
            var x = 'inactive';
        }
        $("#grid").data("kendoGrid").dataSource.read(x);
    }
     
}
yazid
Top achievements
Rank 1
 asked on 21 Dec 2018
4 answers
181 views

Hi,

When I try to replace a white space in RadEditor, it only able to replace at the first line, second line and onwards are not able to replace.

Step:

1. Open 'Find And Replace' dialog.

2. Go to 'Replace' tab.

3. Enter a white space for 'Find' text box.

4. Enter any character or word for 'Replace With' text box.

5. Hit on 'Replace All' button.

Notice that only the white spaces at the first line are able to replace. How do I avoid it? I am able to reproduce it in demo site: https://www.telerik.com/forums/aspnet-ajax/general-discussions?newThread=/forums/aspnet-ajax/general-discussions

 

Thank you.

Rumen
Telerik team
 answered on 20 Dec 2018
3 answers
188 views

Hi,

I'm missing the opportunity to zoom in by double clicking on the map. Is there a way to detect a double click in the client?

 

Kind regards

Robert

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 20 Dec 2018
1 answer
199 views

I need to take a recurring event that was set up in the kendo scheduler and unpack it so i can get an entry for each date. I am using iCal.Net to do this.

 

It works as expected for recurring events, but when i delete an occurrence from the recurring event and try to pass kendoEvent.RecurrenceException to iCalEvent.ExceptionDates.Add(new PeriodList(kendoEvent.RecurrenceException) I get a null reference exception when i call iCal-Calendar.GetOccurrences.

 

Do I need to do something when converting between kendo and ical?

 

TIA

 

My code is:

 

public static List<Occurrence> UnpackRecurrence(ISchedulerEvent scheduleEvent, DateTime? start = null, DateTime? end = null)
        {
            List<Occurrence> rVal = new List<Occurrence>();
            if (string.IsNullOrWhiteSpace(scheduleEvent.RecurrenceRule) == false)
            {
                var recurrencePattern = new RecurrencePattern(scheduleEvent.RecurrenceRule);
                iCalendar calendar = new iCalendar();
                Event evnt = new Event()
                {
                    Start = new iCalDateTime(scheduleEvent.Start),
                    End = new iCalDateTime(scheduleEvent.End)
                };
                evnt.RecurrenceRules.Add(recurrencePattern);
 
                if (string.IsNullOrWhiteSpace(scheduleEvent.RecurrenceException) == false)
                {
                    evnt.ExceptionDates.Add(new PeriodList(scheduleEvent.RecurrenceException));
                }
 
                calendar.Events.Add(evnt);
 
                start = start ?? scheduleEvent.Start;
                if (end == null)
                {
                    if (recurrencePattern.Until != DateTime.MinValue)
                    {
                        end = recurrencePattern.Until;
                    }
                    else if (recurrencePattern.Count > 0)
                    {
                        end = DateTime.Now.AddYears(recurrencePattern.Count);
                    }
                    else
                    {
                        end = DateTime.Now.AddYears(5); // we probably shouldn't hit this
                    }
                }
 
                rVal = calendar.GetOccurrences(new iCalDateTime(start.Value), new iCalDateTime(end.Value)).ToList();
            }
 
            return rVal;
        }

 

Veselin Tsvetanov
Telerik team
 answered on 20 Dec 2018
1 answer
191 views

I'm trying to use RadEditor.

<telerik:RadEditor runat="server" ID="RadEditor1" Skin="Silk" Height="675px" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"
        Toolsfile="/common/_private/config/TelerikToolsFile.xml" ContentFilters="EncodeScripts"
        ExternalDialogsPath="/common/controls/TelerikEditorDialogs/" ContentAreaMode="iframe"
        EnableResize="false" OnClientPasteHtml="OnClientPasteHtml" OnClientLoad="OnClientLoad" >         
</telerik:RadEditor>

 

It's returning an error when I click on Fonts dropdown and it doesn't show the dropdown values. See the attachment

 

Rumen
Telerik team
 answered on 20 Dec 2018
1 answer
219 views

I'm trying to use RadEditor.

<telerik:RadEditor runat="server" ID="RadEditor1" Skin="Silk" Height="675px" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"
        Toolsfile="/common/_private/config/TelerikToolsFile.xml" ContentFilters="EncodeScripts"
        ExternalDialogsPath="/common/controls/TelerikEditorDialogs/" ContentAreaMode="iframe"
        EnableResize="false" OnClientPasteHtml="OnClientPasteHtml" OnClientLoad="OnClientLoad" >         
</telerik:RadEditor>

It's returning an error when I click on Fonts dropdown and it doesn't show the dropdown values. See the attachment

Rumen
Telerik team
 answered on 20 Dec 2018
5 answers
561 views

Hi,

I have problem about image manager.

404 File or directory not found when I click image manager in rareditor's  

Please see the attach files, help me to fix it.

Thank you.

Rumen
Telerik team
 answered on 20 Dec 2018
15 answers
2.6K+ views

HI,

I have a RadGrid having a checkbox column, i have added the column as a ItemTemplate to make it editable in the regular mode.

<telerik:GridTemplateColumn UniqueName="IsSelected" DataField="IsSelected">
    <ItemTemplate>
       <asp:CheckBox ID="chkBoolean" runat="server" Checked='<%# Convert.ToBoolean(Eval("IsSelected")) %>'
       Enabled='<%# Convert.ToBoolean(Eval("IsSelectionDisable")) %>' />
    </ItemTemplate>
</telerik:GridTemplateColumn>

Using this I am able to display a checkbox as editable. Now my problem is how do i get the checked value of the checkox for saving it  when the user has changed the checkbox. On click of a button i need to get all the rows that are still checked and save them.

Thanks
Arvind
Eyup
Telerik team
 answered on 20 Dec 2018
3 answers
218 views
When looking at the Telerik website forums called UI for ASP.NEXT Ajax I have the following questions:
1. it looks like you have an option to have html generated by an asp.net form can either edit your applications' html or not.To be able to have your html edited or not would you show me/tell me how to to set this up? **I would assume this is a web.config file setting
2. Does the radedior generate its own html? IF so, does the radeditor generate the html to fix html errors? If so how can you have the radeditor not generate its own html?
Rumen
Telerik team
 answered on 19 Dec 2018
4 answers
354 views

Requirements

RadControls version 2011.1.519.40
.NET version 4.0
Visual Studio version 2010
programming language C#
browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
Here I have one radgrid in which I have two boundcolumns and others are I have added dynamically at runtime "GridTemplateColumn" from code behind. In which I have added one check box control in ItemTemplate. Here also I have one save button outside of the radgrid. Now when I am clicking on that save button I can getting that checkbox added dynamically in columns on click of save button.


Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadButton1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="lblColumn1" />
                        <telerik:AjaxUpdatedControl ControlID="lblColumn2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
    </div>
    <div>
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" OnNeedDataSource="RadGrid1_NeedDataSource"
            OnItemDataBound="RadGrid1_ItemDataBound" OnPreRender="RadGrid1_PreRender">
            <MasterTableView DataKeyNames="ID">
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" HeaderText="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Name">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <br />
        <telerik:RadButton ID="RadButton1" Text="Click for selected item" runat="server"
            OnClick="RadButton1_Click">
        </telerik:RadButton>
        <br />
        <asp:Label ID="lblColumn1" runat="server"></asp:Label>
         
    </div>
    </form>
</body>
</html>


Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using System.Text;
 
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        // you can dynamically add multiple column by for each loop
 
        foreach (DataRow dr in Class1.GetDataTable().Rows)
        {
            GridTemplateColumn objGridTemplateColumn = new GridTemplateColumn();
            objGridTemplateColumn.HeaderText = dr["ColumnUniqueName"].ToString();
            objGridTemplateColumn.UniqueName = dr["ColumnUniqueName"].ToString();
            objGridTemplateColumn.ItemTemplate = new MyTemplate(dr["ColumnControlID"].ToString());
            RadGrid1.MasterTableView.Columns.Add(objGridTemplateColumn);
        }
 
    }
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        dynamic data = new[] {
                new { ID = 1, Name ="Name1",Isbool = true},
                new { ID = 2, Name = "Name2",Isbool = false},
                new { ID = 3, Name = "Name3",Isbool = true},
                new { ID = 4, Name = "Name4",Isbool = false},
                new { ID = 5, Name = "Name5",Isbool = true},
                new { ID = 6, Name ="Name6",Isbool = true},
                new { ID = 7, Name = "Name7",Isbool = false},
                new { ID = 8, Name = "Name8",Isbool = true},
                new { ID = 9, Name = "Name9",Isbool = true},
                new { ID = 10, Name = "Name10",Isbool = false}
            };
 
        RadGrid1.DataSource = data;
    }
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        StringBuilder sb = new StringBuilder();
 
        foreach (GridDataItem item in RadGrid1.Items)
        {
            foreach (DataRow dr in Class1.GetDataTable().Rows)
            {
                CheckBox objCheckBox = (CheckBox)item[dr["ColumnUniqueName"].ToString()].Controls[0];
                if (objCheckBox.Checked)
                {
                    sb.Append(dr["ColumnUniqueName"].ToString() + " : " + item.GetDataKeyValue("ID").ToString());
                    sb.Append("</br>");
                }
            }
        }
 
        lblColumn1.Text = sb.ToString();
    }
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = e.Item as GridDataItem;
 
            foreach (DataRow dr in Class1.GetDataTable().Rows)
            {
                if(dr["ColumnUniqueName"].ToString() == "CheckBoxColumn1")
                {
                    if (Convert.ToInt32(item.GetDataKeyValue("ID")) == 1 || Convert.ToInt32(item.GetDataKeyValue("ID")) == 3)
                    {
                        CheckBox chkTemp = (CheckBox)item[dr["ColumnUniqueName"].ToString()].Controls[0];
                        chkTemp.Checked = true;
                    }
                }
                else if (dr["ColumnUniqueName"].ToString() == "CheckBoxColumn2")
                {
                    if (Convert.ToInt32(item.GetDataKeyValue("ID")) == 2 || Convert.ToInt32(item.GetDataKeyValue("ID")) == 4)
                    {
                        CheckBox chkTemp = (CheckBox)item[dr["ColumnUniqueName"].ToString()].Controls[0];
                        chkTemp.Checked = true;
                    }
                }
            }
        }
    }
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        int count = 0;
        foreach (GridColumn column in RadGrid1.Columns)
        {
            count++;
            if (count > Class1.GetDataTable().Columns.Count + 2)
            {
                column.Visible = false;
            }
        }
    }
}
 
public class MyTemplate : ITemplate
{
 
    protected CheckBox boolValue;
    private string colname;
 
    public MyTemplate(string cName)
    {
        colname = cName;
    }
 
    public void InstantiateIn(System.Web.UI.Control container)
    {
        boolValue = new CheckBox();
        boolValue.ID = colname;
        container.Controls.Add(boolValue);
    }
    void boolValue_DataBinding(object sender, EventArgs e)
    {
        CheckBox cBox = (CheckBox)sender;
        GridDataItem container = (GridDataItem)cBox.NamingContainer;
    }
 
}


Class1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
 
/// <summary>
/// Summary description for Class1
/// </summary>
public class Class1
{
    public Class1()
    {
        //
        // TODO: Add constructor logic here
        //
    }
    public static DataTable GetDataTable()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("ColumnID",typeof(Int32));
        dt.Columns.Add("ColumnUniqueName", typeof(string));
        dt.Columns.Add("ColumnControlID", typeof(string));
 
        dt.Rows.Add(1, "CheckBoxColumn1", "CheckBox1");
        dt.Rows.Add(2, "CheckBoxColumn2", "CheckBox2");
 
        return dt;
    }
}

Thanks,
Jayesh Goyani
ramesh
Top achievements
Rank 1
 answered on 19 Dec 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?