Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
77 views
I am wanting to use the RadScheduler in "WeekView" or "DayView" mode to be able to select 1 or many TimeSlots to add to my custom collection; aka I want to be able to select multiple timeslots and be able to tell on Postback which timeslots in the scheduler are "selected".

I see that you can "select" multiple timeslots by control clicking on them which puts a visible indicator around each cell to make it appear that it is selected. (see my attached Image).

My problem is how do I tell if a timeslot has that "selected" indicator around it to be able to pull it from the RadScheduler to add it to my custom collection? I don't see any way to do that, and was hoping but not seeing that the the RadScheduler control had a collection of "selected" timeslots.

Can anyone point me in the right direction if what I am trying to do is possible/supported?
Peter
Telerik team
 answered on 05 Nov 2010
3 answers
204 views
I have a radgrid in which each row has a checkbox and a radnumerictextbox. At the bottom of the radnumerictextbox column is a footer that displays the sum of the textboxes. When a user unchecks a checkbox I want to reduce the sum in the footer by the amount in the numerictextbox of the same row as the checkbox. Does anyone know how I can reference the footer and textbox via client side script?

My grid code is as follows:

<telerik:RadGrid ID="gvAmount" runat="server" GridLines="Both" BorderStyle="None" ShowFooter="true"

 

ShowHeader="true" CellPadding="0" AutoGenerateColumns="false" CssClass="SearchGrid" AllowSorting="true" >

 

 

<MasterTableView>

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

 

</RowIndicatorColumn>

 

 

 

 

 

<ExpandCollapseColumn>

 

<HeaderStyle Width="20px" Font-Size="Medium"></HeaderStyle>

 

 

 

</ExpandCollapseColumn>

 

 

 

 

 

<Columns>

 

 

<telerik:GridTemplateColumn UniqueName="Include" HeaderText="Include?" >

 

<ItemStyle />

 

 

 

<ItemTemplate>

 

 

 

<asp:CheckBox ID="chkInclude" runat="server" Checked="true" />

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

<telerik:GridBoundColumn DataField="ID" HeaderText="ID"

UniqueName="ID" EmptyDataText="&nbsp;" ItemStyle-HorizontalAlign="Left" />

 

 

<telerik:GridBoundColumn DataField="Name" HeaderText="Name"

UniqueName="Name" EmptyDataText="&nbsp;" ItemStyle-HorizontalAlign="Left" />

 

 

 


<telerik:GridTemplateColumn UniqueName="CurrAmt" HeaderText="Current Amount">

 

<ItemStyle />

 

 

 

<ItemTemplate>

 

 

 

<telerik:RadNumericTextBox ID="txtCurrAmt" runat="server" Width="60px" Value="0" >

 

 

 

<ClientEvents OnBlur="Blur" OnFocus="Focus" />

 

 

 

</telerik:RadNumericTextBox>

 

 

 

</ItemTemplate>

 

 

 

<FooterTemplate>

 

 

<telerik:RadNumericTextBox ID="txtCurrTotal" runat="server" Type="Currency" ReadOnly="true">

 

 

 

<ClientEvents OnLoad="Load" />

 

 

 

</telerik:RadNumericTextBox>

 

 

 

</FooterTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

 

</Columns>

 

 

 

 

<PagerStyle Visible="false" />

 

</MasterTableView>

 

 

 

 

 

<ClientSettings>

 

<Selecting AllowRowSelect="True" />

 

 

 

 /ClientSettings>

 

 

 

 

 

<FilterMenu>

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

 

</FilterMenu>

 

 

 

</telerik:RadGrid>

 

 

 

 

 



Thanks in advance!
-Tracey
Tsvetina
Telerik team
 answered on 05 Nov 2010
1 answer
196 views
Hi,
We have a RadGrid that has some columns hidden at startup.  We have enabled "UseStaticHeaders", "EnableHeaderContextMenu" and "UseStaticHeaders".  The issue is that when the client checks a previously hidden column, the headers don't line up or horizontally scroll with the columns below.  I have found that this is true whether in view mode or edit mode and that switching modes(causing a postback) cleans up the behavior.  In fact, if I add a column then go into edit mode and cancel edit mode, the page scrolls fine.

Thanks for your help,
Dan Norton

The RadGrid definition is attached.

