Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
202 views
I would like to validate file name when I upload document or image in RadEditor. If the file name is not valid, I would like to prompt an error message to user.

Is there any quick and easy way to do this?

I attach a screen shot to help clarify my case.
Rumen
Telerik team
 answered on 31 Dec 2010
2 answers
547 views
Dear all,

Does Telerik Grid have feature to Merge Cells? I want to Merge by Column (eg. Merge A1, A2, A3) .
If Telerik Grid doesn't have it, is there any way to do?

* My version is Q1 2010 SP2.
Hope you all can guide me as this is my first ASP.Net prj.

Thanks & Best Regards.
Naunton
Top achievements
Rank 1
 answered on 31 Dec 2010
2 answers
240 views
Hi,

I need to create a grid which is very similar to the demo Grid in Hierarchy
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx

Since this for a mock up demo,  i don't have any database to point out.

I followed this example http://www.telerik.com/community/forums/aspnet-ajax/grid/show-columns-without-datasource.aspx to create a single level grid.

Could you please tel me , what is the best way to create a hierarchy grid datasource with out a database.

Need help ASAP.
Thanks.
Eva
Eva
Top achievements
Rank 1
 answered on 31 Dec 2010
2 answers
46 views
Hi There,

I have a issue where I have a RadAjaxPanel and on this panel I have a Literal that holds the html from a function that creates some tables and RadTickers.
The panel is updates every 10 sec. by a timer

The first time the page is loaded and the Literal  is updated from the Page_Load event everythings works fine, but when the timer event runs after 10 sec. only tables are updated. if I look at the html that is generated it all looks fine, except the Radtikers don't start.

If I do a normal postback everything also works fine.

Do I need to update something in the ScriptManager from the Ajax event or does anyone have an idea on what could be wrong?

Thanks,

Hendrik

Hendrik Johns
Top achievements
Rank 1
 answered on 31 Dec 2010
2 answers
54 views
I want to insert a record without closing the add record form.  I'm trying to use the e.Canceled = True statement but when I go to try to access the controls in the GridTemplateColumn of the RadGrid control I get errors like "Object reference not set to an instance of an object.".  Below is the code I'm using.  Any help you can provide would be appreciated.

protected void gvGrossPayroll_ItemCommand(object sender, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.PerformInsertCommandName || e.CommandName == RadGrid.CancelCommandName)
    {
        e.Canceled = true;
 
        GridEditableItem editedItem = (sender as RadNumericTextBox).NamingContainer as GridEditableItem;
        RadNumericTextBox txtTest1 = editedItem["txtPayrollAmount1a"].Controls[0] as RadNumericTextBox;
 
        Debug.WriteLine("Test:" + Convert.ToString(txtTest1.Text));
    }
}

Here is the RadGrid that I'm trying to access the controls of:

<telerik:RadGrid ID="gvGrossPayroll" runat="server"
    AllowAutomaticDeletes="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="False"  OnInsertCommand="gvGrossPayroll_InsertCommand"
    AutoGenerateColumns="False" DataSourceID="SDS_Payroll" GridLines="None" OnItemCommand="gvGrossPayroll_ItemCommand"
    ShowFooter="True" Skin="Web20" Width="544px">
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="TopAndBottom"
        DataKeyNames="ID" DataSourceID="SDS_Payroll">
        <RowIndicatorColumn>
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <CommandItemSettings />
        <Columns>
            <telerik:GridBoundColumn DataField="id" ReadOnly="True" UniqueName="ID"
                Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn EditFormColumnIndex="0" HeaderText="Job Class Code" DataField="JobClass"
                UniqueName="JobClass" Visible="true" ReadOnly="False" HeaderStyle-VerticalAlign="Bottom">
                <ItemTemplate>
                    <asp:Label ID="JobClass" runat="server" Text='<%# Bind("JobClass") %>'></asp:Label>
                </ItemTemplate>
                <InsertItemTemplate>
                <telerik:RadComboBox ID="ddlJobClassID" Runat="server" AllowCustomText="True"
                    DataSourceID="SqlDataSourceDDL" DataTextField="JobClass"
                    DataValueField="JobClassID" EmptyMessage="Please enter a job class code"
                    EnableViewState="False"  AppendDataBoundItems="true"
                    ErrorMessage="You must enter a job class code to add a record"
                    MarkFirstMatch="True" ShowDropDownOnTextboxClick="False" Skin="Web20"
                    ToolTip="Enter a Job Class Code" Width="350px" SelectedValue='<%# Bind("JobClassID") %>'>
                </telerik:RadComboBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ErrorMessage="Job Class Code is a required field" Font-Bold="True"
                    Font-Names="Arial Narrow" ForeColor="Red" ControlToValidate="ddlJobClassID"
                    ToolTip="Job Class Code is a required field">X
                </asp:RequiredFieldValidator>
                </InsertItemTemplate>
                <EditItemTemplate>
                    <asp:Label ID="JobClass" runat="server" Text='<%# Bind("JobClassID") %>'></asp:Label>
                </EditItemTemplate>                                                                         
                <HeaderStyle VerticalAlign="Bottom" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn EditFormColumnIndex="0" HeaderText="Year1"
                UniqueName="PayrollAmount1" Visible="true" Aggregate="Sum" DataField="PayrollAmount1"
                FooterAggregateFormatString="{0:C}" HeaderStyle-Width="60px">
                <ItemTemplate>
                    <asp:Label ID="PayrollAmount1" runat="server" Text='<%# Eval("PayrollAmount1", "{0:C}") %>'></asp:Label>
                </ItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPayrollAmount1a" Runat="server"
                        Culture="English (United States)" MinValue="0" NumberFormat-DecimalDigits="0"
                        Skin="Web20" TabIndex="2" ToolTip="Payroll Amount" Type="Currency"
                        Width="100px" Value="0" Text='<%# Bind("PayrollAmount1") %>' >
                        <EnabledStyle HorizontalAlign="Right" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </InsertItemTemplate>
                                                                                                 
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPayrollAmount1" Runat="server"
                        Culture="English (United States)" MinValue="0" NumberFormat-DecimalDigits="0"
                        Skin="Web20" TabIndex="2" ToolTip="Payroll Amount" Type="Currency"
                        Text='<%# Bind("PayrollAmount1") %>' Width="100px">
                        <EnabledStyle HorizontalAlign="Right" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </EditItemTemplate>
                <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                    Wrap="True" />
                <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                    Wrap="True" />
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                    Wrap="True" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn EditFormColumnIndex="0" HeaderText="Year2"
                UniqueName="PayrollAmount2" Visible="true" DataField="PayrollAmount2" Aggregate="Sum"
                FooterAggregateFormatString="{0:C}" HeaderStyle-Width="60px" >
                <ItemTemplate>
                    <asp:Label ID="PayrollAmount2" runat="server"
                        Text='<%# Eval("PayrollAmount2", "{0:C}") %>'></asp:Label>
                </ItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPayrollAmount2" Runat="server"
                        Culture="English (United States)" MinValue="0" NumberFormat-DecimalDigits="0"
                        Skin="Web20" TabIndex="2" ToolTip="Payroll Amount" Type="Currency" Value="0"
                        Width="100px" Text='<%# Bind("PayrollAmount2") %>'>
                        <EnabledStyle HorizontalAlign="Right" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </InsertItemTemplate>
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="txtPayrollAmount2" Runat="server"
                        Culture="English (United States)" MinValue="0" NumberFormat-DecimalDigits="0"
                        Skin="Web20" TabIndex="2" ToolTip="Payroll Amount" Type="Currency"
                        Width="100px" Text='<%# Bind("PayrollAmount2") %>'>
                        <EnabledStyle HorizontalAlign="Right" />
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                </EditItemTemplate>
                <FooterStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                    Wrap="True" />
                <HeaderStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center"
                    Wrap="True" />
                <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right"
                    Wrap="True" />
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn>
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn CommandName="Delete"
                ConfirmText="Delete this payroll record?" ImageUrl="/images/delete.gif"
                Text="Delete" UniqueName="column3">
            </telerik:GridButtonColumn>
                                                                                             
            <telerik:GridBoundColumn DataField="MemberID" DataType="System.Int16"
                UniqueName="MemberID" ReadOnly="True" Visible="False">
            </telerik:GridBoundColumn>
                                                                                             
        </Columns>
                                                                                         
        <EditFormSettings CaptionDataField="MemberID"
            CaptionFormatString="Edit Payroll Record" ColumnNumber="1"
            InsertCaption="Add Payroll Record">
            <FormTableItemStyle Wrap="False" />
            <FormCaptionStyle CssClass="EditFormHeader" />
            <FormMainTableStyle BackColor="White" CellPadding="3" CellSpacing="0"
                GridLines="None" Width="100%" />
            <FormTableStyle BackColor="White" CellPadding="2" CellSpacing="0"
                Height="110px" />
            <FormTableAlternatingItemStyle Wrap="False" />
            <EditColumn ButtonType="ImageButton" CancelText="Cancel edit"
                InsertText="Insert Record" UniqueName="EditCommandColumn1"
                UpdateText="Update record">
            </EditColumn>
            <FormTableButtonRowStyle CssClass="EditFormButtonRow" HorizontalAlign="Right" />
        </EditFormSettings>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="True">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Web20"
        EnableImageSprites="True">
    </HeaderContextMenu>
