Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
192 views

I'd like to display the first 30 or so characters of an nvarchar(max) field in my radgrid along with a "Read More ..." type link to display the rest of the datafield.

I'd like the link to either expand the rest of the column to a max width of a few hundred pixels or use javascript to put the data into a window of some sort.

Has anyone done with this before?  If so, please point me the right direction.  Thanks much.

Pavlina
Telerik team
 answered on 11 Jun 2015
2 answers
159 views

<telerik:RadTreeView ID="rtvCarnac" runat="server" Skin="Glow" BackColor="Black" Visible="true"
ForeColor="White" OnNodeDataBound="rtvCarnac_NodeDataBound"  OnNodeClick="rtvCarnac_NodeClick" OnClientDoubleClick="SelectNode" >
</telerik:RadTreeView>

 

 

If I click on node it will firing node click event. If I double click on node it will firing node click event. double click event is not firing. How can i slove this issue???????

Kapavarapu
Top achievements
Rank 1
 answered on 11 Jun 2015
3 answers
145 views

Hello,

I have a radgrid on a page with a custom control as an edit form.

Within the custom control, there is a button which among other things it also adds a record to another radgrid on the same page (not the parent of the custom control). The button closes the custom control with <editedItem.OwnerTableView.ClearEditItems()>.

On which event I must include the rebind command of that second radgrid?

Is there an event which fires when an editform is closed?

 Thanks for your time...

 

 

Eyup
Telerik team
 answered on 11 Jun 2015
13 answers
732 views
Hi,

How to collapse all rows and columns for the initial load?

TIA.
Javier
Top achievements
Rank 1
 answered on 10 Jun 2015
1 answer
428 views

As I'm sure that you will understand, I have spent hours attempting various methods of self-solving this issue, but haven't been able to get it resolved, and am hoping that someone can give me a hand with this.  

My edit form contains only one field that excepts data from the user.  Once that value has been entered, or edited, on TextChanged the other textboxes should be populated with values resulting from calculations.  Four grid values are used in the calculations.

 I need to access each of the four provided values, perform the calculations, and load the results in the text boxes in the edit form, allowing the user to save the changes to refresh the grid.

 THIS DID NOT WORK: ClientEvents-OnBlur="calculateNetCash"

function onBlur(sender, args) {

    var textBox1;
    var textBox2;
    var textBoxTotal = $telerik.findControl(sender.get_parent().get_element(), "RadNumericTextBox3");
    var total;
 
    // get reference to the other RadNumericTextBox controls here
     
 
    // calculate the total
     
    // set the value for the last RadNumericTextBox
    textBoxTotal.set_value(total);

}

WHAT'S WORKING.  I can obtain the value of txtCashIn using  onChange = calculateNetCash(this)  and the values necessary for performing the calculation, using:

 Protected Sub OnItemDataBoundHandler(ByVal sender As Object, ByVal e As GridItemEventArgs)
        If e.Item.IsInEditMode AndAlso TypeOf e.Item Is GridEditFormItem Then
            Dim editForm As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
            Dim commissionRate As TextBox = DirectCast(editForm.FindControl("txtCommissionRate"), TextBox)
            Dim a As String
            a = commissionRate.Text
        End If

 End Sub

  These are my best test scenarios.  I figured that I could use hidden fields and then JavaScript to access the values for calculations.  But have not found any method, after hours of searching and testing, to reference the text boxes in the edit form template to store the values.

 