<telerik:RadGrid ID="UserGrid" runat="server"
                    CssClass="RadGrid" 
                    GridLines="None"
                    AllowPaging="true" 
                    AllowSorting="true"  
                    AutoGenerateColumns="False"
                    EnableHeaderContextMenu="true"
                    ShowStatusBar="true"
                    HorizontalAlign="NotSet"
                    AllowMultiRowEdit="False"
                    OnNeedDataSource="UserGrid_NeedDataSource"
                    OnItemDataBound="UserGrid_ItemDataBound"
                    Width="870"
                    >
    <ClientSettings>
        <Scrolling AllowScroll="True" SaveScrollPosition="True" UseStaticHeaders="true" />
    </ClientSettings>
    <ExportSettings HideStructureColumns="true" 
                    OpenInNewWindow="true" 
                    ExportOnlyData="true" 
                    IgnorePaging="true" 
                    FileName="Que_Centre_Users_Export" />
    <MasterTableView CommandItemDisplay="TopAndBottom"
                        DataKeyNames="Id"
                        TableLayout="Fixed"
                        EditMode="EditForms" 
                        InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                        PageSize="25"
                        >
        <Columns>
            <telerik:GridTemplateColumn HeaderText="First Name"
                                        UniqueName="EditFirstName"
                                        DataField="FirstName"
                                        SortExpression="FirstName"
                                        HeaderStyle-Width="100px"
                                        ItemStyle-Width="100px">
                <ItemTemplate>
                    <asp:LinkButton runat="server" Text="Edit" CommandName="EditUser" Id="lbFirstName" CausesValidation="false" />
                    <asp:Label runat="server" ID="lblFirstName" Text="" Visible="false" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtFirstName" Width="120" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn HeaderText="Last Name" 
                                        UniqueName="EditLastName" 
                                        DataField="LastName"
                                        SortExpression="LastName"
                                        HeaderStyle-Width="100px"
                                        ItemStyle-Width="100px">
                <ItemTemplate >
                    <asp:LinkButton runat="server" Text="Edit" CommandName="EditUser" Id="lbLastName" CausesValidation="false" />
                    <asp:Label runat="server" ID="lblLastName" Text="" Visible="false" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtLastName" Width="100" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn 
                    DataField="EmailAddress"
                    HeaderText="Email Address"
                    UniqueName="EmailAddress"
                    SortExpression="EmailAddress"
                    HeaderStyle-Width="150px"
                    ItemStyle-Width="150px">
                <ItemTemplate >
                    <asp:Label runat="server" ID="lblEmailAddress" Text="" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtEmailAddress" Width="175" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn 
                    DataField="PhoneNumber" 
                    HeaderText="Phone Number" 
                    UniqueName="PhoneNumber"  
                    SortExpression="PhoneNumber"
                    HeaderStyle-Width="125px"
                    ItemStyle-Width="125px">
                <ItemTemplate >
                    <asp:Label runat="server" ID="lblPhoneNumber" Text="" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtPhoneNumber" Width="100" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn HeaderText="User Group" 
                                        UniqueName="UserGroupName" 
                                        DataField="UserGroupName"
                                        SortExpression="UserGroupName"
                                        HeaderStyle-Width="150px"
                                        ItemStyle-Width="150px">
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblUserGroupName" Text="" />
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadComboBox Runat="server" Id="radUserGroup"
                                            EmptyMessage="Select User Group"
                                            MarkFirstMatch="true"
                                            Width="150px"
                                            Height="150"
                                            DropDownWidth="200"
                                            EnableLoadOnDemand="false"
                                            AllowCustomText="false"
                                            AutoPostBack="false"
                                            Filter="Contains"
                                            />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn 
                    DataField="Username" 
                    HeaderText="Username" 
                    UniqueName="Username"  
                    SortExpression="Username"
                    Display="false"
                    HeaderStyle-Width="100px"
                    ItemStyle-Width="100px">
                <ItemTemplate >
                    <asp:Label runat="server" ID="lblUsername" Text="" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtUsername" Width="100" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn 
                    DataField="HourlyRate" 
                    HeaderText="Hourly Rate" 
                    UniqueName="HourlyRate"  
                    SortExpression="HourlyRate"
                    Display="false"
                    HeaderStyle-Width="75px"
                    ItemStyle-Width="75px">
                <ItemTemplate >
                    <asp:Label runat="server" ID="lblHourlyRate" Text="" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtHourlyRate" Width="50" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn 
                    DataField="HourlyOvertimeRate" 
                    HeaderText="Hourly Overtime Rate" 
                    UniqueName="HourlyOvertimeRate"  
                    SortExpression="HourlyOvertimeRate"
                    Display="false"
                    HeaderStyle-Width="75px"
                    ItemStyle-Width="75px">
                <ItemTemplate >
                    <asp:Label runat="server" ID="lblHourlyOvertimeRate" Text="" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtHourlyOvertimeRate" Width="50" />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn HeaderText="Delete" 
                                        UniqueName="DeleteUser" 
                                        DataField="Deleted"
                                        Resizable="false"
                                        HeaderStyle-Width="50px"
                                        HeaderStyle-HorizontalAlign="Center"
                                        ItemStyle-Width="50px"
                                        ItemStyle-HorizontalAlign="Center">
                <ItemTemplate >
                    <asp:ImageButton runat="server" CommandName="DeleteUser" Id="DeleteUserIcon" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
  
            <telerik:GridTemplateColumn HeaderText="Block" 
                                        UniqueName="BlockUser" 
                                        DataField="Blocked" 
                                        Resizable="false"
                                        HeaderStyle-Width="50px"
                                        HeaderStyle-HorizontalAlign="Center"
                                        ItemStyle-Width="50px"
                                        ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <asp:ImageButton runat="server" CommandName="BlockUser" Id="BlockUserIcon" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <NoRecordsTemplate>
            <div style="padding: 5px;">No users exist.</div>
        </NoRecordsTemplate>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <asp:Panel runat="server" ID="UserEditForm" />
            </FormTemplate>
        </EditFormSettings>
        <CommandItemTemplate>
            <telerik:RadToolBar ID="UserGrid_RadToolBar" runat="server"
                                AutoPostBack="true"
                                EnableRoundedCorners="true"
                                EnableShadows="true">
                <Items>
  
                    <telerik:RadToolBarButton Text="Create New User" Value="CreateNewUser" CommandName="InitInsert" PostBack="true" />
  
                    <telerik:RadToolBarButton IsSeparator="true" Value="Separator1" />
  
                    <telerik:RadToolBarButton Value="FiltersGroup">
                        <ItemTemplate>
                            <div style="padding: 4px; min-height: 8px; vertical-align: middle;">
                                <asp:label runat="server" id="lblFiltersGroup"
                                            Text="Filter List: " ForeColor="White" 
                                            Font-Bold="true" />
                            </div>
                        </ItemTemplate>
                    </telerik:RadToolBarButton>
  
                    <telerik:RadToolBarButton Value="FilterByUserGroup" Group="Filters">
                        <ItemTemplate>
                            <div style="margin-right: 5px; display: block; padding: 3px; min-height: 8px; vertical-align: middle;">
                                <asp:label runat="server" id="lblFilterByUserGroup"
                                            AssociatedControlId="radFilterByUserGroup"
                                            Text="User Group: "
                                            ForeColor="White"
                                            style="padding-right: 5px;" />
  
                                <telerik:RadComboBox Runat="server" Id="radFilterByUserGroup"
                                                        EmptyMessage="Select User Group"
                                                        MarkFirstMatch="true"
                                                        Width="175px"
                                                        Height="150"
                                                        DropDownWidth="200"
                                                        EnableLoadOnDemand="false"
                                                        AllowCustomText="false"
                                                        AutoPostBack="true"
                                                        Filter="Contains"
                                                        OnSelectedIndexChanged="radFilterByUserGroup_SelectedIndexChanged"
                                                        />
                            </div>
                        </ItemTemplate>
                    </telerik:RadToolBarButton>
  
                    <telerik:RadToolBarButton IsSeparator="true" Value="Separator2" />
  
                    <telerik:RadToolBarButton Value="RecordsPerPage">
                        <ItemTemplate>
                            <div style="margin-right: 5px; display: block; padding: 3px; min-height: 8px; vertical-align: middle;">
                                <asp:label runat="server" id="lblRecordsPerPage"
                                            AssociatedControlId="radRecordsPerPage"
                                            Text="Page Size: "
                                            ForeColor="White"
                                            style="padding-right: 5px;" />
  
                                <telerik:RadComboBox Runat="server" Id="radRecordsPerPage"
                                                        EmptyMessage="Select Records per Page"
                                                        MarkFirstMatch="true"
                                                        Width="75px"
                                                        Height="100"
                                                        DropDownWidth="100"
                                                        EnableLoadOnDemand="false"
                                                        AllowCustomText="false"
                                                        AutoPostBack="true"
                                                        Filter="Contains"
                                                        OnSelectedIndexChanged="radRecordsPerPage_SelectedIndexChanged"
                                                        />
                            </div>
                        </ItemTemplate>
                    </telerik:RadToolBarButton>
  
                    <telerik:RadToolBarButton IsSeparator="true"  Value="Separator3" />
  
                    <telerik:RadToolBarButton Text="Bulk Update" Value="BulkUpdate" CommandName="BulkUpdate" PostBack="true" />
  
                    <telerik:RadToolBarButton IsSeparator="true" Value="Separator4" />
  
                    <telerik:RadToolBarDropDown Text="Export Users">
                        <Buttons>
                            <telerik:RadToolBarButton Text="Export To Excel"
                                                        PostBack="true"
                                                        CommandName="ExportToExcel" />
                            <telerik:RadToolBarButton Text="Export To Word"
                                                        PostBack="true"
                                                        CommandName="ExportToWord" />
                            <telerik:RadToolBarButton Text="Export To Pdf"
                                                        PostBack="true"
                                                        CommandName="ExportToPdf" />
                        </Buttons>
                    </telerik:RadToolBarDropDown>
  
                    <telerik:RadToolBarButton Text="Save Updates" Value="BulkUpdateSave" CommandName="BulkUpdateSave" PostBack="true" Visible="false" />
  
                    <telerik:RadToolBarButton IsSeparator="true" Value="Separator5" />
  
                    <telerik:RadToolBarButton Text="Cancel Updates" Value="BulkUpdateCancel" CommandName="BulkUpdateCancel" PostBack="true" Visible="false" />
  
                </Items>
            </telerik:RadToolBar>
        </CommandItemTemplate>
    </MasterTableView>
    <ClientSettings AllowColumnsReorder="false">
        <Resizing AllowRowResize="false" AllowColumnResize="true" EnableRealTimeResize="false" ResizeGridOnColumnResize="false" />
    </ClientSettings>
    <PagerStyle Mode="Slider" Position="TopAndBottom" />
