Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
463 views
I am trying to restrict users entering Regular Expression value like  <%^>/   in RadComboBox while typing  but it throws error message "Object doesn't support this property or method" 

I want to validate it while typing in RadComboBox.

function OnClientKeyPressing(sender, args) {
if(checkRegEx())      // checking the RegEx value, if pass then proceed else remove the last character entered  
                    {
// Proceed.......
}
else
{
args.set_cancel(true);  // ERROR : Object doesn't support this property or method 

}                
            }




<telerik:RadComboBox ID="rcbMonthEndDate" Runat="server" TabIndex="5"
DropDownWidth="100px" MarkFirstMatch="true" AllowCustomText="true" EnableLoadOnDemand="false"
   HighlightTemplatedItems="true" OnClientKeyPressing="OnClientKeyPressing" 
   NoWrap="true" EmptyMessage="Select Date" AutoPostBack="False"
   Enabled="true" Width="100px"    
   DataTextField="MonthEndDate" DataTextFormatString="{0:yyyy-MM-dd}" 
   DataValueField="MonthEndDate">
   <ItemTemplate>
                                <%# DataBinder.Eval(Container.DataItem, "MonthEndDate", "{0:yyyy-MM-dd}")%>
                                </ItemTemplate>
<ExpandAnimation Type="OutBounce" />
<CollapseAnimation Type="InBack" />                            
  </telerik:RadComboBox>



Nencho
Telerik team
 answered on 02 Oct 2014
3 answers
282 views
Hi,

I've created a custom skin and embed all resource in an assembly.
All is loaded properly in the aspx page.
In my solution, I only reference Telerik.Web.UI and CustomSkin assemblies, I did not reference Telerik.Web.UI.Skins.

When debugging the aspx page in IE through F12,..

I saw that for ImageGallery's Next Button for example,..

background-image: none
   .RadImageGallery : none
   .RadImageGallery : url('/xxx/xxx/WebResource.axd?d=xxxxx&t=xxxx')    <== this is striked-out

The first .RadImageGallery (none value) is coming from Telerik.Web.UI assembly (Telerik.Web.UI.Skins.ImageGallery.css)

The second .RadImageGallery (WebResource.axd value) is coming from the CustomSkin assembly, but is overridden by the first .RadImageGallery from Telerik.Web.UI assembly

As such, the image of the Next button is not shown.

Question is, if I have a ASP.NET Theme with a Skin File of :

<telerik:RadImageGallery runat="server" EnableEmbeddedSkins="false" Skin="TelerikRadControl" RenderMode="Lightweight" />


why is Telerik.Web.UI.Skins.ImageGallery.css still being loaded / part of the css ?

shouldn't the CustomSkin assembly be the only one loaded into the page?

Thanks,
Henry


Galin
Telerik team
 answered on 02 Oct 2014
2 answers
130 views
Hi,
I have a grid and its editformtemplate there is another grid. this inner grid maked inplace edits. I make manual update commands on inner grid to decide if I should update database or not. if I fond a problem and decide not to update database I set e.Canceled = True and want to show a warning label which is named lblneedTofindThisLabel below. Warning label is outside of inner gird, inside of formtemplate of outer grid. how can I find this control from inner grid's update command event ?

in other words:
    RadGridCompanies
        editformtemplate
            label
            InnerGrid (inplace edit)
                    Updateevent
                            -- must find label here.


