Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
91 views
I use a checkbox radbutton with two togglestates. From javascript how can I retrieve the checked state text? Please help.

Thanks
Katya
A2H
Top achievements
Rank 1
 answered on 29 Aug 2013
2 answers
169 views
Trying to implement RadToolTips for the first time, I don't like the thick border that appears as a default.  I've tried several things to reduce its size but with no luck.  How do I do this?

Note: I do not use Skins with Telerik controls so would appreciate a non-Skin solution.

Thank you,

Robert W.
Robert
Top achievements
Rank 1
 answered on 28 Aug 2013
10 answers
164 views


Hello I am using Rad grid as follow 

But I have problem of column header is shaking, cause of vertical scroll, it is hidden when less record are there and then it start shking on double click of grid.

Please find the attached image for your reference

headers shake to fill scroll widht.

<telerik:RadGridID="rgdImportExport"runat="server"OnGridExporting="rgdImportExport_GridExporting"
AutoGenerateColumns="false"OnNeedDataSource="rgdImportExport_NeedDataSource"
OnUpdateCommand="rgdImportExport_UpdateCommand"OnInsertCommand="rgdImportExport_InsertCommand"
OnItemDataBound="rgdImportExport_ItemDataBound"AllowPaging="true"Width="100%"
PageSize="10">
<MasterTableViewEditMode="PopUp"ShowHeadersWhenNoRecords="true"EnableNoRecordsTemplate="true"
CommandItemDisplay="Top"TableLayout="Auto"ItemStyle-Wrap="false"AlternatingItemStyle-Wrap="false">
<NoRecordsTemplate>
<divstyle="text-align:center;">
   Therearenorecordstodisplay
