Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
222 views

I can't seem to trigger my validators within my FormTemplate on my grid. I can't find any examples of this either. Is it possible? Do I have to resort to using client side JS to manually trigger them on the submit?

 

<ValidationSettings EnableValidation="true" CommandsToValidate="PerformInsert,Update" />

<FormTemplate>
                                    <table>
                                        <tr>
                                            <td>Milestone Name: </td>
                                            <td>
                                                <asp:TextBox runat="server" Text='<%# Bind("Name") %>' ID="txtMilestoneName" />
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtMilestoneName" 
                                                    runat="server" ErrorMessage="* - Required Field"  Display="Dynamic" ValidationGroup="Milestone"
                                                    ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Pipline: </td>
                                            <td><asp:DropDownList runat="server" SelectedValue='<%# Bind("PipelineID") %>' ID="ddlPipline"
                                                ItemType="ONEOK.BusinessData.BusinessObjects.Pipeline"
                                            DataTextField="Name" DataValueField="PipelineID" SelectMethod="getPipelines" AppendDataBoundItems="true">
                                                <asp:ListItem Text="Select..." Value="0" />
                                            </asp:DropDownList>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="ddlPipline"
                                                    ErrorMessage="* - Required Field" InitialValue="" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>

                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Threshold Value: </td>
                                            <td>
                                                <asp:TextBox runat="server" Text='<%# Bind("MilestoneThresholdValue") %>' ID="txtMilestoneThresholdValue" />
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtMilestoneThresholdValue" runat="server" ErrorMessage="* - Required Field" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Latitude: </td>
                                            <td>
                                                <asp:TextBox runat="server" Text='<%# Bind("Latitude") %>' ID="txtLatitude" />
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtLatitude" runat="server" ErrorMessage="* - Required Field" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Longitude: </td>
                                            <td>
                                                <asp:TextBox runat="server" Text='<%# Bind("Longitude") %>' ID="txtLongitude" />
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ControlToValidate="txtLongitude" runat="server" ErrorMessage="* - Required Field" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td valign="top">Photo: </td>
                                            <td>
                                                <telerik:RadBinaryImage ID="rbiMilestone" DataValue='<%# Eval("Photo") %>' runat="server" />
                                                <telerik:RadAsyncUpload ID="radMilestoneImage" AllowedFileExtensions="jpg,jpeg,png,gif" runat="server" 
                                                     
                                                    AutoAddFileInputs="false" Localization-Select="Upload Image"></telerik:RadAsyncUpload>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>Milestone Information: </td>
                                            <td><telerik:RadEditor ID="radEventLongDesc" Content='<%# Bind("MilestoneInformation") %>' ContentAreaCssFile="~/content/rte.css" runat="server" Width="500px" ToolbarMode="PageTop" BackColor="White"></telerik:RadEditor></td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <asp:Button ID="btnUpdate" CausesValidation="true" ValidationGroup="Milestone" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button>&nbsp;
                                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                    CommandName="Cancel"></asp:Button>
                                            </td>
                                        </tr>
                                    </table>
                                </FormTemplate>

Eyup
Telerik team
 answered on 17 Aug 2016
5 answers
74 views
Hi, I have a RadGrid with collapsed rows. If I expand group 1 and modify data, and then expand group 2 to enter more data, the data in group1 is gone. Is this a bug or am I doing something wrong?
Eyup
Telerik team
 answered on 17 Aug 2016
1 answer
231 views

I am writing this simple page with two RadAjaxPanel as:

 

<html lang="en">
<body>
    <form runat="server">
        <telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
        <telerik:RadAjaxLoadingPanel runat="server" ID="rdProgressPanel"></telerik:RadAjaxLoadingPanel>

        <telerik:RadAjaxPanel ID="upd1" runat="server" LoadingPanelID="rdProgressPanel">
            <asp:Panel runat="server" ID="panel1">
                step 1
            <asp:Button Text="text" runat="server" OnClick="Unnamed_Click" />
            </asp:Panel>
        </telerik:RadAjaxPanel>

        <telerik:RadAjaxPanel ID="upd2" runat="server" LoadingPanelID="rdProgressPanel">
            <asp:Panel runat="server" ID="panel2">
                step 2            
            <asp:Button Text="text" runat="server" OnClick="Unnamed_Click1" />
            </asp:Panel>
        </telerik:RadAjaxPanel>
    </form>
</body>
</html>

 

On the server side, I have written to simply visible the panels as:

        protected void Unnamed_Click(object sender, EventArgs e)
        {
            panel1.Visible = false;
            panel2.Visible = true;
        }

        protected void Unnamed_Click1(object sender, EventArgs e)
        {
            panel1.Visible = true;
            panel2.Visible = false;
        }

 