MY CODE

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="sdsGetDailyPayroll" Width="315px"
                    AutoGenerateColumns="False"
                    Skin="Bootstrap"
                    CssClass="RadGrid"
                    PageSize="5"
                    GridLines="None"
                    AllowPaging="True"
                    AllowSorting="True"
                    AllowAutomaticUpdates="True"
                    AllowAutomaticInserts="True"
                    AllowAutomaticDeletes="True"
                    ShowStatusBar="true"
                    OnItemDataBound="OnItemDataBoundHandler"
                    OnPreRender="RadGrid1_PreRender">

                    <MasterTableView
                        ShowFooter="false"
                        DataSourceID="sdsGetDailyPayroll"
                        DataKeyNames="EmpID"
                        CommandItemDisplay="Bottom"
                        GridLines="None"
                        AllowFilteringByColumn="False"
                        AllowSorting="True">

                        <PagerStyle PageSizes="3,4,5,6,7,8,9,10,25,50,100"
                            PageButtonCount="3"
                            PagerTextFormat=""
                            Width="315px"
                            Wrap="False" />

                        <Columns>
                            <telerik:GridBoundColumn UniqueName="PayrollDate" HeaderText="Date" DataField="PayrollDate"
                                DataFormatString="{0:d}">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="CashReceived" HeaderText="Cash In" DataField="CashReceived">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="DailyPayroll" HeaderText="Daily Payroll" DataField="DailyPayroll">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="PooledWages" HeaderText="Pooled?" DataField="PooledWages" Visible="false">
                                <HeaderStyle Width="25px"></HeaderStyle>
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="RentDeduction" HeaderText="Rent" DataField="RentDeduction" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="ExpenseDeduction" HeaderText="Expense" DataField="ExpenseDeduction" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="NetReceived" HeaderText="Net Cash In" DataField="NetReceived" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="Commission" HeaderText="Commission" DataField="Commission" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="DiscountCredit" HeaderText="Discounts" DataField="DiscountCredit" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="CommissionRate" HeaderText="Commission Rate" DataField="CommissionRate" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn UniqueName="ExpenseRate" HeaderText="ExpenseRate" DataField="ExpenseRate" Visible="false">
                            </telerik:GridBoundColumn>

                        </Columns>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                <div style="width: 280px; margin-right: 10px; margin-left: 10px; background-color: #f2f2f2; border: 2pt solid #D2D2D2; border-radius: 5px; padding: 5px">

                                    <table id="Table1" cellspacing="2" cellpadding="1" width="100%" border="0"
                                        rules="none" style="border-collapse: collapse;">

                                        <tr>
                                            <td>Payroll Date:</td>
                                            <td>
                                                <telerik:RadDatePicker ID="RadDatePicker1" runat="server" TabIndex="1"
                                                    Skin="Bootstrap"
                                                    MinDate="1/1/1900"
                                                    DbSelectedDate='<%# Bind("PayrollDate")%>'
                                                    Width="125px">
                                                </telerik:RadDatePicker>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td>Cash In:</td>
                                            <td>
                                                <asp:TextBox ID="txtCashIn" runat="server" TabIndex="2"
                                                    Text='<%# Bind("CashReceived")%>'
                                                    Width="75px"
                                                    OnChange="calculateNetCashIn(this)">
                                                </asp:TextBox>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td>Less Rent:</td>
                                            <td>
                                                <asp:TextBox ID="txtRentDeduction" runat="server" TabIndex="3"
                                                    Text='<%# Bind("RentDeduction")%>'
                                                    Width="75px">
                                                </asp:TextBox>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td>Less Expenses:</td>
                                            <td>
                                                <asp:TextBox ID="txtExpenseDeduction" runat="server" TabIndex="4"
                                                    Text='<%# Bind("ExpenseDeduction")%>'
                                                    Width="75px">
                                                </asp:TextBox>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td>NET CASH IN:</td>
                                            <td>
                                                <asp:TextBox ID="txtNetCashIn" runat="server" TabIndex="5"
                                                    Text='<%# Bind("NetReceived")%>'
                                                    Width="75px">
                                                </asp:TextBox></td>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td>Pooled Wages?</td>
                                            <td>
                                                <asp:CheckBox ID="CheckBox1" runat="server" TabIndex="6"
                                                    Checked='<%# Bind("PooledWages")%>'
                                                    Width="75px" />
                                            </td>
                                            <td>&nbsp;</td>
                                        </tr>

                                        <tr>
                                            <td>Commission</td>
                                            <td>
                                                <asp:TextBox ID="TextBox3" runat="server" TabIndex="7"
                                                    Text='<%# Bind( "Commission") %>'
                                                    Width="75px">
                                                </asp:TextBox>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td>Discount Credit:</td>
                                            <td>
                                                <asp:TextBox ID="TextBox7" runat="server" TabIndex="8"
                                                    Text='<%# Bind( "DiscountCredit") %>'
                                                    Width="75px">
                                                </asp:TextBox>
                                            </td>
                                        </tr>

                                        <tr>
                                            <td>TOTAL PAYROLL:</td>
                                            <td>
                                                <asp:TextBox ID="TextBox10" runat="server" TabIndex="9"
                                                    Text='<%# Bind( "DailyPayroll") %>'
                                                    Width="75px">
                                                </asp:TextBox></td>
                                        </tr>

                                        <tr>
                                            <td>Commission Rate:</td>
                                            <td>
                                                <asp:TextBox ID="txtCommissionRate" runat="server" TabIndex="11"
                                                    Text='<%# Bind("CommissionRate")%>'
                                                    Width="75px">
                                                </asp:TextBox></td>
                                        </tr>
                                        <tr>
                                            <td>Expense Rate:</td>
                                            <td>
                                                <asp:TextBox ID="txtExpenseRate" runat="server" TabIndex="12"
                                                    Text='<%# Bind( "ExpenseRate") %>'
                                                    Width="75px">
                                                </asp:TextBox></td>
                                        </tr>
                                    </table>

                                </div>
                            </FormTemplate>
                        </EditFormSettings>

                    </MasterTableView>
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="False"></Selecting>
                    </ClientSettings>
                </telerik:RadGrid>