</div>
</NoRecordsTemplate>
<Columns>
<telerik:GridBoundColumnDataField="EmpNo"HeaderText="EmpNo"UniqueName="EmpNo">
<HeaderStyleWidth="10%"HorizontalAlign="Left"/>
<ItemStyleWidth="10%"HorizontalAlign="Left"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumnDataField="Name"HeaderText="Name"UniqueName="Name">
<HeaderStyleWidth="17%"HorizontalAlign="Left"/>
<ItemStyleWidth="17%"HorizontalAlign="Left"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumnDataField="EDAmount"HeaderText="EDAmount"UniqueName="EDAmount"
DataFormatString="{0:#0.00}">
<HeaderStyleWidth="15%"HorizontalAlign="Right"/>
<ItemStyleWidth="15%"HorizontalAlign="Right"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumnDataField="PeriodPaidFor"HeaderText="PaidFor"UniqueName="PeriodPaidFor">
<HeaderStyleWidth="10%"HorizontalAlign="Left"/>
<ItemStyleWidth="10%"HorizontalAlign="Left"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumnDataField="Reference"HeaderText="Remark"UniqueName="Reference">
<HeaderStyleWidth="12%"HorizontalAlign="Left"/>
<ItemStyleWidth="12%"HorizontalAlign="Left"/>
</telerik:GridBoundColumn>
<telerik:GridBoundColumnDataField="Notes"HeaderText="Notes"UniqueName="Notes">
<HeaderStyleWidth="12%"HorizontalAlign="Left"/>
<ItemStyleWidth="12%"HorizontalAlign="Left"/>
</telerik:GridBoundColumn>
<telerik:GridTemplateColumnHeaderText="FromDate"UniqueName="FromDate">
<ItemTemplate>
<asp:LabelID="lblFromDate"runat="server"></asp:Label>
</ItemTemplate>
<HeaderStyleWidth="12%"HorizontalAlign="Left"/>
<ItemStyleWidth="12%"HorizontalAlign="Left"/>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumnHeaderText="ToDate"UniqueName="ToDate">
<ItemTemplate>
<asp:LabelID="lblToDate"runat="server"></asp:Label>
</ItemTemplate>
<HeaderStyleWidth="12%"HorizontalAlign="Left"/>
<ItemStyleWidth="12%"HorizontalAlign="Left"/>
</telerik:GridTemplateColumn>
</Columns>
<EditFormSettingsEditFormType="Template">
<PopUpSettingsModal="True"Width="450px"/>
<FormTemplate>
<tableid="Table2"cellspacing="5"cellpadding="3"width="100%"border="0"rules="none"
style="border-collapse:collapse;background:white;">
<tr>
<td>
<tableid="Table3"cellspacing="5"cellpadding="3"width="100%"border="0">
<tr>
<tdalign="left"width="145px"class="textStyle1">
Employee:
</td>
<tdclass="textStyle1"align="left">
<%--<asp:TextBoxID="txtEmpNo"Width="145px"CssClass="textStyle1"runat="server"Text='<%#Bind("EmpNo")%>'>
</asp:TextBox>--%>
<Eilisys:EnquireEmployeeID="EnquireEmployee"runat="server"AccessType="PayrollManagement"
ClientEvent="OnClientEventRender"IsPredefinedBind="true"IncludeInactiveEmployees="true"
AccessForAllEmployees="true"/>
<asp:CustomValidatorrunat="server"ID="CVdtBillDate"ValidateEmptyText="true"Text="*"
ClientValidationFunction="ValidateEmpNo"EnableClientScript="true"Display="Dynamic"
ErrorMessage="Pleaseselectemployee"ValidationGroup="1">
</asp:CustomValidator>
</td>
</tr>
<trclass="textStyle1">
<tdalign="left"width="145px">
EDAmount:
</td>
<tdclass="textStyle1"align="left">
<asp:TextBoxID="txtAmount"Width="105px"CssClass="stdTextBoxEmpNoRight"runat="server"
Text='<%#Bind("EDAmount","{0:#0.00}")%>'>
</asp:TextBox>
<asp:RequiredFieldValidatorID="RFVEDAmount"runat="server"ControlToValidate="txtAmount"
Text="*"ValidationGroup="1"ErrorMessage="PleaseenterEDAmount">
</asp:RequiredFieldValidator>
<asp:CustomValidatorrunat="server"ID="CVEDAmount"ValidateEmptyText="false"Text="*"
ControlToValidate="txtAmount"ClientValidationFunction="ValidateEDAmount"EnableClientScript="true"
Display="Dynamic"ErrorMessage="PleaseentervalidEDAmount"ValidationGroup="1">
</asp:CustomValidator>
</td>
</tr>
<tr>
<tdalign="left"width="145px"class="textStyle1"nowrap="nowrap">
PaidFor:
</td>
<tdclass="textStyle1"align="left">
<%--<asp:TextBoxID="txtPaidFor"Width="145px"CssClass="textStyle1"runat="server"Text='<%#Bind("PeriodPaidFor")%>'>
</asp:TextBox>--%>
<asp:DropDownListID="ddlCurrMonth"runat="server"Width="105px"CssClass="stdDropDownNew">
</asp:DropDownList>
</td>
</tr>
<trid="trReference"runat="server">
<tdalign="left"width="145px"class="textStyle1"nowrap="nowrap">
Reference:
</td>
<tdclass="textStyle1"align="left">
<asp:TextBoxID="txtRemark"Width="240px"Height="40px"TextMode="MultiLine"MaxLength="30"
CssClass="textStyle1"runat="server"Text='<%#Bind("Reference")%>'>
</asp:TextBox>
<asp:RequiredFieldValidatorID="RFV1"runat="server"ControlToValidate="txtRemark"
Text="*"ValidationGroup="1"ErrorMessage="Pleaseenterremark">
</asp:RequiredFieldValidator>
<asp:CustomValidatorrunat="server"ID="CVtxtRemark"ValidateEmptyText="false"Text="*"
ControlToValidate="txtRemark"ClientValidationFunction="ValidateRemarklength"
EnableClientScript="true"Display="Dynamic"ErrorMessage="Only30charecterareallowedforreference"
ValidationGroup="1">
</asp:CustomValidator>
</td>
</tr>
<trid="trNotes"runat="server">
<tdalign="left"width="145px"class="textStyle1"nowrap="nowrap">
Notes:
</td>
<tdclass="textStyle1"align="left">
<asp:TextBoxID="txtNotes"Width="240px"Height="40px"CssClass="textStyle1"TextMode="MultiLine"
MaxLength="2000"runat="server"Text='<%#Bind("Notes")%>'>
</asp:TextBox>
<asp:RequiredFieldValidatorID="RequiredFieldValidator1"runat="server"ControlToValidate="txtNotes"
Text="*"ValidationGroup="1"ErrorMessage="Pleaseenternotes">
</asp:RequiredFieldValidator>
<asp:CustomValidatorrunat="server"ID="CVtxtNotes"ValidateEmptyText="false"Text="*"
ControlToValidate="txtNotes"ClientValidationFunction="ValidateNoteslength"EnableClientScript="true"
Display="Dynamic"ErrorMessage="Only2000charecterareallowedforreference"
ValidationGroup="1">
</asp:CustomValidator>
</td>
</tr>
<trid="trFromDate"runat="server">
<tdalign="left"width="145px"class="textStyle1"nowrap="nowrap">
FromDate:
</td>
<tdclass="textStyle1"align="left">
<telerik:RadDatePickerID="dtFromDate"runat="server"SkinID="ESSDatePicker"Width="105px"
MinDate="1900-01-01"DateInput-ClientEvents-OnError="onError">
<DateInputID="DateInput1"runat="server"ButtonsPosition="Left"DateFormat="dd/MM/yyyy"
DisplayDateFormat="dd/MM/yyyy"TabIndex="7">
</DateInput>
</telerik:RadDatePicker>
<asp:RequiredFieldValidatorID="RFVdtFromDate"runat="server"ControlToValidate="dtFromDate"
Text="*"ValidationGroup="1"ErrorMessage="Pleaseenterfromdate">
</asp:RequiredFieldValidator>
</td>
</tr>
<trid="trToDate"runat="server">
<tdalign="left"width="145px"class="textStyle1"nowrap="nowrap">
ToDate:
</td>
<tdclass="textStyle1"align="left">
<telerik:RadDatePickerID="dtToDate"runat="server"SkinID="ESSDatePicker"Width="105px"
MinDate="1900-01-01"DateInput-ClientEvents-OnError="onError">
<DateInputID="DateInput2"runat="server"ButtonsPosition="Left"DateFormat="dd/MM/yyyy"
DisplayDateFormat="dd/MM/yyyy"TabIndex="7">
</DateInput>
</telerik:RadDatePicker>
<asp:RequiredFieldValidatorID="RequiredFieldValidator2"runat="server"ControlToValidate="dtToDate"
Text="*"ValidationGroup="1"ErrorMessage="Pleaseentertodate">
</asp:RequiredFieldValidator>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<tdalign="center">
<br/>
<asp:ButtonID="btnUpdate"Text='<%#(ContainerisGridEditFormInsertItem)?"Insert":"Update"%>'
runat="server"TabIndex="4"CommandName='<%#(ContainerisGridEditFormInsertItem)?"PerformInsert":"Update"%>'
Width="59px"ValidationGroup="1"></asp:Button
<asp:ButtonID="btnCancel"TabIndex="5"Text="Cancel"runat="server"CausesValidation="False"
CommandName="Cancel"Width="59px"></asp:Button>
</td>
</tr>
<tr>
<tdalign="left"colspan="2">
<asp:ValidationSummaryID="ValidationSummary1"runat="server"ShowMessageBox="True"
ShowSummary="False"ValidationGroup="1"DisplayMode="List"/>
</td>
</tr>
</table>
</FormTemplate>
<EditColumnEditText="Edit"UpdateText="Edit">
<HeaderStyleWidth="25px"HorizontalAlign="Right"/>
<ItemStyleWidth="25px"HorizontalAlign="Right"/>
</EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<%--<ClientEventsOnKeyPress="CatchKeyPress"></ClientEvents>--%>
<SelectingAllowRowSelect="True"></Selecting>
<ClientEventsOnRowDblClick="OnRowClick"></ClientEvents>
<ScrollingAllowScroll="true"UseStaticHeaders="true"SaveScrollPosition="false"ScrollHeight="360px"/>
</ClientSettings>
<HeaderStyleWrap="true"/>
</telerik:RadGrid>
Pavlina
Telerik team
 answered on 28 Aug 2013