<telerik:RadGrid ID="RadGridCompanies" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSourceCompanies"
             GridLines="None" AllowAutomaticDeletes="false" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
             AllowPaging="True" AllowSorting="True" CellSpacing="0" Width="900px" Skin="Web20" PageSize="20">
             <GroupingSettings CaseSensitive="false" />
 
             <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true" EnableRowHoverStyle="True">
                 <Selecting AllowRowSelect="true" />
                 <Selecting AllowRowSelect="True"></Selecting>
             </ClientSettings>
 
 
             <MasterTableView DataKeyNames="ID, guidid" DataSourceID="SqlDataSourceCompanies" CommandItemDisplay="Top"
                 EditMode="PopUp">
                 <CommandItemSettings ExportToPdfText="Export to PDF"
                     ShowRefreshButton="False"></CommandItemSettings>
                 <RowIndicatorColumn>
                     <HeaderStyle Width="20px"></HeaderStyle>
                 </RowIndicatorColumn>
                 <ExpandCollapseColumn>
                     <HeaderStyle Width="20px"></HeaderStyle>
                 </ExpandCollapseColumn>
 
                 <Columns>
                     <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID" Visible="false">
                         <ColumnValidationSettings>
                             <ModelErrorMessage Text=""></ModelErrorMessage>
                         </ColumnValidationSettings>
                     </telerik:GridBoundColumn>
                     <telerik:GridBoundColumn DataField="guidid" HeaderText="guidid" ReadOnly="True" SortExpression="guidid" UniqueName="guidid" Visible="false">
                         <ColumnValidationSettings>
                             <ModelErrorMessage Text=""></ModelErrorMessage>
                         </ColumnValidationSettings>
                     </telerik:GridBoundColumn>
                     
                    .... other columns..
 
                  <EditFormSettings EditFormType="Template" PopUpSettings-Width="950px" PopUpSettings-Height="650px">
                               <EditColumn UniqueName="EditCommandColumn1">
                               </EditColumn>
                               <FormTemplate>
                                  
                                  
                                  <telerik:RadGrid ID="RadGridMids" runat="server" AllowAutomaticUpdates="false" OnUpdateCommand="RadGridMids_UpdateCommand"
                                             DataSourceID="SqlDataSourceMids" GridLines="None" Skin="Web20" AutoGenerateColumns="False" CellSpacing="0" Width="800px">
                                             <ClientSettings EnableRowHoverStyle="True">
                                             </ClientSettings>
                                             <MasterTableView DataKeyNames="ID" DataSourceID="SqlDataSourceMids" EditMode="InPlace" CommandItemDisplay="Top">
                                                 <Columns>
                                                     <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" ReadOnly="True" UniqueName="ID" Visible="false"></telerik:GridBoundColumn>
 
                                                     <telerik:GridTemplateColumn DataField="Bank" FilterControlAltText="Filter BankName column" HeaderText="Bank" SortExpression="Bank" UniqueName="Bank">
                                                         <EditItemTemplate>
                                                             <asp:TextBox ID="BankTextBox" runat="server" Text='<%# Bind("Bank") %>'></asp:TextBox>
                                                         </EditItemTemplate>
                                                         <ItemTemplate>
                                                             <asp:Label ID="BankLabel" runat="server" Text='<%# Eval("Bank") %>'></asp:Label>
                                                         </ItemTemplate>
                                                          
                                                         ... other columns...
                                                          
                                                     </telerik:GridTemplateColumn>
                                                            <telerik:GridEditCommandColumn>
                                                     </telerik:GridEditCommandColumn>
                                                 </Columns>
                                                 <EditFormSettings>
                                                     <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                                                 </EditFormSettings>
                                             </MasterTableView>
                                             <FilterMenu EnableTheming="True">
                                                 <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                             </FilterMenu>
                                 </telerik:RadGrid>
                                          
                                <asp:Label ID="lblneedTofindThisLabel" runat="server" Text="label to find" Visible="false" ></asp:Label>
                                                             
                     </FormTemplate>
                     <PopUpSettings Modal="True" Width="1000px" />
                 </EditFormSettings>
 
             </MasterTableView>
             <FilterMenu EnableImageSprites="False">
             </FilterMenu>
         </telerik:RadGrid>

and the code is :

Protected Sub RadGridMids_UpdateCommand(sender As Object, e As GridCommandEventArgs)
 
      Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
      Dim ID_ As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("ID").ToString()
       
     ' .... some logic....
       
     ' -- WHAT X should be. ?
       
      Dim lblneedTofindThisLabel As Label = (TryCast(x.FindControl("lblneedTofindThisLabel"), Label))
       
      lblneedTofindThisLabel.visible=true
         end sub
