Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
113 views
Hi,

I am adding the PageTitle to the pdf. I need my page title should be in muliple line. if i use <br/> or <p> tags but its not working.
If i add PageTitle it will look like below
    order : x order type:y
but i need like below
    order:x
    order type : y


Can any one help me in this.

Nithya
Nithya Rani
Top achievements
Rank 1
 answered on 20 Mar 2013
1 answer
170 views

hi,

  we have an ASP.NET website.

  Within here a user control.

  THis user control contains two RADGRID controls.
  
  Grid 1 is populated with data. Grid 2 is empty.

  We are trying to drag a row from Grid 1 to Grid 2.

  We have this working in another web page, but it seems that within a user control  there are complications.  When we perform the drag/drop we get this error:
 
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.review_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\mppr4\4fbd45b7\6039e974\App_Web_r6ddz0kb.20.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


The AJAX manager and settings are set up in the web page that is hosting the user control.

Here is the client script:

function onRowDropping(sender, args) {

                debugger;

                if (sender.get_id() == "<%=rgArticles.ClientID %>") {

                    var node = args.get_destinationHtmlElement();

                    if (!isChildOf('<%=RadGrid1.ClientID %>', node) && !isChildOf('<%=rgArticles.ClientID %>', node)) {

                        args.set_cancel(true);

                    }

                }

            }

            function isChildOf(parentId, element) {

                while (element) {

                    if (element.id && element.id.indexOf(parentId) > -1) {

                        return true;

                    }

                    element = element.parentNode;

                }

                return false;

            }


  What is happening is the code behind rowdropping method is not firing, instead we get the error above. 

  Does anyone have ideas why this wouldn't be working in a user control ? 

Vanaja
Marin
Telerik team
 answered on 20 Mar 2013
3 answers
240 views
Hi,

I have a main page which has a RadTabStrip with several tabs & each of these tabs has a page from a RadMultipage assigned to it. Each page has a usercontrol that i have defined which is a Radgrid with different data in each one.

I also have a radwindow which open the edit window to modify records that the radgrids display. This works fine except once i close the RadWindow, the radgrid in the usercontrol within the pageview does not update. I have tried to databind the RadTabStrip, the RadMultipage control & the Radgrid itself but i don't seemt o be able to get the Radgrids to refresh unless i refresh the whole page.

Can anyone help with refreshing (rebinding) the radgrid within a usercontrol which is used on a RadMultipage tabstrip & is being updated from a radwindow?

Regards,

Shuja
Nencho
Telerik team
 answered on 20 Mar 2013
1 answer
273 views
I'm doing a personalized filter, that allow the use of specials characters. How for example ">1"  = "greater that one", this can be done in any column, of any type, numeric, date, string, etc.

But at the that i could perceive, the column filter GridNumericColumn not allow non-numeric characters.

I wonder if there is any way to make the filter a column of type GridNumericColumn allow the entry of some special characters.

This is possible?

Thank you.

Fernando Leal
Angel Petrov
Telerik team
 answered on 20 Mar 2013
1 answer
192 views
I have data upon below type ,

 public class MenuItem 
    { 
        public string Name { get; set; } 
 
        public List<MenuItem> Items { get; private set; } 
 
        public MenuItem() 
        { 
            this.Items = new List<MenuItem>(); 
        } 
    }

How can I bind to RadMenu to show a multi level menu ?

I want this in ASP.NET AJAX way.
Boyan Dimitrov
Telerik team
 answered on 20 Mar 2013
1 answer
99 views
I'm developing a grid based largely on http://demos.telerik.com/aspnet-ajax/grid/examples/programming/commanditem/defaultcs.aspx

I need to be able to programatically abort inserting a record, and close the insert items template so that the user no longer sees the controls used for inserting. In the grid's ItemCommand, event, I want to do something like this:

 