Issue is, when I click first button that makes panel 2 visible and panel 1 invisible. But, when I click second button panel 2 is getting invisible but panel1 is not getting visible again.

Viktor Tachev
Telerik team
 answered on 17 Aug 2016
2 answers
62 views

Hi

I need to add some attributes to the data source so that when my JS function on the OnRequestEnd event is called it can interrogate the attributes.  

Most controls have the attributes but I cant seem to find anything for the ClientDataSource.

Any ideas?

Regards

Jon

Jon
Top achievements
Rank 1
 answered on 17 Aug 2016
13 answers
1.1K+ views
Need help resolving "Specified cast is not valid" error thrown when attempting to bind datatable to radgrid having checkbox column.

 

<telerik:gridtemplatecolumn headertext="Input" uniquename="TemplateColumn1">

  <itemtemplate>

    <asp:checkbox id="CheckBox1" runat="server" checked='<%# Eval("STATUS") %>' />  --> ERROR

  </itemtemplate>

  <edititemtemplate>

    <asp:checkbox id="CheckBox1" runat="server" checked='<%# Eval("STATUS") %>' />

  </edititemtemplate>

</telerik:gridtemplatecolumn>

 

Arivunidhi
Top achievements
Rank 1
 answered on 17 Aug 2016
32 answers
347 views

I am using RadGrid  with static headers and frozen column for bulk update of data exactly as provided by your LiveDemo: Grid-Dataediting-ClientEditBatchUpdates.

The Rad Grid is working as expected for all browsers (IE on windows, Safari on windows, Firefox on windows) , but we are facing problems on horizontal scroll in safari on IPad.

 

Problem : The horizontal scroll on the grid does not move the headers, but it moves the data content. The expected behavior : on horizontal scroll, the headers and data should move on scroll.

Remember we have frozen columns on the grid.

This behavior is not working  only on mobile Safari . The control works as expected on  IE - windows, Safari - windows, Firefox - windows.

 

The only difference between the livedemo Grid-Dataediting-ClientEditBatchUpdates and my code is I have added frozen column ( first 2) on the grid.

Dimo
Telerik team
 answered on 17 Aug 2016
13 answers
296 views
I have a problem with RadComboBox in IE 7.
When I use 

EnableScreenBoundaryDetection="true" (it is by default)

my IE 7 sometimes frozen and not respond  (in case when ComboBox seems like DropUp ComboBox with scroll because many Items).
Can you help me?

Thanks,
Dmitry

Dimitar
Telerik team
 answered on 17 Aug 2016
3 answers
134 views

I using webservice popolate data on RadSchedule. But when build load Resourece, I want to pass some parameter to load list Resource in MySchedulerProvider. How to call and code example??? When I using using:

private MySchedulerInfo _customParameter = new MySchedulerInfo();

        private IDictionary<int, Resource> _subjectId;

        private IDictionary<int, Resource> SubjectId
        {
            get
            {
                if (_subjectId == null)
                {
                    _subjectId = new Dictionary<int, Resource>();
                    foreach (Resource subjectId in LoadSubjectId(_customParameter.ClassId))
                    {
                        _subjectId.Add((int)subjectId.Key, subjectId);
                    }
                }

                return _subjectId;
            }
        }

        public override IEnumerable<Appointment> GetAppointments(ISchedulerInfo shedulerInfo)
        {
            List<Appointment> appointments = new List<Appointment>();

            MySchedulerInfo myInfo = shedulerInfo as MySchedulerInfo;

            if(myInfo != null)
            {
                _customParameter = myInfo;

                using (DbConnection conn = OpenConnection())
                {
                    DbCommand cmd = DbFactory.CreateCommand();

                    if (cmd != null)
                    {
                        cmd.Connection = conn;
                        cmd.CommandText = "SELECT [Id],[Class_Id],[School_Id],[Subject],[Description],[Begin_Date],[End_Date],[Recurrent_Rule],[Recurrence_Parent_Key],[Subject_Id],[Reminder] FROM [Class_Schedule] WHERE [Class_Id]=@ClassId;";
                        cmd.Parameters.Add(CreateParameter("@ClassId", myInfo.ClassId));

                        using (DbDataReader reader = cmd.ExecuteReader())
                        {
                            while (reader.Read())
                            {
                                Appointment apt = new Appointment();
                                apt.ID = reader["Id"];
                                apt.Subject = Convert.ToString(reader["Subject"]);
                                apt.Start = DateTime.SpecifyKind(Convert.ToDateTime(reader["Begin_Date"]), DateTimeKind.Utc);
                                apt.End = DateTime.SpecifyKind(Convert.ToDateTime(reader["End_Date"]), DateTimeKind.Utc);
                                apt.RecurrenceRule = Convert.ToString(reader["Recurrent_Rule"]);
                                apt.RecurrenceParentID = reader["Recurrence_Parent_Key"] == DBNull.Value ? null : reader["Recurrence_Parent_Key"];

                                if (reader["Reminder"] != DBNull.Value)
                                {
                                    IList<Reminder> reminders = Reminder.TryParse(Convert.ToString(reader["Reminder"]));
                                    if (reminders != null)
                                    {
                                        apt.Reminders.AddRange(reminders);
                                    }
                                }

                                if (apt.RecurrenceParentID != null)
                                {
                                    apt.RecurrenceState = RecurrenceState.Exception;
                                }
                                else
                                    if (apt.RecurrenceRule != string.Empty)
                                    {
                                        apt.RecurrenceState = RecurrenceState.Master;
                                    }

                                LoadResources(apt);

                                appointments.Add(apt);
                            }
                        }

                        cmd.Dispose();
                    }
                }
            }

            return appointments;
        }

 

