Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
963 views
Here's my preliminary layout code for a simple button:

<telerik:RadButton ID="buttonReport" runat="server" AutoPostBack="true" Text="Summary" Font-Size="X-Small" BackColor="LightBlue" Icon-PrimaryIconCssClass="rbPrint" />

Why can't I set the background color?

Robert
Robert
Top achievements
Rank 1
 answered on 29 Sep 2014
1 answer
66 views
Hi Telerik Team,

I am having issue, regarding this i have described like below please go-through once.

First Screenshot: This represents given all details with Signature.

Second Screenshot: This represents after Generating required popup the Selected Signature Erased, this is the issue.

please suggest me if there is any solution.


Here is my Code Snippet:
-------------------------------------
.Aspx:
=====
<asp:UpdatePanel ID="upnl1" runat="server">
        <ContentTemplate>
            <table width="613">
                <tr>
                    <td>
                        <telerik:RadFilter runat="server" ID="RadFilter1" FilterContainerID="RadGrid1" ShowApplyButton="true"
                            ApplyButtonText="Apply Filter">
                        </telerik:RadFilter>
                    </td>
                </tr>
            </table>
            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="false"
                AllowSorting="true" PageSize="10" OnNeedDataSource="RadGrid1_NeedDataSource"
                AllowPaging="true" Width="600px" ValidationSettings-ValidationGroup="A" CssClass="grid1"
                EnableHeaderContextMenu="true" OnInsertCommand="RadGrid1_InsertCommand" OnUpdateCommand="RadGrid1_UpdateCommand"
                OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound">
                <EditItemStyle BackColor="Gray" />
                <GroupingSettings CaseSensitive="false" ShowUnGroupButton="true" />
                <MasterTableView runat="server" AutoGenerateColumns="false" AllowSorting="true" AllowCustomSorting="true"
                    AllowFilteringByColumn="false" CommandItemDisplay="Top" TableLayout="Auto" DataKeyNames="id">
                    <CommandItemSettings ShowAddNewRecordButton="true" ShowRefreshButton="true" />
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                    <CommandItemStyle CssClass="lnkNormal" />
                    <AlternatingItemStyle Height="10px" BackColor="#EAEAEA" ForeColor="#424242" Font-Size="12px" />
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" FooterText="EditCommand footer"
                            EditImageUrl="images/Edit.gif" UniqueName="id" HeaderStyle-Width="40px" />
                     
                        <telerik:GridTemplateColumn DataField="Signature1" HeaderText="Signature" AllowFiltering="false"
                            UniqueName="Signature1" FilterControlWidth="35px" HeaderStyle-Width="100px">
                            <ItemTemplate>
                                <asp:ImageButton OnClick="img_Click" Height="30" Width="80" runat="server" ImageUrl='<%#"ImageHttpHandler.ashx?ProductID="+Eval("id")%>' />
                                <%--<telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("Signature1") %>'
                            AutoAdjustImageControlSize="false" Height="30px" Width="70px" ToolTip="signature"
                            AlternateText="image" ImageUrl="~/images/emptysignature.png"></telerik:RadBinaryImage>--%>
                            </ItemTemplate>
                            <InsertItemTemplate>
                                <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" AllowedFileExtensions=".jpg,.jpeg,.png,.gif"
                                    MaxFileInputsCount="1" Width="200px" onclick="shouldConfirm = true;" PostbackTriggers="PerformInsertButton"
                                    Localization-Select="..." />
                                <asp:Label ID="lblupload1" runat="server" Visible="false" CssClass="error"></asp:Label>
                            </InsertItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadAsyncUpload ID="RadAsyncUpload2" runat="server" AllowedFileExtensions=".jpg,.jpeg,.png,.gif"
                                    MaxFileInputsCount="1" Width="200px" onclick="shouldConfirm=true;"
                                    Localization-Select="...">
                                </telerik:RadAsyncUpload>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>

                    </Columns>
                    <EditFormSettings InsertCaption="Create Impound Signatures" CaptionDataField="ServiceID"
                        CaptionFormatString="Edit Impound Signatures">
                        <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                        <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                        <FormStyle Width="150%" BackColor="WhiteSmoke" />
                        <EditColumn UniqueName="GridID" ButtonType="ImageButton" CancelImageUrl="images/Cancel.gif"
                            UpdateImageUrl="images/update.gif" InsertImageUrl="images/update.gif">
                        </EditColumn>
                        <FormTableButtonRowStyle HorizontalAlign="Center" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                    </EditFormSettings>
                </MasterTableView>
                <ClientSettings AllowColumnsReorder="true" EnableRowHoverStyle="true">
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ScrollHeight="250px"
                        FrozenColumnsCount="1"></Scrolling>
                    <Selecting AllowRowSelect="true" />
                    <Resizing AllowColumnResize="true" AllowRowResize="false" ResizeGridOnColumnResize="true"
                        ClipCellContentOnResize="true" EnableRealTimeResize="false" AllowResizeToFit="false" />
                </ClientSettings>
                <SelectedItemStyle CssClass="rgSelectedRow"></SelectedItemStyle>
            </telerik:RadGrid>
        </ContentTemplate>
    </asp:UpdatePanel>