public void radGrid_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
{
    switch (e.CommandName.ToString())
    {
         case "PerformInsert":
         {
               //do something to determine if I can insert a record
               //if I can not insert a record
               //How do I close the insert items template?

 

I've tried e.Cancelled = true; but that doesn't seem to work. At this point, I successfully abort the insert, but the user continues to see the insert controls. She/he has to click the insert template's cancel button to close them.

Thanks!

Here's the grid markup:

<telerik:RadGrid runat="server" ID="rgDashboardGoals" AllowSorting="false" AllowAutomaticDeletes="true"
                  GridLines="None" AllowFilteringByColumn="false" AllowPaging="true" Skin="Outlook"
                  EnableViewState="true" AutoGenerateColumns="false" AllowAutomaticUpdates="true" PageSize="10"
                  AllowMultiRowSelection="True" AllowMultiRowEdit="True" AllowAutomaticInserts="True"
                  OnItemUpdated="rgDashboardGoals_ItemUpdated" OnItemCommand="rgDashboardGoals_ItemCommand" 
                  OnPageIndexChanged="rgDashboardGoals_PageChange" OnItemDataBound="rgDashboardGoals_ItemDataBound"
                  StatusBarSettings-LoadingText="Loading..." OnNeedDataSource="LoadDashboardGoalsGrid">
     <MasterTableView DataKeyNames="PartsDashboard_id,MonthYear" CommandItemDisplay="Top">
         <CommandItemTemplate>
             <div style="padding: 5px 5px;">
                 Dashboard Goals grid management tools >>    
                 <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected"
                                 Visible='<%# rgDashboardGoals.EditIndexes.Count == 0 %>'>
                     <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Edit.gif"/>Edit selected
                 </asp:LinkButton>  
                 <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited"
                                 Visible='<%# rgDashboardGoals.EditIndexes.Count > 0 %>'>
                     <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Update.gif"/>Update
                 </asp:LinkButton>  
                 <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" CausesValidation="false"
                                 Visible='<%# rgDashboardGoals.EditIndexes.Count > 0 || rgDashboardGoals.MasterTableView.IsItemInserted %>'>
                     <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Cancel.gif"/>Cancel
                 </asp:LinkButton>  
                 <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert"
                                 Visible='<%# !rgDashboardGoals.MasterTableView.IsItemInserted %>'>
                     <img style="border:0px;vertical-align:middle;" alt="" src="../Images/AddNew.gif"/>Add new
                 </asp:LinkButton>  
                 <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert"
                                 Visible='<%# rgDashboardGoals.MasterTableView.IsItemInserted %>'>
                     <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Insert.gif"/> Add this goal record
                 </asp:LinkButton>  
                 <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete selected goal record(s)?')"
                                 runat="server" CommandName="DeleteSelected">
                     <img style="border:0px;vertical-align:middle;" alt="" src="../Images/deleteRecord.gif"/>Delete selected goal records
                 </asp:LinkButton>  
                 <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid">
                     <img style="border:0px;vertical-align:middle;" alt="" src="../Images/refreshGrid.gif"/>Refresh grid
                 </asp:LinkButton>
             </div>
         </CommandItemTemplate>                               
         <Columns>
             <telerik:GridBoundColumn ReadOnly="true" UniqueName="Dealer_id" HeaderText="Dealer Code"
                                      SortExpression="Dealer_id" DataField="Dealer_id" />
             <telerik:GridBoundColumn UniqueName="MonthYear" DataField="MonthYear" ReadOnly="true"
                                      HeaderText="Month/Year" SortExpression="MonthYear" />
             <telerik:GridTemplateColumn ReadOnly="true" UniqueName="HinoOnlyGoal" SortExpression="HinoOnlyGoal"
                                         HeaderText="Hino Only Goal">
                 <ItemTemplate>
                     <asp:Label ID="lblHinoOnlyGoal" Text='<%# Eval("HinoOnlyGoal").ToString() %>' runat="server" />
                 </ItemTemplate>
             </telerik:GridTemplateColumn>
             <telerik:GridTemplateColumn UniqueName="GoalMonthInsert" EditFormColumnIndex="0" Visible="false"
                                         HeaderText="Goal Month">
                 <InsertItemTemplate>
                     <asp:DropDownList ID="ddlGoalMonth" runat="server" CssClass="hino_text">
                         <asp:ListItem Text="January" Value="1" />
                         <asp:ListItem Text="February" Value="2" />
                         <asp:ListItem Text="March" Value="3" />
                         <asp:ListItem Text="April" Value="4" />
                         <asp:ListItem Text="May" Value="5" />
                         <asp:ListItem Text="June" Value="6" />
                         <asp:ListItem Text="July" Value="7" />
                         <asp:ListItem Text="August" Value="8" />
                         <asp:ListItem Text="September" Value="9" />
                         <asp:ListItem Text="October" Value="10" />
                         <asp:ListItem Text="November" Value="11" />
                         <asp:ListItem Text="December" Value="12" />
                     </asp:DropDownList>
                 </InsertItemTemplate>
             </telerik:GridTemplateColumn>                                                                   
 
             <telerik:GridTemplateColumn UniqueName="GoalYearInsert" EditFormColumnIndex="0" Visible="false"
                                         HeaderText="Goal Year">
                 <InsertItemTemplate>
                     <asp:DropDownList ID="ddlGoalYear" runat="server" CssClass="hino_text">
                         <asp:ListItem Text="2013" Value="2013" />
                         <asp:ListItem Text="2014" Value="2014" />
                         <asp:ListItem Text="2015" Value="2015" />
                         <asp:ListItem Text="2016" Value="2016" />
                         <asp:ListItem Text="2017" Value="2017" />
                         <asp:ListItem Text="2018" Value="2018" />
                     </asp:DropDownList>
                 </InsertItemTemplate>
             </telerik:GridTemplateColumn>
                                                                               
             <telerik:GridTemplateColumn UniqueName="HinoOnlyGoalEdit" EditFormColumnIndex="0" Visible="false"
                                         HeaderText="Hino Only Goal">
                 <EditItemTemplate>
                     <asp:TextBox ID="txtHinoOnlyGoal" runat="server" Text='<%# Eval("HinoOnlyGoal").ToString() %>' />
                     <asp:RequiredFieldValidator ID="rfvHinoOnlyGoal" ControlToValidate="txtHinoOnlyGoal"
                                                 ErrorMessage="*- Required" runat="server" InitialValue="" />
                     <asp:RegularExpressionValidator ID="revHinoOnlyGoal" runat="server"  ControlToValidate="txtHinoOnlyGoal"
                                                     ErrorMessage="* - Must be a valid number. "        
                                                     ValidationExpression="[0-9]+(\.[0-9][0-9]?)?" />
                 </EditItemTemplate>
             </telerik:GridTemplateColumn>
             <telerik:GridTemplateColumn ReadOnly="true" UniqueName="AllMakesGoal" SortExpression="AllMakesGoal"
                                         HeaderText="All Makes Goal">
                 <ItemTemplate>
                     <asp:Label ID="lblAllMakesGoal" Text='<%# Eval("AllMakesGoal").ToString() %>' runat="server" />
                 </ItemTemplate>
             </telerik:GridTemplateColumn>
             <telerik:GridTemplateColumn UniqueName="AllMakesGoalEdit" EditFormColumnIndex="0" Visible="false"
                                         HeaderText="All Makes Goal">
                 <EditItemTemplate>
                     <asp:TextBox ID="txtAllMakesGoal" runat="server" Text='<%# Eval("AllMakesGoal").ToString() %>' />
                     <asp:RequiredFieldValidator ID="rfvAllMakesGoal" ControlToValidate="txtAllMakesGoal"
                                                 ErrorMessage="*- Required" runat="server" InitialValue="" />
                     <asp:RegularExpressionValidator ID="revAllMakesGoal" runat="server" ErrorMessage="* - Must be a valid number. "
                                                     ControlToValidate="txtAllMakesGoal" ValidationExpression="[0-9]+(\.[0-9][0-9]?)?" />
                 </EditItemTemplate>
             </telerik:GridTemplateColumn>
         </Columns>
         <EditFormSettings ColumnNumber="3">
             <FormTableItemStyle Wrap="False"></FormTableItemStyle>
             <FormCaptionStyle></FormCaptionStyle>
             <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%" />
             <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" Height="110px" Width="100%" />
             <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
             <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>
             <EditColumn UniqueName="EditCommandColumn1" UpdateImageUrl="../Images/order.gif"
                         CancelImageUrl="../Images/cancel.gif" ButtonType="ImageButton" />
             <FormTableButtonRowStyle HorizontalAlign="Left"></FormTableButtonRowStyle>
         </EditFormSettings>
     </MasterTableView>
     <ClientSettings EnableRowHoverStyle="true">
         <Selecting AllowRowSelect="True" />
     </ClientSettings>
 </telerik:RadGrid>

 

e.Canceled =

 

 

true;

 

e.Canceled =

 

 

true;

 

e.Canceled =

 

 

true;

 

Kostadin
Telerik team
 answered on 20 Mar 2013
1 answer
121 views
3 answers
1.3K+ views
Hi Experts,

         For the framework components like <asp:gridview> there exists <EditItemTemplate> ... How can I get that with Telerik ?
What I try to do is to avoid "blinking " the grid when I click on Edit button ... So, I want to define a fixed width for the cells (wether they are in edit mode or normal mode).
    <asp:GridView ID="GridView1" runat="server"> 
    <Columns> 
        <asp:TemplateField> 
            <ItemTemplate> 
                <asp:TextBox Width="200px" runat="server" ID="aaa"></asp:TextBox> 
            </ItemTemplate>             
            <EditItemTemplate> 
                <asp:TextBox Width="200px" runat="server" ID="aaa"></asp:TextBox> 
            </EditItemTemplate> 
        </asp:TemplateField> 
    </Columns> 
    </asp:GridView> 


        How can I do this with RadGrid ? This is indeed a simple question for you people ... 

        When I edit, I would like to limit the height of the cells. What I'm doing actually is :
 
    protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem && e.Item.IsInEditMode) 
        { 
            TextBox tbLastName = (e.Item as GridDataItem)["LastName"].Controls[0] as TextBox; 
            tbLastName.Height = Unit.Pixel(12); 
            //tbLastName.Width = Unit.Pixel(10); 
            tbLastName.Style["Font-size"] = "11px"; 
            tbLastName.Style["padding-top"] = "1px"; 
 
            TextBox tbFirstName = (e.Item as GridDataItem)["FirstName"].Controls[0] as TextBox; 
            tbFirstName.Height = Unit.Pixel(12); 
            tbFirstName.Style["Font-size"] = "11px"; 
            tbFirstName.Style["padding-top"] = "1px"; 
 
            TextBox tbTitle = (e.Item as GridDataItem)["Title"].Controls[0] as TextBox; 
            tbTitle.Height = Unit.Pixel(12); 
            tbTitle.Style["Font-size"] = "11px"; 
            tbTitle.Style["padding-top"] = "1px"; 
        } 
    } 
 

Thanks in advance,
RadTony The Newbie
Shinu
Top achievements
Rank 2
 answered on 20 Mar 2013
1 answer
313 views
Hi All,

I am trying to add a telerik image button in my page but it is not displayed. I am not applying any CSS. Here is the markup I tried.

<telerik: RadButton ID="RadButtonImg" runat="server" Text="Download">
   <Image ImageUrl="Dld.png" />
</telerik:RadButton>

Please provide a solution to resolve this issue.

Thanks in advance,
Teena.
Princy
Top achievements
Rank 2
 answered on 20 Mar 2013
25 answers
1.1K+ views
Dear Telerik Support  Team,

I am using Rad:Editor. I just want to know that how can i apply the charector limit in Rad:Editor. It will be very helpful for me if can suggest me how we can apply this feature using XML file.

Regards

Samrat Banerjee
India.
Rumen
Telerik team
 answered on 20 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?