Eyup
Telerik team
 answered on 02 Oct 2014
1 answer
128 views
I am unable to get sorting  to work for this grid as well as to control the size of the filter text boxes for this grid.
I think the problem is associated with the way I select the datasource but I do not know how to fix it and I need to allow selecting the Sql table to the user.

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DropDownList1.DataSource = SqlDataSource2;
            DropDownList1.DataBind();
        }
        SetDataSource();
    }
 
    protected void DropDownList1_SelectedIndexChanged1(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex > 0)
        {
            SetDataSource();
            RadGrid1.Rebind();
        }
    }
 
    private void SetDataSource()
    {
        if (DropDownList1.SelectedIndex > 0)
        {
            string tableInUse = DropDownList1.SelectedItem.Text;
            RadGrid1.DataSource = SqlDataSource1;
            SqlDataSource1.DeleteCommand = "DELETE FROM [" + tableInUse + "] WHERE [Id] = @Id";
            SqlDataSource1.InsertCommand = "INSERT INTO [" + tableInUse + "] ([Code], [Description], [Bkgroup], [Stgroup], [Quantity], [BomNote], [UnitEng], [AlternCost]) VALUES (@Code, @Description, @Bkgroup, @Stgroup, @Quantity, @BomNote, @UnitEng, @AlternCost)";
           SqlDataSource1.SelectCommand = "SELECT prod.Id, prod.Code, prod.Description, prod.Bkgroup, prod.Stgroup, prod.Quantity," +
                                           "prod.BomNote, prod.UnitEng, prod.AlternCost, comp.Unit, comp.Cost, comp.NoteComp " +
                                           "FROM  " + tableInUse + " prod " +
                                           "left JOIN  Components comp ON  comp.Code = prod.Code";
            SqlDataSource1.UpdateCommand = "UPDATE [" + tableInUse + "] SET [Code] = @Code, [Description] = @Description, [Bkgroup] = @Bkgroup, [Stgroup] = @Stgroup, [Quantity] = @Quantity, [BomNote] = @BomNote, [UnitEng] = @UnitEng, [AlternCost] = @AlternCost WHERE [Id] = @Id";
        }
    }
 
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = SqlDataSource1;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        RadGrid1.MasterTableView.TableLayout = GridTableLayout.Auto;
        RadGrid1.AllowFilteringByColumn = true;
        RadGrid1.MasterTableView.AllowFilteringByColumn = true;
        RadGrid1.Rebind();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        RadGrid1.MasterTableView.TableLayout = GridTableLayout.Auto;
        RadGrid1.AllowFilteringByColumn = false;
        RadGrid1.MasterTableView.AllowFilteringByColumn = false;
        RadGrid1.Rebind();
    }
      protected void RadGrid1_ItemCreated1(object sender, GridItemEventArgs e)
       {
       if (e.Item is GridFilteringItem)
        {
            GridFilteringItem filteringItem = e.Item as GridFilteringItem;
            //set dimensions for the filter textbox  
            TextBox box = filteringItem["Code"].Controls[0] as TextBox;
            box.Width = Unit.Pixel(30);
        }
    }

If I try to use the Item_created event to control the size of the filter text boxes, I get a null reference exception.