6 answers
240 views

I've posted this to the forum as well, feel free to respond to either this or the forum

I'm getting The Controls collection cannot be modified because the control contains code blocks (i.e. <%

Our code contains the following
<% if displaythis = False %>
.
.
<%else%>
.
.
<%end if%>

I've tried  <%# If displaythis = False Then %>  but that doesn't work, it doesn't even
compile. I've googled this to death and I'm at a complete loss at this point.
Any help is greatly appreciated.

I can't use the 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

<%If UseIcons = False Then %>

</telerik:RadCodeBlock>

bunch of code
.
.
.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

<%End If %>

</telerik:RadCodeBlock>

Pavlina
Telerik team
 answered on 28 Aug 2013
3 answers
763 views
Hi dear support,

I have a radgrid to which I query from my db with date conversion.
SelectCommand="SELECT [eventID], [eventName], CONVERT(VARCHAR(10),[date],103) as date, CONVERT(VARCHAR(5),[hour],108) as hour FROM [tblevents]"

When I make an event of "search_button"  I can reload the new datasource to the radgrid but I can't change the date format back.
I tried to use the "DataFormatString" property with the value {0:DD/MM/YYYY} but with not luck.

Will appreciate your help.

Thanks,
Tal

<%@ Page Title="" Language="C#" MasterPageFile="~/northTheatre.Master" AutoEventWireup="true"
    CodeBehind="eventsList.aspx.cs" Inherits="RadControlsWebApp2.eventsList" Culture="auto"
    meta:resourcekey="PageResource1" UICulture="auto" %>
     
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder3" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdateInitiatorPanelsOnly="True"
        meta:resourcekey="RadAjaxManager1Resource1">
    </telerik:RadAjaxManager>
    <p>
         </p>
    <asp:Panel ID="Panel2" runat="server" Height="91px" Style="margin-right: 243px; padding-right: 40px;"
        Width="750px" meta:resourcekey="Panel2Resource1">
         
        <div style="text-align:center">
        <table>
        <tr>
            <td>שם מופע
                <telerik:RadTextBox ID="eventName_t" runat="server">
                </telerik:RadTextBox> <br />
                מתאריך
                <telerik:RadDatePicker ID="fromDate" runat="server">
                </telerik:RadDatePicker><br />
                עד תאריך
                <telerik:RadDatePicker ID="toDate" runat="server">
                </telerik:RadDatePicker>
                <telerik:RadButton ID="searchButton" runat="server" Text="חפש"
                    onclick="searchButton_Click" >
                </telerik:RadButton>
            </td>
            <td>
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticInserts="True" Culture="he"
                AllowAutomaticUpdates="True" AllowFilteringByColumn="True" AllowPaging="True"
                AllowSorting="True" CellSpacing="0" DataSourceID="SqlDataSource1" GridLines="None"
                 meta:resourceKey="RadGrid1Resource1"
                FilterMenu-RegisterWithScriptManager="True" >
                <SortingSettings SortToolTip="לחץ כאן כדי למיין" />
                <ExportSettings>
                    <Pdf PageHeight="297mm" PageWidth="210mm" PaperSize="A4" />
                </ExportSettings>
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="eventID" DataSourceID="SqlDataSource1"
                    AllowAutomaticDeletes="True">
                    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    </ExpandCollapseColumn>
                     
                    <Columns>
                     
                         <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelText="ביטול" EditText="עריכה"
                            FilterControlAltText="Filter EditCommandColumn column" meta:resourceKey="GridEditCommandColumnResource1"
                            UpdateText="עדכון" EditImageUrl="Images/edit.png" HeaderStyle-BorderStyle=None UniqueName="aaa">
                        </telerik:GridEditCommandColumn>
                          <telerik:GridButtonColumn CommandName="Delete" ButtonType=ImageButton ImageUrl="Images/delete.gif" Display=true
                        ConfirmText="האם אתה בטוח שברצונך למחוק?"  HeaderStyle-BorderStyle=None></telerik:GridButtonColumn>
                      
                         
                        <telerik:GridBoundColumn DataField="eventID" DataType="System.Int32" FilterControlAltText="Filter eventID column"
                            HeaderText="מספר מופע" SortExpression="eventID" UniqueName="eventID" ReadOnly="True"
                            meta:resourceKey="GridBoundColumnResource1">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="eventName" FilterControlAltText="Filter eventName column"
                            HeaderText="שם מופע" SortExpression="eventName" UniqueName="eventName" meta:resourceKey="GridBoundColumnResource2">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="date" DataType="System.DateTime" FilterControlAltText="Filter date column"
                        DataFormatString="{0:dd/MM/yyyy}"
                            HeaderText="תאריך" SortExpression="date" UniqueName="date" meta:resourceKey="GridBoundColumnResource3">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="hour" DataType="System.TimeSpan" FilterControlAltText="Filter hour column"
                            HeaderText="שעה" SortExpression="hour" UniqueName="hour" meta:resourceKey="GridBoundColumnResource4">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column" UniqueName="EditCommandColumn1">
                        </EditColumn>
                    </EditFormSettings>
                 <%--   <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>--%>
                </MasterTableView>
               <%-- <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>--%>
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:tm2013ConnectionString %>"
                DeleteCommand="DELETE FROM [tblevents] where [eventID]=@eventID"
                UpdateCommand="UPDATE [tblevents] SET [eventName]=@eventName,[date]=@date,[hour]=@hour WHERE [eventID]=@eventID"
                SelectCommand="SELECT [eventID], [eventName], CONVERT(VARCHAR(10),[date],103) as date, CONVERT(VARCHAR(5),[hour],108) as hour FROM [tblevents]">
                <DeleteParameters>
                    <asp:Parameter Name="eventID" Type="Int32"></asp:Parameter>
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="eventName" Type="String"></asp:Parameter>
                    <asp:Parameter Name="eventID" Type="Int32"></asp:Parameter>
                </UpdateParameters>
            </asp:SqlDataSource>
            <br />
            </td>
            </tr>
            </table>
        </div>
        <telerik:RadButton ID="delButton" runat="server" OnClick="delButton_Click" Text="מחק רשומה נוכחית"
             meta:resourceKey="delButtonResource1">
        </telerik:RadButton>
              
        <telerik:RadButton ID="addNewEvent" runat="server" Text="הוסף מופע חדש" OnClick="addNewEvent_Click"
            meta:resourceKey="addNewEventResource1">
        </telerik:RadButton>
               
        <telerik:RadButton ID="RadButton3" runat="server" Text="הצג מפת אולם"
            OnClick="RadButton3_Click" meta:resourceKey="RadButton3Resource1">
        </telerik:RadButton>
    </asp:Panel>
    </asp:Panel>