THANK YOU

Carol
Top achievements
Rank 1
 answered on 10 Jun 2015
2 answers
72 views

My List is displaying correctly and filtering correctly however when selecting item all that is selected is the type name ??
  

<telerik:RadComboBox ID="rcbEmployeeFilter" AllowCustomText="True" runat="server"
               Width="200px" Height="400px"
                 
               DataValueField="empID"
               DataSourceID="odsEmployees"
               EmptyMessage="Search for people..."
               ResolvedRenderMode="Classic"
                
               >
               <ItemTemplate>
                   <%# DataBinder.Eval(Container.DataItem, "empID")%> -
                   <%# DataBinder.Eval(Container.DataItem, "empFirstName")%> <%# DataBinder.Eval(Container.DataItem, "empLastName")%>
               </ItemTemplate>
           </telerik:RadComboBox>
            
           <asp:ObjectDataSource ID="odsEmployees" runat="server"
           SelectMethod="GetEmployees"
           TypeName="PMTReports.BLL.Person.Employee" OldValuesParameterFormatString="original_{0}"
           >
 
       </asp:ObjectDataSource>

 Please tell me what I am missing or what to change?

 

Dan
Top achievements
Rank 1
 answered on 10 Jun 2015
2 answers
100 views

Hi,

I have read this article that explains how to use ItemCreated to localize declarative grid column headers. I have tried doing this in Page_Load using the grid.Columns collection and it seems to work fine + it is easier to work with a GridColumn for setting HeaderText as I have access to the UniqueName and Filter Tooltip properties.

Is there any reason not to do this?

Al
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 10 Jun 2015
5 answers
119 views
I'm trying to create a RadHtmlChart Funnel chart but connect it to a sqldatasource.  I am able to set the datasourceID just fine but I can't fine any examples of how to set the funnelseriesitem to the values being returned from my dataset.  Can someone give me an example of how to set these values?  The example demo only shows hard-coded values and the example for connecting to a sqldatasource is for a different type of chart.
Dusty
Top achievements
Rank 1
 answered on 10 Jun 2015
2 answers
145 views

Good day,

I'm currently migrating some user controls to telerik to use the new features. One of our user controls was a image upload control. Basically it had an asp.net img object and a stardard asp.net file upload object.

I changed it for a RadBinaryImage and a RadAsyncUpload. So far, the changes have worked. But I encountered a problem. Due to the lack of validation that the old control had, users could upload any file even if it wasn't images (like pdf, .doc, etc). Of course, it was not displayed properly on the asp.img object but it didn't show any exception, just an "x" sign. With the new user control, when I'm navigating through the records in a table and the control encounters one with a byte array that doesn't correspond to an image, it throws the following exception: "ArgumentException: The provided binary data may not be valid image or may contains unknown header".

I've read several posts in the forum and I already know that this exception is thrown because of the invalid format of the file loaded and that's ok, but I wanted to take control of this error if it happens so I did the following changes in the user control (ascx):

public void ShowImage(byte[] img)
{
    try
    {
        String strImageSessionName = String.Format("imagen{0}", imgMuestra.ClientID);
        Session[strImageSessionName] = img;
        imgMain.DataValue = img;
        imgTooltip.DataValue = img;
        imgMuestra.Style["cursor"] = "pointer";
        this.EnableTooltip = true;
    }
    catch (Exception)
    {
        imgMain.ImageUrl = "~/images/image_not_available.jpg";
        imgTooltip.ImageUrl = "~/images/image_not_available.jpg";
        this.EnableTooltip = false;
    }
     
}
 

 If there's any error when loading the bytes into the control I want to show instead a fixed image. The problem is that the catch block is never reached. It always do the try block entirely even if the data is in an incorrect format. The exception is thrown later in a uncontrolled manner by the form making the form crash.