.Aspx.cs:
======

RadAsyncUpload RadAsyncUpload1 = (RadAsyncUpload)item.FindControl("RadAsyncUpload1") as RadAsyncUpload;

if (local_dts.Tables[0].Rows[i]["DefaultSign"].ToString()=="Yes")
                        {
                            count = 1;
                            RadWindowManager1.RadAlert("Default sign Already Selected.If u want to   choose  another please uncheck this", 330, 100, "TaxImpound", "");
                        }
Viktor Tachev
Telerik team
 answered on 29 Sep 2014
7 answers
574 views
Hello,

I was attempting to use a CustomValidator with a RadDatePicker and the validation function seems not to function. The same date picker has both a RequiredFieldValidator and CustomValidator. What I'm finding is that the custom validation client script is never fired. I'm not getting any javascript function errors either. The required field validator does however fire and properly prevents postback.

Code basically looks like this

<telerik:RadDatePicker runat="server" ID="dpkStart"  Culture="<%# vRIS.Business.Utility.DateFormatProvider.RISCulture %>" MinDate="<%# DateTime.Now.Date %>" SelectedDate="<%# DateTime.Now.Date %>" />
<asp:RequiredFieldValidator runat="server" ID="StartSearchingValidator" EnableClientScript="True" ControlToValidate="dpkStart" ValidationGroup="Availability" Display="Dynamic" Enabled="true" ErrorMessage="Search beginning is required" SetFocusOnError="True"  />
<asp:CustomValidator ID="valChecks" ControlToValidate="dpkStart" EnableClientScript="true" Enabled="true" ValidationGroup="Availability" Display="Dynamic" ClientValidationFunction="selfScheduleAvailability.validateAvailabilitySelection" ErrorMessage="Please select an availability day/time" runat="server"></asp:CustomValidator>

------- In a top level control, the submit button can be found.
<Portal:SubmitButton ID="btnAdvToConfirmation" Text="Schedule" OnClick="btnAdvToConfirmation_Click" ValidationGroup="Availability" CausesValidation="true" Width="130" runat="server" />
Carlo
Top achievements
Rank 1
 answered on 29 Sep 2014
1 answer
89 views
Currently I'm facing a RadGrid issue/bug where I'm unable to bring up the correct Edit input row.
Only happen if holding down your mouse while you click on a cell and drag away the mouse elsewhere and let go of the mouse click.

I have created an example scenario. The code is down below.
The first column is a GridTemplateColumn which contains a RadComboBox.
The second column is a GridBoundColumn. 

RadGrid Settings:
            <ClientSettings>
                <Selecting AllowRowSelect="False" CellSelectionMode="SingleCell" />
                <ClientEvents OnCellSelected="onCellSelected" />
            </ClientSettings>
            <MasterTableView EditMode="Batch">
            <BatchEditingSettings EditType="Cell" />