</asp:Content>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace RadControlsWebApp2
{
    public partial class eventsList : System.Web.UI.Page
    {
        public static Itheatre_Funcs tFuncs = new Theatre_Funcs();  // an instance to the interface with functions
 
        protected void Page_Load(object sender, EventArgs e)
        {
            addNewEvent.Attributes.Add("onclick", "popupWindow('AddEvents_new.aspx','Add new event')");
            for (int i = 0; i < RadGrid1.FilterMenu.Items.Count; i++)
            {
                if (RadGrid1.FilterMenu.Items[i].Text == "EqualTo")
                {
                    RadGrid1.FilterMenu.Items[i].Text = "שווה ל";
                }
            }
        }
 
        protected void delButton_Click(object sender, EventArgs e)
        {
            int currentEventID = (int)RadGrid1.SelectedValue;
            tFuncs.removeEventFromSystem(currentEventID);
            RadGrid1.Rebind();
 
 
        }
 
        protected void addNewEvent_Click(object sender, EventArgs e)
        {
            addNewEvent.Attributes.Add("onclick", "popWin();return false;");
        }
 
        protected void RadButton3_Click(object sender, EventArgs e)
        {
            int currentEventID = (int)RadGrid1.SelectedValue;
            Response.Redirect("hallMapSpecific_new.aspx?eventID=" + currentEventID);
        }
 
        protected void RadGrid1_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            int currentEventID = (int)RadGrid1.SelectedValue; //event to update
            //      string eve = RadGrid1.MasterTableView.DataKeyValues[editeditems.
 
 
 
            //     var rows = RadGrid1.Rows;
            //    RadGrid1.
            //    int radGridClickedRowIndex = Convert.ToInt32(Request.Form["radGridClickedRowIndex"]);
            //int currentEventID= (int)RadGrid1.SelectedValue;
 
            //   int index = Convert.ToInt32(e.CommandArgument);
            //GridViewRow gvRow = (tblevent)RadGrid1.
            //   int eventName = RadGrid1.Columns.
            //   DataGridItem item = (DataGridItem)RadGrid1.MasterTableView.Items[radGridClickedRowIndex];
            // int eventID = gvRow.RowIndex;
 
 
            ////    tblevent event = tFuncs.getEventsTable().Where(x=>x.eventID =
            //   RadGrid1.MasterTableView.ClearEditItems();
            //    RadGrid1.Rebind();
 
 
        }
 
        protected void searchButton_Click(object sender, EventArgs e)
        {
            var events = tFuncs.GetAllEvents();
 
            IEnumerable<tblevent> resultsOfEventsSearch = null;
 
            string eventName;
            DateTime from=DateTime.MinValue;
            DateTime to = DateTime.MinValue;
 
 
            eventName = eventName_t.Text;
           
 
            if (fromDate.SelectedDate.HasValue)
            {
                from = (DateTime)fromDate.SelectedDate.Value;
            }
 
            if (toDate.SelectedDate.HasValue)
            {
                to = (DateTime)toDate.SelectedDate.Value;
            }
            RadGrid1.Rebind(); //refresh the grid
 
            if (!eventName.Equals("") && to != DateTime.MinValue && from != DateTime.MinValue)
            {
                resultsOfEventsSearch = events.Where(x => x.eventName.Equals(eventName) && (x.date <= to && x.date >= from));
            }
            else if ((eventName.Equals("") && to != DateTime.MinValue && from != DateTime.MinValue))
            {
                resultsOfEventsSearch = events.Where(x => x.date <= to && x.date >= from);
            }
            else if ((!eventName.Equals("") && to == DateTime.MinValue && from != DateTime.MinValue))
            {
                resultsOfEventsSearch = events.Where(x => x.eventName.Equals(eventName) && x.date >= from);
            }
            else if ((eventName.Equals("") && to == DateTime.MinValue && from != DateTime.MinValue))
            {
                resultsOfEventsSearch = events.Where(x => x.date >= from);
            }
            else if ((!eventName.Equals("") && to != DateTime.MinValue && from == DateTime.MinValue))
            {
                resultsOfEventsSearch = events.Where(x => x.eventName.Equals(eventName) && x.date <= to);
            }
            else if ((eventName.Equals("") && to != DateTime.MinValue && from == DateTime.MinValue))
            {
                resultsOfEventsSearch = events.Where(x => x.date <= to);
            }
            else if ((!eventName.Equals("") && to == DateTime.MinValue && from == DateTime.MinValue))
            {
                resultsOfEventsSearch = events.Where(x => x.eventName.Equals(eventName));
            }
            else if ((eventName.Equals("") && to == DateTime.MinValue && from == DateTime.MinValue))
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Error", "alert('יש למלא אחד מהשדות לפני החיפוש');", true);
                RadGrid1.Rebind();
                return;
            }
             
 
             
            RadGrid1.DataSource= resultsOfEventsSearch;
 
  
            RadGrid1.DataSourceID = String.Empty;
 
            RadGrid1.Rebind();
           
        }
 
 
    }
}
Tsvetoslav
Telerik team
 answered on 28 Aug 2013
