Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
279 views

Hi,

I have used a 2 RadDatepicker controls, one for start date and one for end date.
When End Date is less than start date, i am triggering an error message But the problem is once i come back from error message
EndDate would still have new Date which i picked.. How can i set it back to original Date ??

Ex: Start Date : 1/1/1999  End Date 1/1/2000
I will Modify Modify  Start Date : 1/1/1999 End Date  1/1/1998

Now End Date should not be 1/1/1998 , it should be set back to 1/1/2000 on error.


below is code

  <telerik:GridTemplateColumn HeaderText="Start" UniqueName="fispersrt" DataField="fispersrt"
                                Visible="true">
                                <ItemTemplate>
                                    <telerik:RadDatePicker ID="rdDtStrtpkr" runat="server" SelectedDate='<%#Eval("fispersrt")%>'
                                        Width="100%" CssClass="txtbx" onchange="javascript:return DirtyFlagUpdate()">
                                        <ClientEvents OnDateSelected="OnDateSelected" />
                                    </telerik:RadDatePicker>
                                </ItemTemplate>
</telerik:GridTemplateColumn
<telerik:GridTemplateColumn HeaderText="End" UniqueName="fisperend" DataField="fisperend"
                                Visible="true">
                                <ItemTemplate>
                                    <telerik:RadDatePicker ID="rdDtEndpkr" runat="server" SelectedDate='<%#Eval("fisperend")%>'
                                        Width="100%" CssClass="txtbx" onchange="javascript:return DirtyFlagUpdate()">
                                        <ClientEvents OnDateSelected="OnDateSelected" />

                                    </telerik:RadDatePicker>
                                </ItemTemplate>
  </telerik:GridTemplateColumn>

  function OnDateSelected(sender, e) {
            if (e.get_newDate() < e.get_oldDate()) {
                DisplayErrorMessage('ERRSA20404', 'Error');

            }
        }

Regards,
Akki
Eyup
Telerik team
 answered on 21 Jun 2012
1 answer
238 views
I would like to disable some items in combo box when I click on button . What I am doing is on button click  I will show a rad window with a combo box , when that was loaded I would like to disable some items

My design is as follows

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="radWindow.aspx.cs" Inherits="radWindow" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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">
    <telerik:RadScriptManager ID="radScript" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behavior="Default"
            InitialBehavior="None">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Default" InitialBehaviors="None"
                    OpenerElementID="btn" Width="650" Height="480" VisibleOnPageLoad="false">
                    <ContentTemplate>
                        <telerik:RadComboBox ID="rdcmb" runat="server">
                            <Items>
                                <telerik:RadComboBoxItem Text="One" Value="One" />
                                <telerik:RadComboBoxItem Text="Two" Value="Two" />
                                <telerik:RadComboBoxItem Text="Three" Value="Three" />
                                <telerik:RadComboBoxItem Text="Four" Value="Four" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadTextBox ID="rdText" runat="server">
                        </telerik:RadTextBox>
                        <telerik:RadButton ID="radbtn" runat="server" Text="Save" OnClick="radbtn_Click">
                        </telerik:RadButton>
                    </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <asp:Button ID="btn" runat="server" OnClick="btn_Click" Text="Click" />
    </div>
    </form>
</body>
</html>

My code on button click is as follows

protected void btn_Click(object sender, EventArgs e)
    {
        foreach (RadComboBoxItem item in rdcmb.Items)
        {
            if (item.Text == "One" || item.Text == "Two")
            {
                item.Remove();
            }
        }
        RadWindowManager1.Windows[0].VisibleOnPageLoad = true;
    }

But I am unable to achieve the required.
Shinu
Top achievements
Rank 2
 answered on 21 Jun 2012
0 answers
83 views
I am using TreeList control with FormTemplate using MetroTouch skin. WHenever I click on add a record button, instead displaying form insert form under that record, the form always appear at the top of the TreeList.

Regards,
Imran Ahmad
Imran
Top achievements
Rank 1
 asked on 21 Jun 2012
3 answers
136 views

Hi
I have built a WCF Data service and I just want to ask what I should write to be able to work with it In a ODataService.

Here’s my WCF dataservice:

using System;
using System.Data.Objects;
using System.Data.Services;
using System.Data.Services.Common;
using System.Linq;
using System.ServiceModel.Web;
using DataServicesJSONP;
 
