Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
197 views
Hi, I would like to have a filter for only two out of my three columns. My code is as follows
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" EnableAJAX="true" LoadingPanelID="RadAjaxLoadingPanel1" ClientEvents-OnRequestStart="onRequestStart" >
        <telerik:RadGrid ID="gridUsers" DataSourceID="srcUsers" runat="server" AllowPaging="true" AllowSorting="true" AllowFilteringByColumn="true" PageSize="10" AutoGenerateColumns="false">
            <GroupingSettings CaseSensitive="false" />
            <HeaderStyle Font-Bold="true" />
            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" Visible="true" EnableSEOPaging="true"/>
            <MasterTableView CommandItemDisplay="Top" AllowNaturalSort="false" DataKeyNames="distinguishedName">
                <CommandItemSettings RefreshImageUrl="~/images/refresh_button.gif" ShowExportToWordButton="false" ShowExportToExcelButton="false" ShowExportToCsvButton="true" ShowExportToPdfButton="false" ExportToWordText="" ExportToExcelText="" ExportToCsvtext="" ExportToPdfText="" ExportToWordImageUrl="~/images/export_to_doc.gif" ExportToExcelImageUrl="~/images/export_to_xls.gif" ExportToCsvImageUrl="~/images/export_to_csv.gif" ExportToPdfImageUrl="~/images/export_to_pdf.gif" />
                 
                <Columns>
                    <telerik:GridHyperLinkColumn HeaderText="Edit"  DataNavigateUrlFormatString="EditUser.aspx?user={0}" DataNavigateUrlFields="objectGUID" UniqueName="link" ShowFilterIcon="false"/>
                    <telerik:GridBoundColumn HeaderText="First Name" UniqueName="givenName" DataField="givenName" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" />
                    <telerik:GridBoundColumn HeaderText="Last Name" ItemStyle-Width="100%" HeaderStyle-Width="100%" UniqueName="sn" DataField="sn" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" />
                    <telerik:GridBoundColumn HeaderText="Created" ItemStyle-Wrap="false" UniqueName="whencreated" DataField="whencreated" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" />
                    <telerik:GridBoundColumn HeaderText="distinguishedName" UniqueName="distinguishedName" DataField="distinguishedName" Visible="false" FilterListOptions="VaryByDataType" FilterImageUrl="~/images/filter_icon.gif" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </telerik:RadAjaxPanel>

Where the gridHyperLinkColumn is edit icon that simply opens up a new page for the user to use an edit form. However, there is a filter text box above this column and I would not like it there.

Please help!
Trevor
Top achievements
Rank 1
 answered on 21 Jul 2010
3 answers
271 views
I'm using the latest version of Telerik Editor in my website and there is a problem with Editor word count.
I wrote a document in MS word and did a word count and it shows
words 280,
Characters ( no spaces) 1950 
Characters ( with spaces) 2229