1 answer
134 views
Hi there. I have a project that has a service reference to a web service. The web service has a function that takes a radTreeView as a parameter. The web service project compiles successfully by itself but, if I try to do a "Update Service Reference" with my main project it fails giving me this error:

Request format is unrecognized for URL unexpectedly ending in '/_vti_bin/ListData.svc/$metadata'.

Metadata contains a reference that cannot be resolved: 'http://localhost:49304/Service1.asmx'.
If the service is defined in the current solution, try building the solution and adding the service reference again.


However if I remove the radTreeView parameter it will update just fine. So I know it's some kind of issue with telerik not being declared correctly or something. Both of my project have the telerik.web.UI and skins in thier reference folder. Maybe I'm missing something in the web.config?

Here's the function declaration:

public void LoadSites(RadTreeView TreeSites, string Demogs){}

and here's my web services web.config:

<?xml version="1.0"?>
<configuration>
 
    <configSections>
      <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
            <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
            <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
            <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          </sectionGroup>
        </sectionGroup>
      </sectionGroup>
    </configSections>
 
  <appSettings>
    <add key="ProceduresByImpressionTableName" value="AMR_ProceduresByImpression" />
    <add key="MedsVersion" value="V3.7.0000.00000" />
  </appSettings>
  
  <connectionStrings>
    <add name="ePCR310_ServerConnectionString" connectionString="Data Source=10.0.151.2;Initial Catalog=ePCR310_Server;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="ePCR310_Prod" connectionString="Data Source=10.0.151.2;Initial Catalog=ePCR310_Production;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="ePCR310_Misc" connectionString="Data Source=10.0.151.2;Initial Catalog=ePCR309_Misc;Integrated Security=True" providerName="System.Data.SqlClient" />
     
  </connectionStrings>
    <system.web>
        <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        --><compilation debug="true">
          <assemblies>
            <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            <add assembly="Telerik.Web.UI, Version= 2013.2.611.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"/>
          </assemblies>
        </compilation>
    <!--
      The <authentication> section enables configuration
      of the security authentication mode used by
      ASP.NET to identify an incoming user.
    -->
    <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        --><authentication mode="Windows" />

      <pages>
        <controls>
          <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
          <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" />
        </controls>
      </pages>
 
      <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.
 
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        --><httpHandlers>
        <remove verb="*" path="*.asmx" />
        <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
            <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
            <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" />
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
      </httpHandlers>
      <httpModules>
        <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
      </httpModules>
    </system.web>
    <system.codedom>
      <compilers>
        <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          <providerOption name="CompilerVersion" value="v3.5" />
          <providerOption name="WarnAsError" value="false" />
        </compiler>
      </compilers>
    </system.codedom>
    <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false" />
      <modules>
        <remove name="ScriptModule" />
         
            <remove name="RadUploadModule" />
            <remove name="RadCompression" /><add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode,runtimeVersionv2.0" />
      </modules>
      <handlers>
        <remove name="WebServiceHandlerFactory-Integrated" />
        <remove name="ScriptHandlerFactory" />
        <remove name="ScriptHandlerFactoryAppServices" />
        <remove name="ScriptResource" />
         
            <remove name="ChartImage_axd" />
            <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
            <remove name="Telerik_Web_UI_DialogHandler_aspx" />
            <remove name="Telerik_RadUploadProgressHandler_ashx" />
            <remove name="Telerik_Web_UI_WebResource_axd" /><add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
            <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
            <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode,runtimeVersionv2.0" />
      </handlers>
    </system.webServer>
    <runtime>
      <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
          <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
        </dependentAssembly>
        <dependentAssembly>
          <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
          <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
        </dependentAssembly>
      </assemblyBinding>
    </runtime>
 