What could I do to catch this error if it happens and achieve what I want? Thanks in advance for any help.

David
Top achievements
Rank 1
 answered on 10 Jun 2015
2 answers
70 views

I'm new to Telerik. Quite liking the toolkit so far. I encountered some strange behavior I would like some help with.
I'm using Internet Explorer 11.0.19. This bug seems to only happen in that browser, and not on Firefox.

I have a RadEditor with the page load function to turn enable comments and tracking. The problem is after it is turned on, on page load, clicking on a dropdown toolbar item would not do anything, i.e. no dropdown options shown. Getting rid of the code seems to fix the problem, but I need to have the flexibility to turn off and on comments and tracking from code-behind, as I'd like to dynamically change the comments and tracking options depending on the logged in user.

The bug seems to only happen if the first thing I do after page load is click on the dropdown options. If I click on the RadEditor content pane, everything would work fine.

Other things I tried:
* Focus RadEditor on page load (Didn't work)
* Move the C# code of enabling the comments and track changes to RadEditor onload, and oninit (Didn't Work, still same problem)

WebForm2.aspx content:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Telerik RadEditor Bug Problem Demonstration.aspx.cs" Inherits="TelerikRadEditor.WebForm2" %><br><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><br><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"><br></asp:Content><br><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"><br>    <telerik:Radeditor CssClass="RadEditorCustomCSS" runat="server" ID="RadEditor" AutoResizeHeight="true"<br>        ToolsFile="EditorRibbonBar.xml" ToolbarMode="RibbonBar" StripFormattingOptions="MsWord,ConvertWordLists" ContentFilters="DefaultFilters,PdfExportFilter"><br>        <ImageManager ViewPaths="~/fileuploads/images" UploadPaths="~/fileuploads/images" DeletePaths="~/fileuploads/images" EnableImageEditor="true" MaxUploadFileSize="26214400"/><br>        <MediaManager ViewPaths="~/fileuploads/media" UploadPaths="~/fileuploads/media" DeletePaths="~/fileuploads/media" MaxUploadFileSize="26214400"/><br>        <FlashManager ViewPaths="~/fileuploads/flash" UploadPaths="~/fileuploads/flash" DeletePaths="~/fileuploads/flash" MaxUploadFileSize="26214400"/><br>        <TemplateManager ViewPaths="~/fileuploads/templates" UploadPaths="~/fileuploads/templates" DeletePaths="~/fileuploads/templates" MaxUploadFileSize="26214400"/><br>        <DocumentManager ViewPaths="~/fileuploads/documents" UploadPaths="~/fileuploads/documents" DeletePaths="~/fileuploads/documents" MaxUploadFileSize="26214400"/><br>    </telerik:Radeditor><br></asp:Content><br><asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server"><br></asp:Content

C# Code-Behind:

using System;<br>using System.Collections.Generic;<br>using System.Linq;<br>using System.Web;<br>using System.Web.UI.WebControls;<br><br>using System.IO;<br>using Telerik.Web.UI;<br>using Telerik.Web.UI.Editor.Import;<br>using Telerik.Windows.Documents.Flow.FormatProviders.Docx;<br>using Telerik.Windows.Documents.Flow.Model;<br>using Telerik.Windows.Documents.Flow.Model.Styles;<br><br> <br>namespace TelerikRadEditor<br>{<br>    public partial class WebForm2 : System.Web.UI.Page<br>    {<br>        protected void Page_Load(object sender, EventArgs e)<br>        {<br>            //Validate User<br>            //After validation, adjust the below settings accordingly...<br>            RadEditor TRE = RadEditor;<br>            String author = "aUser";<br>            String userColor = "reU0";<br><br>            //Note comments also uses the track change settings author and usercssid<br>            TRE.EnableComments = true;<br>            TRE.EnableTrackChanges = true;<br>            TRE.TrackChangesSettings.CanAcceptTrackChanges = true;<br>            TRE.TrackChangesSettings.Author = author;<br>            TRE.TrackChangesSettings.UserCssId = userColor;<br>        }<br>    }<br>}

 

 

Ianko
Telerik team
 answered on 10 Jun 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?