I did a select all and copied the text as plain text in Telerik Editor and it gave me 
Words: 280 Characters: 2237  .
I have attached some screen shots also.
One of the screen shot is from the demo on the website ( just trying to make it sure that it's not the version problem )

var editorList = new Object();
var editorLengthArray = [20, 30];
var counter = 0;
AlreadyAlerted = false;
 
function isAlphaNumericKey(keyCode) {
    if ((keyCode > 47 && keyCode < 58) || (keyCode > 64 && keyCode < 91)) {
        return true;
    }
    return false;
}
 
function LimitCharacters(editor) {
     
    var style = editor.get_contentArea().style;
    style.backgroundImage = "none";
    style.backgroundColor = "white";
     
    editorList[editor.get_id()] = editorLengthArray[counter];
    counter++;
 
    editor.attachEventHandler("onkeydown", function(e) {
        var content = editor.get_text().trim(); //returns the editor's content as plain text
        var words = 0;
        if (content) {
            var punctRegX = /[!\.?;,:&_\-\-\{\}\[\]\(\)~#'"]/g;
            var contentcontent = content.replace(punctRegX, "");
            var trimRegX = /(^\s+)|(\s+$)/g;
            contentcontent = content.replace(trimRegX, "");
            if (content) {
                splitRegX = /\s+/;
                var array = content.split(splitRegX);
                words = array.length;
            }
        }
        var counter = $get("counter");
        counter.innerHTML = "Words: " + words + " Characters: " + content.length + "   <b>(Maximum character length is 2500)</b>";
        e = (e == null) ? window.event : e;
        if (isAlphaNumericKey(e.keyCode)) {
 
            var maxTextLength = 2500;
 
            textLength = editor.get_text().length;
            if (textLength >= maxTextLength) {
                alert('You have exceeded the maximun character count of 2500.');
                //alert('1');
                AlreadyAlerted = true;
                e.returnValue = false;
            }
        }
    });
 
function CalculateLength(editor, value) {
    var textLength = editor.get_text().length;
    var clipboardLength = value.length;
    textLength += clipboardLength;
    return textLength;
}
 
 
function ClientExecuteCommand(editor, args) {
    
        var commandName = args.get_commandName();
        var value = args.get_value();
        if (commandName == "PastePlainText" || commandName == "Paste") {
            var textLength = CalculateLength(editor, value);
            if (textLength >= 2500) {
                if (!AlreadyAlerted) {
                    alert("You have exceeded the maximun character count of 2500.");
                    }
                AlreadyAlerted = false;
                args.set_cancel(true);
 
        }
    }
}
<telerik:RadEditor ID="RadEditor1" runat="server" SkinID="" Width="100%" SpellCheckSettings-AllowAddCustom="false"  ToolsFile="../TelerikRichEditControl/ToolsFile.xml" OnClientPasteHtml="ClientExecuteCommand" Skin="Office2007" Height="300" EditModes="Design" OnClientLoad="LimitCharacters">
 
</telerik:RadEditor><span id="counter">


Really appreciate your help.
Roomi
Dobromir
Telerik team
 answered on 21 Jul 2010
1 answer
134 views
Hi,

In the EditFormTemplate or default (out-of-the-box) form, when I use the combobox with

SelectedValue

then I got the error but if I remove it then it's fine but then no item is selected.

<telerik:RadComboBox runat="server" ID="RadComboBox2" DataTextField="StateName" DataValueField="ID"
    HighlightTemplatedItems="true" Height="190px" Width="220px" DropDownWidth="420px"
    DataSourceID="sdsStates" SelectedValue='<%#Bind("ID") %>' EnableAutomaticLoadOnDemand="true"
    ItemsPerRequest="10" ShowMoreResultsBox="true" EnableVirtualScrolling="true">
    <HeaderTemplate>
        <ul>
            <li class="col1">State Name</li>
            <li class="col1">Country</li>
        </ul>
    </HeaderTemplate>
    <ItemTemplate>
        <ul>
            <li class="col1"><%# DataBinder.Eval(Container.DataItem, "StateName")%></li>
            <li class="col1"><%# DataBinder.Eval(Container.DataItem, "countryabrv")%></li>
        </ul>
    </ItemTemplate>
</telerik:RadComboBox>
Mira
Telerik team
 answered on 21 Jul 2010
2 answers
178 views
I have implemented a radmenu on my webpage. However when the client hovers over the menu the cursor stays as a pointer and we want it to display the default hand cursor (hover icon).

Is there an easy way to do this? Thanks.
josephjijo
Top achievements
Rank 1
 answered on 21 Jul 2010
1 answer
213 views
I have a grid that I have to be missing something really simple, but after hours, I am asking for some help.  The code is attached.  If I edit a grid line and update, it doesn't save the results.  It appears if the save function is working because I can hard code the key in the table I am editing, and the results save.  If I remove it and add a ?, it won't save.  On the grid1_ItemUpdated event, if I place the following, the correct key comes back.  So, something is not getting passed to the datasource.  I am JUST working on the update.  I don't anticipate the delete or insert to function correctly.  I have a FormView to a datasource and it works fine.  Thanks!

Dim strID As String = e.Item.GetDataKeyValue("ID").ToString()
Response.Write(strID)

So the event has the correct key, but the datasource doesn't not get it.  Can somebody take a look for me and tell me what I am missing?
Grid:
    
     <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="AccessDataSource2"
        GridLines="None" AutoGenerateDeleteColumn="True"
        AutoGenerateEditColumn="True" AllowAutomaticDeletes="True"
        AllowAutomaticUpdates="True" AllowAutomaticInserts="True"
        AutoGenerateColumns="False" Width="690">
<MasterTableView DataKeyNames="ID" CommandItemDisplay="TopAndBottom"
            DataSourceID="AccessDataSource2" EditMode="EditForms">

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

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
    <Columns>
        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID"
            ReadOnly="True" SortExpression="ID" UniqueName="ID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Address" HeaderText="Address"
            SortExpression="Address" UniqueName="Address">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="FirstName" HeaderText="FirstName"
            SortExpression="FirstName" UniqueName="FirstName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastName" HeaderText="LastName"
            SortExpression="LastName" UniqueName="LastName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Email" HeaderText="Email"
            SortExpression="Email" UniqueName="Email">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Company" HeaderText="Company"
            SortExpression="Company" UniqueName="Company">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="JobFunction" HeaderText="JobFunction"
            SortExpression="JobFunction" UniqueName="JobFunction">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="Resident" DataType="System.Boolean"
            HeaderText="Resident" SortExpression="Resident" UniqueName="Resident">
        </telerik:GridCheckBoxColumn>
        <telerik:GridCheckBoxColumn DataField="Owner" DataType="System.Boolean"
            HeaderText="Owner" SortExpression="Owner" UniqueName="Owner">
        </telerik:GridCheckBoxColumn>
    </Columns>
</MasterTableView>
    </telerik:RadGrid>


DataSource:
    <asp:AccessDataSource ID="AccessDataSource2" runat="server"
        DataFile="~/App_Data/HomeOwners.mdb"
        SelectCommand="SELECT * FROM [tblResidents] WHERE ([Address] = ?) ORDER BY [FirstName]"
        ConflictDetection="CompareAllValues"
        DeleteCommand="DELETE FROM [tblResidents] WHERE [ID] = ? AND (([Address] = ?) OR ([Address] IS NULL AND ? IS NULL)) AND (([FirstName] = ?) OR ([FirstName] IS NULL AND ? IS NULL)) AND (([LastName] = ?) OR ([LastName] IS NULL AND ? IS NULL)) AND (([Email] = ?) OR ([Email] IS NULL AND ? IS NULL)) AND (([Company] = ?) OR ([Company] IS NULL AND ? IS NULL)) AND (([JobFunction] = ?) OR ([JobFunction] IS NULL AND ? IS NULL)) AND [Resident] = ? AND [Owner] = ?"
        InsertCommand="INSERT INTO [tblResidents] ([ID], [Address], [FirstName], [LastName], [Email], [Company], [JobFunction], [Resident], [Owner]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)"
        UpdateCommand="UPDATE [tblResidents] SET [FirstName] = ?, [LastName] = ?, [Email] = ?, [Company] = ?, [JobFunction] = ?, [Resident] = ?, [Owner] = ? WHERE [ID] = ?">
        <DeleteParameters>
            <asp:Parameter Name="original_ID" Type="Int32" />
            <asp:Parameter Name="original_Address" Type="String" />
            <asp:Parameter Name="original_Address" Type="String" />
            <asp:Parameter Name="original_FirstName" Type="String" />
            <asp:Parameter Name="original_FirstName" Type="String" />
            <asp:Parameter Name="original_LastName" Type="String" />
            <asp:Parameter Name="original_LastName" Type="String" />
            <asp:Parameter Name="original_Email" Type="String" />
            <asp:Parameter Name="original_Email" Type="String" />
            <asp:Parameter Name="original_Company" Type="String" />
            <asp:Parameter Name="original_Company" Type="String" />
            <asp:Parameter Name="original_JobFunction" Type="String" />
            <asp:Parameter Name="original_JobFunction" Type="String" />
            <asp:Parameter Name="original_Resident" Type="Boolean" />
            <asp:Parameter Name="original_Owner" Type="Boolean" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="Company" Type="String" />
            <asp:Parameter Name="JobFunction" Type="String" />
            <asp:Parameter Name="Resident" Type="Boolean" />
            <asp:Parameter Name="Owner" Type="Boolean" />
        </InsertParameters>
        <SelectParameters>
            <asp:SessionParameter Name="Address" SessionField="Address" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="FirstName" Type="String" />
            <asp:Parameter Name="LastName" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="Company" Type="String" />
            <asp:Parameter Name="JobFunction" Type="String" />
            <asp:Parameter Name="Resident" Type="Boolean" />
            <asp:Parameter Name="Owner" Type="Boolean" />
            <asp:Parameter Name="ID" Type="Int32" />
        </UpdateParameters>
    </asp:AccessDataSource>
Pavlina
Telerik team
 answered on 21 Jul 2010
1 answer
90 views
Hi

I have datetimecolumn in my grid when i disable the control on itemdatabound event.the page loads properly but when i move the mouse on the datetimecolumn control it gives script error "Object doesnt support this property or method" in Telerik.Web.UI.Webresource.axd.

Is there any workaround or hotfix.

Its urgent Please help


Regards

Sathya
Pavlina
Telerik team
 answered on 21 Jul 2010
3 answers
164 views

I am trying to add special days dynamically, I have set the template of the special day via aspx, and I am trying to assign it the dates with code on DayRender event. Thing is, it's not happening.

The aspx code goes:

 <telerik:DayTemplate ID="DisableTemplate" runat="server">
                <Content>
                    <div class="rcTemplate rcDayDisabled">                      
                    </div>
                </Content>
            </telerik:DayTemplate>
the css:

.RadCalendar_Special .rcRow .rcDayDisabled
{
    background:0 0 no-repeat url(Disabled.gif);
}

the c#:

  protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
        {
            if (e.Day.Date < DateTime.Now.Date)
            {
                RadCalendarDay RadDay = new RadCalendarDay();
                RadDay.TemplateID = "DisableTemplate";
                RadDay.Date = e.Day.Date;
                e.Cell.CssClass = "rcDayDisabled";
                RadCalendar1.SpecialDays.Add(RadDay);
                }
}
also I noticed that without the property: Repeatable="DayInMonth" filled the special day will not appear... is there a solution to these problems:

Tsvetina
Telerik team
 answered on 21 Jul 2010
1 answer
95 views
Hi,
    I was wondering whether there is a true InPlace editing in the RadGrid.
I explain: I've looked at your documentation and I've tried to set the EditMode="InPlace" and nothing happened.
Then I digged more on the subject and I found out that I should manage the double click event of the grid.
I copied the example I found in the documentation and it worked, but, sadly, I noticed it is performing a partial update of the page (don't like).
Then I looked in your online examples and found this:
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx
Perfect: it is not performing partial updates, but then I look at the page code and I see two hundred lines of javascript codes where you on the basis of the column name extract the info necessary to update the UI.

The question is: is all of this necessary? Is there not any built in way (without writing tons of JS or performing postbacks) to perform in place editing?

Best regards, Andrea Pirola
Iana Tsolova
Telerik team
 answered on 21 Jul 2010
3 answers
177 views
Is there a way to turn off all the font styles that a raddock generates? I have the following configuration on my page:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label ID="LabelAdmin" runat="server" Text="" />
    <telerik:RadDockZone ID="RadDockZoneContentBlock1" runat="server" MinHeight="50px" MinWidth="100px" BorderStyle="None">
        <telerik:RadDock ID="RadDockContentBlock1" runat="server" DockHandle="None" DefaultCommands="None" OnClientInitialize="SetHandleDock" DockMode="Docked">
            <ContentTemplate>
                <div id="Handle_ctl00_ContentPlaceHolder1_RadDockContentBlock1" style="cursor: move;">
                    <uc1:ContentBlock ID="ContentBlock1" ContentID="1" runat="server" />
                </div>
            </ContentTemplate>
        </telerik:RadDock>
    </telerik:RadDockZone>
</asp:Content>

I have attached 2 images to this, the "correct style.png" is how it is supposed to look on the page. The "wrong style.png" is how it looks when i create the same page using the above layout. If I move the content blocks outside the raddock it looks just fine, as well I used firebug and turned of some skins and styles on the raddock and the preview firebug shows looked correct as well. I have tried turning on and off pretty much every property I can find for raddocks but nothing fixes the problem.
Bozhidar
Telerik team
 answered on 21 Jul 2010
1 answer
106 views
I attached a file

So, why subject, attachment column are not allign? when i specify horizontal align and vertical align properties for this items

when i pres with mouse some of the field then it will auto-align them, but in first load - its not align
very strange

is it because of the icons on the end?

<telerik:GridCheckBoxColumn
                            DataField="fldIsSent"
                            HeaderText="Sent:"
                            UniqueName="fldIsSent"
                            Visible="false">                        
                          <ItemStyle  width="40px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                          <HeaderStyle width="40px" VerticalAlign="Middle" HorizontalAlign="Center" ></HeaderStyle>
</telerik:GridCheckBoxColumn>
 <telerik:GridTemplateColumn
                            UniqueName="EditColumn"
                            HeaderText="Edit/View">
                              <ItemTemplate>
                                    <a href="#" onclick="ShowUpdateForm('<%#DataBinder.Eval(Container.DataItem,"fldEmailID")%>','<%#DataBinder.Eval(Container.DataItem,"fldMeetingID")%>'); return false;">
                                        <asp:ImageButton ID="ibEditViewEmail" ImageUrl='../images/Email/email_edit.png' ToolTip="Edit/View Email"  runat ="server" alt="" style="cursor:hand;vertical-align: middle;" />
                                    </a>
                                </ItemTemplate>
                           <HeaderStyle  Width="50px" VerticalAlign="Middle" HorizontalAlign="Center"></HeaderStyle>
                           <ItemStyle  Width="50px" VerticalAlign="Middle" HorizontalAlign="Center" Wrap="false"></ItemStyle>
                        </telerik:GridTemplateColumn>
Pavlina
Telerik team
 answered on 21 Jul 2010
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?