Here is a scenario to reproduce the symptoms that I'm facing.
* Click on a GridTemplateColumn column cell which brings up the correct EditItemTemplate row and user can enter their input, etc.
* Click on a different GridTemplateColumn column cell and hold down your mouse while you click and drag away the mouse elsewhere and let go of the mouse click.
* Radgrid will highlight the correct GridTemplateColumn column cell however the previous EditItemTemplate row is still displays in edit mode.
* Repeat same step on to a different column.

~Any help would be greatly appreciated.

Markup
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <script>
 
        function onCellSelected(sender, a_args)
        {
            var v_gridItem = a_args.get_gridDataItem();
            console.log(v_gridItem._element.sectionRowIndex);
            var selectedColumn = a_args.get_column();
            var dataItem = a_args.get_gridDataItem();
            var output = String.format("The selected cell is located in column with name: " + selectedColumn.get_uniqueName() + " and in row with index: " + dataItem.get_itemIndexHierarchical() + ".");
            console.log(output);
        }
    </script>
    <div>
        <telerik:RadGrid runat="server" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" >
            <ClientSettings>
                <Selecting AllowRowSelect="False" EnableDragToSelectRows="false" CellSelectionMode="SingleCell" />
                <ClientEvents OnCellSelected="onCellSelected"/>
            </ClientSettings>
            <MasterTableView EditMode="Batch" AutoGenerateColumns="False">
                <BatchEditingSettings EditType="Cell" />
                <Columns>
                    <telerik:GridTemplateColumn UniqueName="Data" ItemStyle-BackColor="" FilterControlWidth="100px" ItemStyle-Width="100px" Resizable="false" HeaderStyle-Width="110px"
                        DataField="Col2" HeaderText="Col0" FilterImageUrl="~/images/funnel-icon.png">
                        <ItemTemplate>
                            <%# Eval("Col2")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadComboBox ID="RadComboBoxData" runat="server" EnableViewState="false" IsCaseSensitive="False" DropDownAutoWidth="Enabled" Height="125" Width="113%"
                                DropDownWidth="250" NoWrap="true" OnClientKeyPressing="" EnableItemCaching="true" />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                     <telerik:GridBoundColumn DataField="Col1" UniqueName="Col1" HeaderText="Col1" HeaderStyle-Width="60px" Resizable="false" AllowFiltering="false"
                        ReadOnly="False" Display="true" Visible="true" ItemStyle-ForeColor="Blue" HeaderStyle-HorizontalAlign="Center" />
      
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
using System;
using System.Data;
using Telerik.Web.UI;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Col1");
        dt.Columns.Add("Col2");
 
        for (int i = 0; i < 20; i++)
        {
            dt.Rows.Add(new object[] {i, string.Format("desc_{0}", i)});
        }
        RadGrid1.DataSource = dt;
    }
}




Eyup
Telerik team
 answered on 29 Sep 2014
1 answer
267 views
I've verified that my parent item data matches the parent nodes, and I've nulled the parent "parent item" field so the parents show up, but no child items show up no matter what I do to tweak things.

I've read every thread I can find and this should be so simple from the demo examples.

is there some trick I'm missing that I can't find the post for?

Here's my markup:

<telerik:RadTreeList ID="RadTreeList1" runat="server" OnNeedDataSource="RadTreeList1_NeedDataSource" ParentDataKeynames="Owner" DataKeyNames="Title" AutoGenerateColumns="false" OnItemDataBound="RadTreeList1_ItemDataBound" > <Columns> <telerik:TreeListBoundColumn DataField="Title" UniqueName="Title" HeaderText="Menu Item"> </telerik:TreeListBoundColumn> <telerik:TreeListBoundColumn DataField="Owner" UniqueName="Owner" HeaderText="Parent Item"> </telerik:TreeListBoundColumn> <telerik:TreeListBoundColumn DataField="Time" UniqueName="Time" HeaderText="Children"> </telerik:TreeListBoundColumn> <telerik:TreeListBoundColumn DataField="Notes" UniqueName="Notes" HeaderText="Notes"> </telerik:TreeListBoundColumn> </Columns> </telerik:RadTreeList>
Eyup
Telerik team
 answered on 29 Sep 2014