</telerik:RadGrid>

WCRA Dev
Top achievements
Rank 1
 answered on 30 Dec 2010
4 answers
177 views
My contextmenu icons are missing or distorted somehow, I use the same icon set for my custom toolbar with out any problems.  I believe the url to the icons to be correct since it works for the custom tool bar.  See attached image for example of appearance, also embedded is c# to create and css "toolfile".  I am using version 2010.3.1109.40 of Telerik.Web.UI.  Thanks in advance for any thoughts on the issue.

Create instance in code behind;
...
                    /*
                     * Standard users have no need of context menus
                     */
                    RadEditor1.ContextMenus.Clear();
 
                    /*
                     * Add the edit personal note
                     */
                    EditorContextMenu ecm = new EditorContextMenu();
                    ecm.TagName = "IMG";
                    //add specific tools to the context menu
                    EditorTool et = new EditorTool("Edit_Personal_Note");
                    ecm.Tools.Add(et);
                    //add the newly created context menu to the context menu collection
                    RadEditor1.ContextMenus.Add(ecm);
 
                    /*
                     * Add the delete personal note
                     */
                    et = new EditorTool("Delete_Personal_Note");
                    ecm.Tools.Add(et);
                    //add the newly created context menu to the context menu collection
                    RadEditor1.ContextMenus.Add(ecm);
...

/*
 * Editor Tool Bar
 */
.reTool .Personal_Notes
{
    background-image: url(../../images/PersonalNotes.gif);
    background-position: center !important;
    background-repeat: no-repeat !important;
}
.reTool .Edit_Personal_Note
{
    background-image: url(../../images/Edit_Personal_Note.gif);
    background-position: center !important;
    background-repeat: no-repeat !important;
}
.reTool .Delete_Personal_Note
{
    background-image: url(../../images/DeletePersonalNote.gif);
    background-position: center !important;
    background-repeat: no-repeat !important;
}
.reTool .Public_Notes
{
    background-image: url(../../images/PublicNotes.gif);
    background-position: center !important;
    background-repeat: no-repeat !important;
}
/*
 * Context Menu Tool bar (Note that path is same as for toolbar above and the toolbar works
 */
.Edit_Personal_Note
{
    background-image: url(../../images/Edit_Personal_Note.gif);
    background-position: center !important;
    background-repeat: no-repeat !important;
}
.Delete_Personal_Note
{
    background-image: url(../../images/DeletePersonalNote.gif);
    background-position: center !important;
    background-repeat: no-repeat !important;
}
John
Top achievements
Rank 1
 answered on 30 Dec 2010
4 answers
139 views

I have been unable to successfully override the Times New Roman font in my PDF.
A screen shot of the PDF is attached.

Here is my raw HTML showing the newly applied styles but the font family, arial, is not getting applied to the PDF!

<table cellspacing="0" border="0" id="RadGridSearchResults_ctl00" style="width:100%;table-layout:auto;empty-cells:show;">
    <colgroup>
        <col style="width:75px" />
        <col style="width:75px" />
        <col style="width:150px" />
        <col style="width:75px" />
        <col style="width:100px" />
        <col  />
    </colgroup>
<thead>
        <tr style="background-color:WhiteSmoke;border-bottom-style:solid;border-bottom-width:1.5px;border-bottom-color:LightGrey;height:50px;">
            <th scope="col" style="font-weight:bold;font-family:arial;">Title Nbr</th><th scope="col" style="font-weight:bold;font-family:arial;">Reg Date</th><th scope="col" style="font-weight:bold;font-family:arial;">Type</th><th scope="col" style="font-weight:bold;font-family:arial;">Linc Nbr</th><th scope="col" style="font-weight:bold;font-family:arial;">Short Legal</th><th scope="col" style="font-weight:bold;font-family:arial;">Owner</th>
        </tr>
    </thead><tbody>
    <tr style="background-color:White;">
        <td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">001013760</td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    2000-01-14
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    NOTIFICATION (RD ABAND=CREATE TITLE)
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0028274538
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0010083;A
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    THE TOWN OF REDCLIFF.
                </td>
    </tr><tr style="background-color:WhiteSmoke;">
        <td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">001083587</td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    2000-03-31
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    SUBDIVISION PLAN
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0028344687
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0010742;1;11
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    THE TOWN OF REDCLIFF.
                </td>
    </tr><tr style="background-color:White;">
        <td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">001083587001</td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    2000-03-31
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    SUBDIVISION PLAN
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0028344695
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0010742;1;14MR
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    THE TOWN OF REDCLIFF.
                </td>
    </tr><tr style="background-color:WhiteSmoke;">
        <td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">001083587002</td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    2000-03-31
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    SUBDIVISION PLAN
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0028344703
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0010742;1;12
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    THE TOWN OF REDCLIFF.
                </td>
    </tr><tr style="background-color:White;">
        <td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">001083587003</td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    2000-03-31
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    SUBDIVISION PLAN
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0028344711
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0010742;1;13
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    THE TOWN OF REDCLIFF.
                </td>
    </tr><tr style="background-color:WhiteSmoke;">
        <td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">041236280010</td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    2004-06-23
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    SUBDIVISION PLAN
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0030537865
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    0412179;10;1
                </td><td style="text-align:left;vertical-align:middle;font-size:8pt;font-family:arial;">
                    THE TOWN OF REDCLIFF.
                </td>
    </tr>
    </tbody>
  