</configuration>


Boyan Dimitrov
Telerik team
 answered on 28 Aug 2013
1 answer
63 views
Is there a document somewhere that outlines what the order of events are for each control?

For example, when a grid has inline editing and the edit icon is clicked, what events are kicked off and in what order?

This would be extremely helpful to me so I can determine where to put certain server code in the code behinds.

Thanks!
Angel Petrov
Telerik team
 answered on 28 Aug 2013
5 answers
141 views
Hi ALL,
I have issue with resizing Radgrid which inside the Radpan (rpMiddlePane) -> contetnplaceholder(cphDailogPlaceHolder).  
I need to fit the grid in current page screen:
  1. When i resize the current window.
  2. When i collasps the Radsplitter to the Top and to the Right.
I went through the demo http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandsplitterresizing/defaultcs.aspx?product=splitter but didn't able solve the problem. I have posted sample code of my master page.

<div style="height: 100%;">
        <telerik:RadSplitter ID="MainSplitter" runat="server" Height="100%" Width="100%"
            Orientation="Horizontal" >
            <telerik:RadPane ID="TopPane" runat="server" Height="150" MinHeight="115" MaxHeight="150"
                Scrolling="none">
                <!-- Place the content of the pane here -->
                <!--Ribbonbar starts-->
                <telerik:RadTabStrip ID="rtsActionMenuToolBar" runat="server" MultiPageID="RadMultiPage1"
                    SelectedIndex="0" Style="padding-left: 5px;" ShowBaseLine="true">
                </telerik:RadTabStrip>
                <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" BackColor="Transparent">
                </telerik:RadMultiPage>
                <!--Ribbonbar ends-->
            </telerik:RadPane>
            <telerik:RadSplitBar ID="RadsplitbarTop" runat="server" CollapseMode="Forward"  />
            <!--Middle Content starts-->
            <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500">
                <telerik:RadSplitter ID="rsMainSplitter" runat="server" BorderSize="0" LiveResize="true"
                    ResizeWithBrowserWindow="true">
                    <telerik:RadPane ID="rpLeftPane" runat="server" Scrolling="None" Width="250">
                        <telerik:RadTreeView ID="rpbLeftPaneSections" DataValueField="URL" DataTextField="DisplayName"
                            runat="server" Width="250">
                        </telerik:RadTreeView>
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="rsbMidSplitterDialog" runat="server" CollapseMode="Forward">
                    </telerik:RadSplitBar>
                    <telerik:RadPane ID="rpMiddlePane" runat="server" >
                        <asp:ContentPlaceHolder ID="cphDialogPlaceHolder" runat="server">
                        </asp:ContentPlaceHolder>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
            <!--Middle Content ends-->
        </telerik:RadSplitter>
    </div>