</telerik:RadGrid>
Pavlina
Telerik team
 answered on 05 Nov 2010
2 answers
167 views
Using the AsyncUpload control renders the input textbox largely irrelevant so I thought I'd have a go at hiding it.

Typically, I wasn't doing things in a straightforward page. I have a user control that contains a RadWindow which itself contains a <CententTemplate> element. The AsyncUpload control is in that.

I thought that I would be able to hide the control using the OnClientShow event of the RadWindow and so, I wrote this ...
function OnClientShow(sender, e) {
  $telerik.$(".ruFakeInput").hide();
}

Imagine my surprise when it worked first time!

Then I actually used the upload control to, well, upload something. When the files had finished uploading the input came back.

The solution was to wire up the AsyncUpload's client event OnClientFileUploaded in which I execute the same line as in the OnClientShow event.

Job done.

Just thought I'd share.

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 05 Nov 2010
2 answers
343 views
Hi!  I've created an aspx page which displays a pie chart.   I would like to display text values of 'Recorded', 'In Process', and 'Not Started' in the legend.  The chart is being populated in the code behind by an array which is built through stored procedures.  The text I would like to display in the legend isn't stored in the database and I need a way to manually specify those values.

Could someone provide me a code example of how to do this please?
Thank you!!
Evgenia
Telerik team
 answered on 05 Nov 2010
