Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
185 views

I would like to use a DateTimePicker to allow setting of both date and time, then, when a button is pressed, at the server, read the selected DateTime.

I have tried several different combinations, including the approach described here:

http://www.telerik.com/help/aspnet/calendar/cldpickerserverevents.html

with a javascript pop-up and AutoPostBackControl="Both" on the RadDateTimePicker.

When I click on the calendar, I can change the date, then, when Button is submitted, I can see that date as 

RadDateTimePicker1.SelectedDate.Value, but when I update the time with the pop-up, the changed time is not reflected on postback.

Does use of  a DateTimePicker require two DateInput controls?  Is there a better demo/sample code to work from?


Thanks!

Some of the code:

 

<telerik:RadDateTimePicker ID="RadDateTimePicker1" 

 

Style="vertical-align: middle;" Width="200px"

 

 

MinDate="2006-02-01" runat="server" SelectedDate="2006-04-01"

 

MaxDate="2099-12-16" OnRequestStart="OnRequestStart"

 

Culture="English (United States)" FocusedDate="2006-02-01" AutoPostBackControl="Both" >

 

<TimePopupButton ImageUrl="" HoverImageUrl=""></TimePopupButton>

 

<TimeView CellSpacing="-1" runat="server"

 

Interval="00:15:00"></TimeView>

 

<DateInput runat="server" onclick="ToggleDateTimePickerPopup()" DateFormat="D"

 

AutoPostBack="True">

 

</DateInput>

 

<Calendar runat="server"

 

UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>

 

<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>

 

</telerik:RadDateTimePicker>

 

<script type="text/javascript">

 

function ToggleDateTimePickerPopup() {

 

$find(

 

 

"<%= RadDateTimePicker1.ClientID %>").showPopup();

}

 

 

function OnRequestStart(target, arguments) {

arguments.set_enableAjax(

 

false);

}

 

 

</script>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

 

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

 

 

 

 

Jon
Top achievements
Rank 1
 answered on 14 May 2009
2 answers
132 views

 

Hi,

I have the simple code below. I just wanted to make a panelbar with sliding panels like in your most simple example. The panel below shows all panels one under the other with their respective headers, but nothing happens when clicking the headers. The colapse/expand arrow is not shown either. What did I miss?

Thanks,
Cristian

 

<telerik:RadPanelBar ID="RadPanelBar1" Runat="server"   
        CausesValidation="False" Skin="WebBlue"   
        ExpandMode="FullExpandedItem">  
        <Items> 
            <telerik:RadPanelItem runat="server" ChildGroupHeight="100px"   
                ImagePosition="Right" PostBack="False" Text="Filtru corporate" Value="1" Expanded="true">  
                <ItemTemplate> 
                    fsdfsfsadf  
                </ItemTemplate> 
            </telerik:RadPanelItem> 
            <telerik:RadPanelItem runat="server" ChildGroupHeight="200px"   
                ImagePosition="Right" PostBack="False" Text="X" Value="2">  
                <ItemTemplate> 
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
                </ItemTemplate> 
            </telerik:RadPanelItem> 
        </Items> 
    </telerik:RadPanelBar> 

 

 

 

Cris
Top achievements
Rank 1
 answered on 14 May 2009
2 answers
103 views
I have the following radGrid - I have two problems with it. This is not the entire .aspx page - a  masterpage file is embedded within this page , also there are other tables. The relevant code is posted below.

1) When I hit edit on the record, the entire table collapses - I cannot see anything - can someone please explain me why?  Also - the delete works fine.
2) There is only one record being shown in the radGrid when I bind to the datasource. 

 

<telerik:RadGrid ID="gridInvLines" AllowMultiRowSelection="true" AllowMultiRowEdit="true"

 

 

Skin="Office2007" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"

 

 

Width="100%" PageSize="14" AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False"

 

 

DataSourceID="odsInvLines" ShowStatusBar="true" EnableAJAX="true" EnableAJAXLoadingTemplate="true"

 

 

LoadingTemplateTransparency="50">

 

 

<PagerStyle Mode="Slider" />

 

 

<ClientSettings>

 

 

<Selecting AllowRowSelect="true" />

 

 

</ClientSettings>

 

 

<MasterTableView CommandItemDisplay="Top" DataKeyNames="LINE_NUMBER" DataSourceID="odsInvLines"

 

 

EditMode=InPlace" AutoGenerateColumns="False" Width="100%">

 

 

<Columns>

 

 

 

<telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateText="Save" CancelText="Cancel"

 

 

UniqueName="EditColumn">

 

 

<HeaderStyle Width="20px" />

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridEditCommandColumn>

 

 

 

<telerik:GridTemplateColumn>

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

<ItemTemplate>

 

 

<a href="">Copy</a>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn DataField="LINE_NUMBER" HeaderText="Line Number"

 

 