</table>


Here is my code that is applying the styles. All of the styles work EXCEPT for the font-family style. How to fix?

protected void RadGridSearchResults_ItemCreated(object sender, GridItemEventArgs e)
{
    if (isPdfExport)
    {
        if (e.Item != null)
        {
            if (e.Item.ItemType == GridItemType.AlternatingItem)
            {
                e.Item.Style["background-color"] = "WhiteSmoke";
            }
            else
            {
                e.Item.Style["background-color"] = "White";
            }
            if (e.Item is GridHeaderItem)
            {
                var headerItem = (GridHeaderItem)e.Item;
                headerItem.Style["background-color"] = "WhiteSmoke";
                headerItem.Style["border-bottom-style"] = "solid";
                headerItem.Style["border-bottom-width"] = "1.5px";
                headerItem.Style["border-bottom-color"] = "LightGrey";
                headerItem.Style["height"] = "50px";
                foreach (TableCell cell in headerItem.Cells)
                {
                    cell.Style["font-weight"] = "bold";
                    cell.Style["font-family"] = "arial";
                }
            }
            if (e.Item is GridDataItem)
            {
                var item = (GridDataItem)e.Item;
                foreach (TableCell cell in item.Cells)
                {
                    cell.Style["text-align"] = "left";
                    cell.Style["vertical-align"] = "middle";
                    cell.Style["font-size"] = "8pt";
                    cell.Style["font-family"] = "arial";
                }
            }
        }
    }
}

Daniel
Telerik team
 answered on 30 Dec 2010
7 answers
127 views
Hi,
I was wondering if there is a way to apply a global skin for shared calendars, eg the popup calendar on the DatePicker in the grid filtering column. I currently have the following in my skin file which is working for all Calendars of DatePickers, but the calendar in the grid filtering column appears to be of type SharedCalendar and  is not rendering the same. I can do it with code in the OnItemDataBoundEvent for the grid, but I have a lot of grids as well as some that are generated at runtime..

Any help would be most appreciated..

Thanks.

Matt.

<telerik:RadDatePicker runat="server" skin="Vista">
    <DateInput runat="server"
        onkeydown="return datePickerToday(this, event);"
        IncrementSettings-InterceptArrowKeys="false"
        IncrementSettings-InterceptMouseWheel="false"
        DateFormat="MM/dd/yyyy"
        ToolTip="Shortcut Keys:  Press 'T' for today. Use up and down arrows to change day/month/year based on cursor location." />
        <Calendar ShowRowHeaders="false" >
            <SpecialDays>
             <telerik:RadCalendarDay Repeatable="Today" Date="" IsToday="true">
               <ItemStyle CssClass="rcToday" />
             </telerik:RadCalendarDay>
            </SpecialDays>
        </Calendar>
</telerik:RadDatePicker>
Matthew
Top achievements
Rank 2
 answered on 30 Dec 2010
4 answers
74 views
I'm trying to run some code in the RadGrid1_ItemDataBound and RadGrid1_UpdateCommand events and am running into problems now that I have added a detail grid to the equation. I am using sqlDataSource for both grids, not using NeedDataSource. What is the best way to determine which grid raised the events? Should I be using NeedDatasource with the sqlDataSource as well? Thanks for any help.
AkAlan
Top achievements
Rank 2
 answered on 30 Dec 2010
5 answers
127 views
Is it possible to have a tooltip with multiple HideEvents? For example, to have ManualClose and FromCode specified so that the tooltip can either be closed by the user or closed from server-side?
Clayton
Top achievements
Rank 1
 answered on 30 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?