<div>
           <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" AppendDataBoundItems="true" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged1" DataTextField="Name" DataValueField="Name">
               <asp:ListItem Text="-Select a BOM" />
           </asp:DropDownList>
           <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:BOMConnectionString %>" SelectCommand="SELECT [Name] FROM [IndexTabb]"></asp:SqlDataSource>
           <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Filter On" />
           <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Filter Off" />
           <br />
           <br />
           <br />
           <telerik:RadGrid ID="RadGrid1" runat="server" Culture="it-IT" AllowPaging="True" AllowSorting="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCreated="RadGrid1_ItemCreated1">
               <ExportSettings ExportOnlyData="True">
                   <Pdf PageWidth="">
                   </Pdf>
               </ExportSettings>
               <ClientSettings>
                   <Scrolling AllowScroll="True" UseStaticHeaders="True" />
               </ClientSettings>
               <MasterTableView CommandItemDisplay="Top" DataKeyNames="Code" InsertItemPageIndexAction="ShowItemOnCurrentPage" AllowNaturalSort="False">
                   <CommandItemSettings ShowExportToExcelButton="True" />
                   <Columns>
                       <telerik:GridEditCommandColumn ButtonType="ImageButton">
                           <HeaderStyle Width="30px" />
                       </telerik:GridEditCommandColumn>
                       <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" FilterControlAltText="Filter column1 column" ConfirmDialogType="RadWindow" ConfirmText="Do you really want to delete this project and all its content?" UniqueName="Cancel">
                           <HeaderStyle Width="30px" />
                       </telerik:GridButtonColumn>
                   </Columns>
                   <EditFormSettings>
                       <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                   </EditFormSettings>
                   <PagerStyle AlwaysVisible="True" />
               </MasterTableView>
               <PagerStyle AlwaysVisible="True" />
           </telerik:RadGrid>
           <br />
           <br />
       </div>
       <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BOMConnectionString %>">
       </asp:SqlDataSource>
And sorting is not working. When I click on the header of the column I can see the small arrow changing up or down but nothing happens.
How can I get control of the filter text boxes size and make the sorting working in this context?
Any help will be appreciated.
Eyup
Telerik team
 answered on 02 Oct 2014
1 answer
136 views
Needing to do a gantt chart based on fy and quarters.
Any suggestions.
Bozhidar
Telerik team
 answered on 02 Oct 2014
1 answer
146 views
hi

This my code:
  
<telerik:RadTextBox ID="RadTextBox1" Runat="server" Resize="None" Rows="1" TextMode="MultiLine" Width="160px"> </telerik:RadTextBox>

As you can see, the Rows attribute is set to 1, which means it should display as 1 row in the browser. But it is not getting it right in FF 32.0. It works fine in IE 11 and chrome.

How do i solves this? Thanks a lot.
Eyup
Telerik team
 answered on 02 Oct 2014
2 answers
384 views
Hi, is it possible to have column headers with vertical text in RadGrid?  Right now we do this by putting the text in images, but that solution is not very flexible if the text needs to change.
Angel Petrov
Telerik team
 answered on 02 Oct 2014
3 answers
95 views
Hi,

we are trying to use RadEditor within DotNetNuke CMS and here is the problem. 
We are saving small parts of HTML in templates to help content manager insert UI elements quicker.
But after pasting template content manager can't step out to the end of HTML makeup.
Example.
We have HTML template for button:
<a href="/some-page" class="green_btn">
<span class="bg">
<span class="icon"></span>
<span class="txt">Some text</span>
</span>
</a>
After insertion the cursor is placed at the end of "Some text" (see pic.1 attached) inside button. We need to skip to the end of HTML and continue to enter regular text (see pic.2 with desired cursor position). 
How we can do this? I mean - may be there is hot key for that? Or do we have to wrap templates in paragraphs or put but <br/>s in templates?
Click on the white space after button doesn't help. "End" and "Ctrl+End" keys can't help too.
Ianko
Telerik team
 answered on 02 Oct 2014
3 answers
672 views

Is there a way that I can conditionally hide a column filter in a RadGrid from the code behind based on the data column name when the RadGrid is set to AutoGenerateColumns="true"?

Example:
I assign a datatable as the RadGrid's datasource. I want to intercept some RadGrid event to see if column "TEST" was added, and if so, then hide the filter for that column in the RadGrid.


Thank you,

-Scott

Wired_Nerve
Top achievements
Rank 2
 answered on 01 Oct 2014
6 answers
503 views
Hi,
        I have a RadEditor in my page. I want to limit the maximum number of characters entered. I need not to dispaly the message if the maximum character is reached. But i need to  block the characters entered by the user if it reached the maximum length. Please give the solution for this problem.

Thanks,
Velkumar
Greg
Top achievements
Rank 1
 answered on 01 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?