UniqueName="LINE_NUMBER" ReadOnly="True">

 

 

<HeaderStyle Width="30px" />

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridTemplateColumn EditFormColumnIndex="2" HeaderText="Line Description" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="Left">

 

 

<ItemTemplate >

 

 

<asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "DESCRIPTION") %>'>

 

 

</asp:Label>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<asp:TextBox ID="Label1" runat="server" TextMode="MultiLine" Rows="4" Text='<%# Bind("DESCRIPTION") %>' />

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="Activity Code" >

 

 

<ItemTemplate>

 

 

<asp:Label ID="lblActivityCode" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ACTIVITY_CODE_DESC") %>'>

 

 

</asp:Label>

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate >

 

 

<telerik:RadComboBox ID="RadComboBox1" runat="server" Width="100px" Height="200px"

 

 

AllowCustomText="False" ShowToggleImage="True" ShowMoreResultsBox="false"

 

 

EnableLoadOnDemand="True" DropDownWidth="500px" DataTextField="DESCRIPTION" DataSource='<%# LoadActivityCodes() %>'

 

 

MarkFirstMatch="True" OnClientItemsRequesting="" AutoPostBack="true" Skin="Office2007">

 

 

<HeaderTemplate>

 

 

<table style="width: 500px" cellspacing="0" cellpadding="0">

 

 

<tr>

 

 

<td style="width: 200px;">

 

Description

</td>

 

 

<td style="width: 60px;">

 

Account

</td>

 

 

<td style="width: 200px;">

 

Category

</td>

 

 

</tr>

 

 

</table>

 

 

</HeaderTemplate>

 

 

 

<ItemTemplate>

 

 

<table style="width: 500px" cellspacing="0" cellpadding="0">

 

 

<tr>

 

 

<td style="width: 200px;">

 

<%

# DataBinder.Eval(Container.DataItem,"DESCRIPTION")%>

 

 

</td>

 

 

<td style="width: 60px;">

 

<%

# DataBinder.Eval(Container.DataItem, "ACCOUNT")%>

 

 

</td>

 

 

<td style="width: 200px;">

 

<%

# DataBinder.Eval(Container.DataItem,"CATEGORY")%>

 

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

</telerik:RadComboBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

 

 

<telerik:GridBoundColumn DataField="QUANTITY" HeaderText="Quantity"

 

 

EditFormColumnIndex="1" UniqueName="QUANTITY">

 

 

<HeaderStyle Width="30px" />

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="UNIT_SELLING_PRICE" EditFormColumnIndex="1" HeaderText="Amount" DataFormatString="{0:c}">

 

 

<HeaderStyle Width="50px" />

 

 

<ItemStyle HorizontalAlign="Right" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="TOTAL_AMOUNT" HeaderText="Total Amount" DataFormatString="{0:c}" >

 

 

<HeaderStyle Width="50px" />

 

 

<ItemStyle HorizontalAlign="Right" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridCheckBoxColumn DataField="TAXABLE_FLAG" HeaderText="Taxable"

 

 

UniqueName="TAXABLE_FLAG" EditFormColumnIndex="1">

 

 

<HeaderStyle Width="50px" />

 

 

</telerik:GridCheckBoxColumn>

 

<%

-- <asp:TemplateField HeaderText="Taxable">

 

<ItemTemplate>

<itemstyle horizontalalign="Center" />

<asp:CheckBox ID="TAXABLE_FLAG" runat="Server" Checked='<%# Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "TAXABLE_FLAG")) %>' />

</ItemTemplate>

</asp:TemplateField>

--

%>

 

 

 

<telerik:GridBoundColumn DataField="BEGIN_BILLING_PERIOD" HeaderText="Billing Period Start Date"

 

 

UniqueName="BEGIN_BILLING_PERIOD" >

 

 

<HeaderStyle Width="62px" />

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn DataField="END_BILLING_PERIOD" HeaderText="Billing Period End Date"

 

 

UniqueName="END_BILLING_PERIOD" >

 

 

<HeaderStyle Width="62px" />

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridClientDeleteColumn ConfirmText="Delete this item?" ButtonType="LinkButton"

 

 

CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">

 

 

<HeaderStyle Width="20px" />

 

 

<ItemStyle HorizontalAlign="Center" />

 

 

</telerik:GridClientDeleteColumn>

 

 

 

 

</Columns>

 

 

<EditFormSettings EditFormType="AutoGenerated" ColumnNumber="2" CaptionDataField="LINE_NUMBER" CaptionFormatString="Edit Line Number:{0}">

 

 

<FormTableItemStyle Wrap="False"></FormTableItemStyle>

 

 

<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>

 

 

<FormMainTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="3" BackColor="White"

 

 

Width="100%" />

 

 

