Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
259 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
182 views
I have data upon below type ,

 public class MenuItem 
    { 
        public string Name { getset; } 
 
        public List<MenuItem> Items { getprivate 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
90 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
111 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
279 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
1 answer
104 views
Hi,

I have a radcombobox which is populated witha large Sql table. I want filtering to be done only after the user entering a minimum of three chsracters. How this can be done?

Thank you,
Freddy.
Princy
Top achievements
Rank 2
 answered on 20 Mar 2013
1 answer
138 views
Hi,

I have an TreeView with CheckChildNodes=true. Also I have add the client event ClientNodeChecking.

I expect if I click a node the client event ClientNodeChecking is fired for the clicked node and for all child nodes. Unfortunaltly it is only fired for the clicked node! Why and how can I solved this?

Background is that i must check the count of all checked nodes and only allowed a maximum of 10.

function FnTreeView_ClientNodeChecking(sender, args)
{
    if (!args.get_node().get_checked())
    {
        var selectedNodesCount = sender.get_checkedNodes().length;
 
        if (selectedNodesCount > 10)
        {
            args.set_cancel(true);
        }
    }
}


Thanks for help,

Kind regards,
Christian

Bozhidar
Telerik team
 answered on 20 Mar 2013
7 answers
1.1K+ views
Hi,
        While Changing the Pagesize of my radgrid from 10 to 20 or 50 the result is not bound to my grid.. I tried OnPageIndexChanged function but it shows error. The grid also needs to remind the changed page size even when the page no is changed. Please help wit a solution...

protected void RadGrid2_PageSizeChanged(object source, GridPageSizeChangedEventArgs e)

{

RadGrid2.PageSize = e.NewPageSize;
// bind function to grid

}
when i using this function all i got was Webserver.exe stopped working.
Am i missing anything?

Andrey
Telerik team
 answered on 20 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?