namespace BD2.Web.Services.WebService
{
    [System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    [JSONPSupportBehavior]
    public class Room : DataService<ObjectContext>
    {   
        public static void InitializeService(DataServiceConfiguration config)
        {
            config.SetServiceOperationAccessRule("GetTime", ServiceOperationRights.All);
            config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
        }
 
        [WebGet]
        public string GetTime()
        {
            return DateTime.Now.ToLongTimeString();
        }
    }
}

(The [JSONPSupportBehavior] is a script to remove dollar-signs from the jsonp that gives troubles with ODataservice. I got it from: http://stackoverflow.com/questions/2983078/cant-get-the-jsonp-working-with-wcf-data-services).
(I use ObjectContxt because I get data from Entity FrameWork Code FIrst. I got help for building it from: http://blogs.msdn.com/b/writingdata_services/archive/2012/05/05/10175174.aspx).

 

 I would like to read in the string from GetTime(). How should my ODataService then be like?:

<telerik:RadODataDataSource runat="server" ID="RadODataDataSource1">
           <Transport>
               <Read Url="http://localhost:52878/Services/WebService/Room.svc/" />
           </Transport>
           <Schema>
               <telerik:DataModel ModelID="GetTime" Set="???????" />
           </Schema>
</telerik:RadODataDataSource>

Thanks :o)

 

Genady Sergeev
Telerik team
 answered on 21 Jun 2012
4 answers
302 views

Could some one tell me why the code shown below is not firing the Edit Events when I click on the Edit Column, However, it fires when I click on the auto generated Edit column?


<telerik:RadGrid ID="dgRadERs" runat="server" AutoGenerateColumns="False" GridLines="None"
                    Skin="Sunset" AllowFilteringByColumn="True" OnEditCommand="dgRadERs_EditCommand"
                    AutoGenerateEditColumn="True" OnNeedDataSource="dgRadERs_NeedDataSource">
                    <MasterTableView EditMode="InPlace" DataKeyNames="ACCOUNT_NUMBER" AllowMultiColumnSorting="True"
                        Width="100%">
                        <Columns>
                            <telerik:GridBoundColumn DataField="account_number" HeaderText="Account Number" UniqueName="column1">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="account_name" HeaderText="Account Name" UniqueName="column">
                            </telerik:GridBoundColumn>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                            </telerik:GridEditCommandColumn>
                        </Columns>
                        <RowIndicatorColumn Visible="True">
                        </RowIndicatorColumn>
                        <EditFormSettings>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                </telerik:RadGrid>

Thank you
Maher

BabaYa
Top achievements
Rank 1
 answered on 21 Jun 2012
1 answer
203 views
Hi there, i've been looking at your session timeout notification demo, and i was wondering whether this could work in conjunction with the forms authentication ticket?

I'm sure it would be relatively straight forward, any chance you could point me in the right direction ?

Alan
Marin Bratanov
Telerik team
 answered on 21 Jun 2012
3 answers
478 views
Hello -
I am trying to display information in a Horizontal Bar chart. The Y axis information is a list of series that we care about. The names of the series are quite long as you will see from the screen shot.

I would like to display the Series Name along with the value where the actual value is currently displaying. Is that possible. If yes, can someone tell me how to do that?

Also is it possible to make the Chart move a little to the right and make sure the Legend space is utilized by the chart. Sometime I don't need a legend and would like to use that space instead.

thanks
Vamsi

In the picture, I would like to replace '38' with 'Determine ... Decision - 38'
Evgenia
Telerik team
 answered on 21 Jun 2012
9 answers
258 views
hi can i control RadToolBar height, i want height in 30px
i tried but nothing happened

 

<telerik:RadToolBar ID="RadToolBar1"  style="z-index:90001"   runat="server">
                                                   <Items>
                                                        
                                                       <telerik:RadToolBarDropDown >
                                                       <Buttons>
                                                               <telerik:RadToolBarButton   Text="Content Search" >
                                                        
                                                               </telerik:RadToolBarButton>
                                                          </Buttons>
                                                       </telerik:RadToolBarDropDown>
                                                         
                                                        
 
                                                      <telerik:RadToolBarButton   >
                                                      <ItemTemplate>
                                                          <telerik:RadTextBox ID="mainSearchTxt" runat="server">
                                                          </telerik:RadTextBox>
                                                      </ItemTemplate>
                                                      </telerik:RadToolBarButton>
                                                      <telerik:RadToolBarButton   Text="Search"  ></telerik:RadToolBarButton>
                                                   </Items>
                                                   </telerik:RadToolBar>

why the "Content Search" Text property of RadToolBarButton shown in 2 rows?
MarkSci
Top achievements
Rank 1
 answered on 21 Jun 2012
2 answers
621 views
Dear Telerik Support Team,

    I am working on a webpage having a Telerik:RadGrid control applied for displaying Event details. I have successfully filled the text columns using your control but need to include one more column having a checkbox in the leftmost column, i.e. one for every row, incluing the one on top for Select All. Can you suggest me how can I add this checkbox as a GridTemplateColumn in your "telerik:RadGrid" so that user can click on Select All checkbox to select/unselect the rest of checkboxes below and accordingly the actions can be carried out based on the Button user clicks (Edit / Delete in my case) for selected records, I kept right below your Grid control.

Regards
Samrat Banerjee
India

Najah
Top achievements
Rank 1
 answered on 21 Jun 2012
1 answer
186 views
How can I have a RadGrid with the following settings:
  1. Width = "100%"
  2. Autofit column width to content(Neither the column HeaderText nor the cell content should be truncated)
  3. Static Headers
  4. Horizontal Scroll bars
  5. Vertical Scroll bars

The number of columns in the grid are dynamic. I am able to get this effect only by specifying fixed width to the RadGrid and HeaderStyle.Width in pixels. But in this case the width of the column doesn't auto fit to the contents.


<telerik:RadGrid ID="rdgSample" runat="server"  Width="1200px">
     <MasterTableView  TableLayout="Fixed">
     </MasterTableView>
     <ClientSettings>
             <Scrolling AllowScroll="true" UseStaticHeaders="true" FrozenColumnsCount="2" />
     </ClientSettings>
     <HeaderStyle Width="250px" />
</telerik:RadGrid>
Pavlina
Telerik team
 answered on 21 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?