<FormTableStyle CellSpacing="0" CellPadding="2" CssClass="module" Height="110px"

 

 

BackColor="White" />

 

 

<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>

 

 

<EditColumn ButtonType="ImageButton" UpdateText="Save" CancelText="Cancel"

 

 

InsertText="Insert"

 

 

UniqueName="EditCommandColumn1">

 

 

</EditColumn>

 

 

<FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

 

 

Neeraj
Top achievements
Rank 1
 answered on 14 May 2009
0 answers
131 views
I've searched the tutorials, documentation and forum for a simple example of binding data to a child item.

Can you please provide an example of binding a DataTextField to a child item for a rad menu? When I set the DataSourceID of a radmenu, it will automatically bind to the root. Here is a small example of what I'm looking for:

<RadContextMenu ID="RadContextMenu1" runat="server" DataSourceID="SqlDataSource1"
  <Targets> 
   <telerik:ContextMenuControlTarget ControlID="RadPanelBar1" /> 
  </Targets> 
  <Items> 
    <telerik:RadMenuItem Text="Child Item 1"
      <Items> 
        <telerik:RadMenuItem> 
          <ItemTemplate> 
            <telerik:RadMenuItem Text='<%# Eval("FIELD_NAME") %>' Value='<%# Eval("FIELD_ID") %>' /> 
          </ItemTemplate> 
        </telerik:RadMenuItem> 
      </Items> 
    </telerik:RadMenuItem> 
    <telerik:RadMenuItem Text="Child Item 2"
      <Items> 
        <telerik:RadMenuItem> 
          <ItemTemplate> 
            <telerik:RadMenuItem Text='<%# Eval("FIELD_NAME") %>' Value='<%# Eval("FIELD_ID") %>' /> 
          </ItemTemplate> 
        </telerik:RadMenuItem> 
      </Items> 
    </telerik:RadMenuItem> 
  </Items> 
</RadContextMenu> 

Thanks,

Gunjan
Gunjan
Top achievements
Rank 1
 asked on 14 May 2009
2 answers
148 views
What clientside object/property will return the current number of rows loaded/displayed within a grid?

Querying the mastertableviews .rowcount property always returns the max potential rows, vs how many are actually in the grid on the current page. For example, if I have RowCount set to 5, and 11 records in the dataset, then pages 1 and 2 would return 5, but when page 3 is loaded it shouild return 1.

topry
Top achievements
Rank 1
 answered on 14 May 2009
2 answers
80 views
Hey Everyone

I just updated to 2009 Q1 and all of my grids that have paging mode set to NextPrevAndNumeric now show a PageSize dropdown. 

Does anyone know of a quick way to hide the dropdown in this mode without having to go back and make PagerTemplates for each of my grids?  I took a quick look in the documentation and nothing obvious jumped out at me.

Thx,
Conan
Conan Galloway
Top achievements
Rank 1
 answered on 14 May 2009
3 answers
113 views
With Accessibility being all the more important now days, i've got a client complaining that when they disable javascript the combobox breaks

is there a fix to this (anyone got some code i can copy)

thanks
Ivan Dimitrov
Telerik team
 answered on 14 May 2009
2 answers
110 views
Hi,
   I am using LoadOnDemand Combo box with AllowCustomText set to True. It's working fine.
   I have set MarkFirstMatch to True, so as soon as user starts typing the combobox will be populated with items matches the Text user has entered. But if user enters Text which doesn't bring any record that Text just stays there in combobox. What I want is when user enter text which is not in the list and change focus to some other control, I want to show the EmptyMessage.
Any suggestion or help would be appriciated.

Thanks
Saqib
Saqib
Top achievements
Rank 1
 answered on 14 May 2009
6 answers
170 views
When I add radTooltipManager to the page, radDock control displays two "Collapse" tooltip, one for TooltipManager and one for the RadDock control.

How do I configure radDock control to only show tooltip from tooltip Manager?

Thx.

Kian
Glenn
Top achievements
Rank 1
 answered on 14 May 2009
4 answers
155 views
I have a rad splitter set up as follows:


<telerik:RadSplitter ID="RadSplitter1" runat="server" Height="522px" 
Skin="Outlook" Width="243px">

<telerik:RadSplitBar ID="RadSplitBar1" runat="server" />
<telerik:RadPane runat="server" Scrolling="Y">

<telerik:RadPanelBar ID="RadPanelBar1" Runat="server" 
onitemclick="RadPanelBar1_ItemClick1" Skin="Outlook" CausesValidation="False">
</telerik:RadPanelBar>
</telerik:RadPane>

</telerik:RadSplitter>

The onitemclick method exists in my codebehind (no compilation errors there). However, whenever I click an item in the panelbar, the page_load method is called and not the method specified above.


Can anyone point out as to why?

Atanas Korchev
Telerik team
 answered on 14 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?