But customParameter all way null object data.

 

Irene Alpen
Top achievements
Rank 1
 answered on 17 Aug 2016
3 answers
156 views
Hey everyone,

Thanks for reading. I have a RadHtmlChart and a SqlDataSource. The SqlDataSource is attached to a Stored Procedure that returns 2 columns: a date, and an amount.

I simply want to plot the dates along the X and the amount along the Y, however I'm having some difficulty achieving this. Please see the code below:

   
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1">
    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" DataSourceID="sdsDeclineReport" Width="600px" Height="400px">
        <PlotArea>
            <Series>
                <telerik:ScatterLineSeries DataFieldX="date" DataFieldY="amount">
                    <TooltipsAppearance Color="White" DataFormatString="{0:MM/dd}"></TooltipsAppearance>
                    <LabelsAppearance Visible="false">
                    </LabelsAppearance>
                </telerik:ScatterLineSeries>
            </Series>
        </PlotArea>
        <Legend>
            <Appearance Visible="false"></Appearance>
        </Legend>
        <ChartTitle Text="Declines"></ChartTitle>
    </telerik:RadHtmlChart>
</telerik:RadAjaxPanel>

 

The result looks like this:

 http://i.imgur.com/TGtKTNxl.png


The "Amount" column ranges from 0-20, and the dates go from 2016-01-01 to 2017-01-01. Can someone point me in the right direction here in regards to the lack of any data, as well as where I went wrong with the axes?

Thanks

 

Stamo Gochev
Telerik team
 answered on 17 Aug 2016
1 answer
140 views

Hello Telerik team,

 

we are using the RadAutocompleteBox in our .aspx-page. In the Page_Load-function we are binding the data like this:

protected void Page_Load(object sender, EventArgs e)
{
    var siteUrl = SPContext.Current.Web.Url;
 
    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
        using(var site = new SPSite(siteUrl))
        {
            using(var web = site.OpenWeb())
            {
                var dbaccess = new DBAccess(web);
 
                radComboPlz.DataSource = dbaccess.GetPlzListeDataTable();
                radComboPlz.DataBind();
            }
        }
    });
}

With our control we want to enable the user to search for zip codes. This is how the control looks like:

<telerik:RadAutoCompleteBox RenderMode="Lightweight" runat="server" ID="radComboPlz" EmptyMessage="" Skin="Windows7"
    DataTextField="PlzOrt" InputType="Text" MinFilterLength="2" AutoPostBack="False" Filter="StartsWith">
    <TextSettings SelectionMode="Single" />
</telerik:RadAutoCompleteBox>

Now let's assume we have some zip codes looking like this, "509511", "509678", "509144"....

We also have some zip codes looking like this, "501223", "501789", "501445"...

The main difference is that some have 509 for the first three digits the others begin with 501.

Now the problem that we encounter is somehow hard to reproduce because only a couple of users are experiencing it. For example if I type 509 in most cases the suggestions are looking as supposed, namely showing entries starting with 509 (see attached file "509.png"). While for some clients the autocompletion seems to stop after "50" and therefor returns entries staring with "501" (see attached File "501.png").

We are using the latest version of IE but also were able to reproduce the issue using other browsers (FireFox and Chrome). Is this a know issue, if so how to handle it? Might we be missing some parameter in the Control?

 

Regrads and thanks in advance!

 

Ivan Danchev
Telerik team
 answered on 17 Aug 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?