1 answer
109 views

I have a data entry form which is launched as a new RadWindow above a summary page. As users maintain their data, events are fired back to code-behind to do calcs and refresh parts of the current page/window. For example, change a quantity ordered and the current inventory available quantity refreshes from the server. This works fine.

When done, users can also click Save, the current data gets saved on the server and the window is closed. This works fine.

There is a situation where a user will enter data, but not tab/enter away from the RadNumericTextBox. They just click Save without the textbox control losing focus. When this happens the Save triggers the event on the server and "simultaneously" the textbox fires its OnTextChanged event. This frequently results in the RadWindow remaining open, a server error firing, and possibly the session state getting lost.  I can't define a consistent state because it's not consistent - it depends on which event gets processed first - and sometimes there's no error.

I can provide more details but before I go to far, what's the protocol for preventing issues like this?  Do I need to use JavaScript to set some flag in the client when events get fired to Cancel other events?  That seems to require a lot of micro-management that I don't think we should have to do.

Thanks!
Radoslav
Telerik team
 answered on 05 Nov 2010
6 answers
168 views
I know how to show/hide the toolbar but on client-side. Now i have a bit different scenario which is the following:

It is an AJAX button that should check if user exists (SQL Server) and display the result in RadToolTip. I have added the button in the RadAjaxManager's AjaxSettings. Please either show me the right demo or please explain to me how do i handle it by myself.

Thanks
Cori
Top achievements
Rank 2
 answered on 05 Nov 2010
2 answers
240 views
Hi,
        How can i select the Row After Insert or Update Command (after Inserting/updating the current updated /insertedrow).

        I am using
protected void radGridActivity_UpdateCommand(object source, GridCommandEventArgs e)
{
}
Shafees
Top achievements
Rank 2
 answered on 05 Nov 2010
5 answers
686 views
Id like the editor to load in preview mode. Currently the default is design mode and I cant see any way to change this.

Can anyone advice how to do this?

Just to be clear I want the design mode to still be availble to users...I just want is to open in the preview mode.

Many Thanks, Des
Rumen
Telerik team
 answered on 05 Nov 2010
3 answers
82 views
I have a Fieldset, and the fieldset has some fields which are hidden. When a check box is checked, the hidden fields show up. Now when the hidden fields show up, the fieldset is rendering well in Firefox and Chrome. But the problem is totally with IE (7,8). Please see the image attached to get a better idea.

Thanks. Please let me know if you need any more information.

Regards
Yash
Georgi Tunev
Telerik team
 answered on 05 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?