1 answer
332 views
Hi ,

     I have a doubt regarding how to find the controls which are present in form template of radgrid  in javascript function.

 In my web page i have used radgrid and inside that i have used editform template. In form template i have used 5 radnumeric textbox controls. I have to take the value from these textbox and sum it and have to show it in another textbox named as "Total" . The value should be auto calculated. So, for this i am using client side event onBlur. But i am not able to find the controls of the textbox which is present inside the form template in javascript function. Kindly help me to get the values of radnumeric textbox in javascript function.

function test(sender, args) {
var editIndex = $find("<%=txtValue1.ClientID %>"); 
}

here txtValue1 is the ID of radnumeric textbox and i am getting null in editIndex.

Thanks
Viktor Tachev
Telerik team
 answered on 29 Sep 2014
12 answers
316 views
Hi all,

So how can i test if a file is the extension i want before it is posted on the page with the red signal.
Whant i want to do its only put the one that are correct and message the wrong ones?

Best Regards
Boyan Dimitrov
Telerik team
 answered on 29 Sep 2014
2 answers
80 views
How can I change an image on a RibbonBarSplitButton when clicks a RibbonBarButton?

<telerik:RibbonBarSplitButton Size="Large" Text="Days"  Value="TypeInterval" ImageUrlLarge="~/Images/Calendar32.png">
      <Buttons>
             <telerik:RibbonBarButton Value="TypeCalendar" ImageUrl="~/Images/Calendar16.png" Text="Days" />
             <telerik:RibbonBarButton Value="TypeTime" ImageUrl="~/Images/Time16.png" Text="Times" />
       </Buttons>
</telerik:RibbonBarSplitButton>

In RadRibbonBar I use OnClientSplitButtonClicking="MenuItem".

function findSplitButton(sender, buttonValue) {
                    for (var i = 0; i < sender.get_tabs().get_count() ; i++) {
                        var tab = sender.get_tabs().getTab(i);
                        for (var j = 0; j < tab.get_groups().get_count() ; j++) {
                            var group = tab.get_groups().getGroup(j);
                            for (var k = 0; k < group.get_items().get_count() ; k++) {
                                var item = group.get_items().getItem(k);
                                var customAttribute = item.get_element().getAttribute('Value');
                                if (customAttribute != null && customAttribute == buttonValue) {
                                    return item;
                                }
                            }
                        }
                    }
                }
 
function MenuItem(sender, args) {
                    var value = args.get_button().get_value();
                    var button = findSplitButton(sender, 'TypeInterval');
                    switch (value) {
                       case "TypeCalendar":
                            button.set_imageUrlLarge("~/Images/Calendar32.png");
                            break;
 
                        case "TypeTime":
                            button.set_imageUrlLarge("~/Images/Time32.png");
                            break;
                    }
                }
Picture does not change.

Thanks,
Oleg
Oleg
Top achievements
Rank 1
 answered on 29 Sep 2014
1 answer
71 views
Hello Friends,

I am using "RowDrop" Event of Telerik grid and in that e.DestDataItem is coming always null with RadAjaxManager.

If I remove RadAjaxManager its working fine.

Please suggest.

Thank you!
Vishal
Maria Ilieva
Telerik team
 answered on 29 Sep 2014
0 answers
101 views
How to set selected color of RadColorPicker to WebPalette?
Steps - 
1) Go to this demo https://demos.telerik.com/aspnet-ajax/colorpicker/examples/recentandcustomcolors/defaultcs.aspx
2) Click on button to open WebPalette color picker.
3) select any color and click on ok on WebPalette color picker.
4) Now click again on button to open WebPalette color picker, now you can see there by default its #808080 selected.
How can we set this default color to be the last selected color? so that next time when we open WebPalette, it should select last selected color by default.
Mangesh
Top achievements
Rank 1
 asked on 29 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?