I hope i can get the solution from you guys.... 

Thanks,
Abhishek K

Vessy
Telerik team
 answered on 28 Aug 2013
1 answer
125 views
I am creating a an htmlchart completely in the code behind.  I utilized one of the demos. 

I now want to extend that chart as a stacked column.  It works well.

Problem I am having is having the x-axis labels showing up.  if I do this, I get an index error

ch1.PlotArea.XAxis.Items.Item(0)...

Since I am declaring each series in the code, and each categoryseriesitem in a row loop, it is not databound in a traditional manner.  The following does not throw an error, but the x-axis label is not visible either
ch1.PlotArea.XAxis.DataLabelsField = "Name"

Any suggestions? This is close to being done, but this is the last piece.

Joel
Top achievements
Rank 2
 answered on 28 Aug 2013
4 answers
133 views
I need to customize the group headings and just can't figure it out.
I've read the documentation for customizing GridGroupHeaderItem and I've tried to follow the sample provided but it just isn't working quite right.

The issue is that I have more than one column that needs additional information in the header, so using e.item.DataItem doesn't help after the initial grouping. So how do I find the header and row data for the secondary groupings?

The grid needs to be able to group on all the columns that need customizing, but it won't be grouped when it loads. Grouping will be done if/when user chooses. So I can't follow the exmple provided in documentation which sets up the grouping declaratively when the grid loads.
Rayne
Top achievements
Rank 1
 answered on 28 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?