Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
89 views
Dear Sir/Madam


I'm Maha From India.


Advance Thank you for Helping me


I have RadGrid1(using Mutiselect checkbox option) in my project


Problem : Label Text inside CommandItemTemplate not visible in after i click Delete(LinkButton1)
==================================================================
Inside CommandItemTemplate I have Label(lblmsg) to display some message to user for validation and DB Deleted Message


If user clicking LinkButton(LinkButton1) without seelcting any checkbox means I write validation 


That validation message will display on this lblmsg correctly


But if user select the check box and then click Delete means I want to show Confirmation message to user


Message format : Customer ID1,Customer ID2 deleted from DB succesfully


The above message will not visible in RadGrid


But If i debug means Thats Label Text Properly assigned using C#(RadGrid1_ItemCommand)


Note:
====
After execution of RadGrid1_ItemCommand() ->RadGrid1_NeedDataSource() method invoked Automatically


So My Doubt is  whether RadGrid Reassign my Label Text as Empty.


Becoz in Browser View Source <span id="RadGrid1_ctl00_ctl03_ctl01_lblmsg"></span>


Inside span my Text is not there


Code.aspx
=========
Ajax Settings
==========================================================================================
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                   
               <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    
                        <UpdatedControls>
                           
                            <telerik:AjaxUpdatedControl  ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            
                            
                        </UpdatedControls>
                     
                 </telerik:AjaxSetting>
                    
                     
                    </AjaxSettings>
            </telerik:RadAjaxManager>
             
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Skin="Default" runat="server"></telerik:RadAjaxLoadingPanel>
    
Grid Code
==========================================================================================
 <telerik:RadGrid ID="RadGrid1"  Width="100%" AllowFilteringByColumn="True"
            PageSize="12" ShowFooter="false" AllowPaging="True" runat="server"
            AutoGenerateColumns="False" GridLines="None" ShowStatusBar="false" 
            onneeddatasource="RadGrid1_NeedDataSource" AllowSorting="true" AllowMultiRowSelection="true" 
                ShowGroupPanel="false" onitemcommand="RadGrid1_ItemCommand">
              <GroupingSettings CaseSensitive="false" />
   
           <MasterTableView CommandItemDisplay="Bottom" Width="100%" AllowFilteringByColumn="true" GroupsDefaultExpanded="false">
<CommandItemTemplate>
<div style="padding-left:8px;">
<asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected Jobs?')"
runat="server" Font-Size="13px" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" />Delete</asp:LinkButton>&nbsp;&nbsp;
<asp:Label ID="lblmsg" runat="server"></asp:Label>
</div>
</CommandItemTemplate>


                <Columns>
----
</Columns>


</MasterTableView>
            
   <ClientSettings EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="true" />
        </ClientSettings>
 </telerik:RadGrid>
==========================================================================================
code.cs(C#)
======
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "DeleteSelected")
            {
                GridCommandItem commandItem = e.Item as GridCommandItem;


                Label lbl = commandItem.FindControl("lblmsg") as Label;
                lbl.Text = "";
                if (RadGrid1.SelectedIndexes.Count == 0)
                {
                    lbl.Text = "Not Selected any Customer IDs";
                    lbl.ForeColor = System.Drawing.Color.Red;
                    return;
                }


                System.Text.StringBuilder sbJobIds = new System.Text.StringBuilder();




                foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
                {
                    if (item.Selected)
                    {
                        string customerid = item["CusID"].Text;
                        if (customerid != null && customerid.Trim().Length > 0)
                            sbJobIds.Append(customerid + ",");
                    }
                }
               
//DB Coding


-----
//
            
  lbl.Text = sbJobIds.ToString()+"deleted from DB succesfully";  //This Message will not be visible to user
  lbl.ForeColor = System.Drawing.Color.Green;
               
               
               
            }


        }


==========================================================================================


Please advice me whats can i do?


Awaiting for your favourable reply




With Regards,
Maha
Maria Ilieva
Telerik team
 answered on 28 Aug 2012
1 answer
84 views
I am trying to use the RadTimePicker on several web pages.  I've kept it pretty simple at first and put the following telerik-specific code on a page:

first, at the top of the page is this:

%@ Control Language="c#" AutoEventWireup="false" Codebehind="service_category_admin.ascx.cs" Inherits="vtvn_service.service_category_admin" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%@ Register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>

then in the body is this:
<telerik:RadTimePicker ID="start_time_picker" visible="true" ZIndex="30001" runat="server">
</telerik:RadTimePicker>

One one page, it works...sometimes.  That is, if I click on the clock icon, a popup with times to select from appears.

On a couple other pages that I put the code on, clicking the clock icon does nothing, except generate the following javascript errror:

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Thu, 23 Aug 2012 18:28:49 UTC

Message: Object doesn't support this property or method
Line: 179
Char: 3
Code: 0
URI: http://aspnet-scripts.telerikstatic.com/ajaxz/2012.1.411/Calendar/RadCalendarCommonScript.js

I am running version 2012.1.411.40 of the tererik.web.ui dll.

Any and all help will be appreciated as I am pretty much dead in the water right now.
Maria Ilieva
Telerik team
 answered on 28 Aug 2012
1 answer
70 views
Hi,

We have a grid that contains nested rows three levels deep, in the following way:
1. Status
2.    -- Action
3.        -- Role

To add a Role, there is an 'Add Row' button, which contains a dropdown of Roles on a GridDropDownColumn. There is an Insert button and a Close button. This functionality works fine to add a Role, but sometimes the Role name is blank in the row below. It seems to only happen after deleting/inserting roles, particularly if a higher up row is expanded as well.

I'm unable to reproduce the exact steps as it is intermittent, but I was wondering if there are any known issues with nested rows in grids, or if you have any suggestions in how to establish the cause of this?


Regards,
Graeme
Antonio Stoilkov
Telerik team
 answered on 28 Aug 2012
1 answer
97 views

Hi,

I have a radgrid with edit mode = custom edit form in asp.net page.  There are several asp textbox in the FormTemplate. 
I follow the sample in http://www.telerik.com/help/aspnet-ajax/grid-set-focus-on-textboxes-in-edit-control.html to set one of the textbox focus when itemcreated.  However, I found that this the script did not work when I set AllowKeyboardNavigation = true in client setting.  If I set AllowKeyboardNavigation  = false, the textbox can get the foucs when I edit the row.
Below is my coding for the FormTemplate and ClientSetting

<EditFormSettings EditFormType="Template" >  
                   <EditColumn UniqueName="EditColumn" AutoPostBackOnFilter="true"></EditColumn>                     
                   <FormTemplate>
                       <asp:Table ID="EditTable" runat="server" cellspacing="0" cellpadding="0" BorderStyle=None>
                           <asp:TableRow>
                               <asp:TableCell>
                                   <asp:Label ID="lblOrgCode" runat="server" Text="Org. Code" ></asp:Label>
                               </asp:TableCell>
                               <asp:TableCell>
                                   <asp:TextBox ID="txtOrgCode" Text='<%# Bind("OrgCode") %>' runat="server" CssClass="uppercase" TabIndex="1" Readonly='<%#IIf(TypeOf(Container) is GridEditFormInsertItem,"false","true")%>' ></asp:TextBox>
                               </asp:TableCell>
                               <asp:TableCell></asp:TableCell>
                               <asp:TableCell>
                                   <asp:RequiredFieldValidator ID="RequiredFieldValidator1" Runat="server" Display="Dynamic"
                                       ControlToValidate="txtOrgCode" ForeColor="Red"
                                       ErrorMessage="Organization code can not be empty!">
                                   </asp:RequiredFieldValidator>
                                   <asp:CustomValidator ID="CustomValidator1" runat="server" Display="Dynamic"
                                       ControlToValidate="txtOrgCode" ForeColor="Red" OnServerValidate="OrgCode_ServerValidate"
                                       ErrorMessage="Org. code must be less than 100 characters">
                                   </asp:CustomValidator>
                               </asp:TableCell>
                           </asp:TableRow>
                           <asp:TableRow>
                               <asp:TableCell>
                                   <asp:Label ID="lblOrgName" runat="server" Text="Org. Name" ></asp:Label>
                               </asp:TableCell>
                               <asp:TableCell>
                                   <asp:TextBox ID="txtOrgName" Text='<%# Bind("OrgName") %>' runat="server" TabIndex="2" ></asp:TextBox>
                               </asp:TableCell>
                               <asp:TableCell></asp:TableCell>
                               <asp:TableCell>
                                   <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Runat="server" Display="Dynamic"
                                       ControlToValidate="txtOrgName" ForeColor="Red"
                                       ErrorMessage="Organization name can not be empty!">
                                   </asp:RequiredFieldValidator>
                                   <asp:CustomValidator ID="CustomValidator2" runat="server" Display="Dynamic"
                                       ControlToValidate="txtOrgName" ForeColor="Red" OnServerValidate="OrgName_ServerValidate"
                                       ErrorMessage="Org. name must be less than 100 characters">
                                   </asp:CustomValidator>
                               </asp:TableCell>
                           </asp:TableRow>
                           <asp:TableRow>
                               <asp:TableCell>
                                   Creation Date
                               </asp:TableCell>
                               <asp:TableCell>
                                   <asp:TextBox ID="txtCreationDate" Text='<%# Bind("CreationDate") %>' runat="server" ReadOnly="true"> 
                                   </asp:TextBox>
                               </asp:TableCell>
                               <asp:TableCell>
                                     By   
                               </asp:TableCell>
                               <asp:TableCell>
                                   <asp:TextBox ID="txtCreationUser" runat="server" Text='<%# Bind("CreationUser") %>' ReadOnly="true"> 
                                   </asp:TextBox>
                               </asp:TableCell>
                           </asp:TableRow>
                           <asp:TableRow>
                               <asp:TableCell>
                                   Last Change Date   
                               </asp:TableCell>
                               <asp:TableCell>
                                   <asp:TextBox ID="txtLastChangeDate" Text='<%# Bind("LastChangeDate") %>' runat="server" ReadOnly="true"> 
                                   </asp:TextBox>
                               </asp:TableCell>
                               <asp:TableCell>
                                     By   
                               </asp:TableCell>
                               <asp:TableCell>
                                   <asp:TextBox ID="txtLastChangeUser" runat="server" Text='<%# Bind("LastChangeUser") %>' ReadOnly="true"> 
                                   </asp:TextBox>
                               </asp:TableCell>
                           </asp:TableRow>
                       </asp:Table>
                       <asp:Table runat="server">
                           <asp:TableRow>
                               <asp:TableCell HorizontalAlign=Left
                                   <asp:Button ID="Button1" Text='<%#IIf(TypeOf(Container) is GridEditFormInsertItem,"Insert","Update")%>' runat="server" CommandName='<%#IIf(TypeOf(Container) is GridEditFormInsertItem,"PerformInsert","Update")%>' TabIndex="3"> </asp:Button
                                   <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" TabIndex="4"></asp:Button>
                               </asp:TableCell>
                           </asp:TableRow>
                       </asp:Table>
                   </FormTemplate>
               </EditFormSettings>
           </MasterTableView>
           <ClientSettings ReorderColumnsOnClient="True"  AllowColumnsReorder="True" AllowKeyboardNavigation="true" >
               <Selecting AllowRowSelect="True"></Selecting>
               <KeyboardNavigationSettings AllowSubmitOnEnter="true" EnableKeyboardShortcuts="true" AllowActiveRowCycle="true" CollapseDetailTableKey="LeftArrow" ExpandDetailTableKey="RightArrow" />                  
           </ClientSettings>

Below is my coding in setting the textbox focus on ItemCreated event.

If e.Item.IsInEditMode Then
                If TypeOf (e.Item) Is GridEditFormInsertItem Then
                    ControlToFocus = DirectCast(DirectCast(e.Item, GridEditableItem).FindControl("txtOrgCode"), TextBox)
                Else
                    ' Dim lGridEditableItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)
                    ControlToFocus = DirectCast(DirectCast(e.Item, GridEditableItem).FindControl("txtOrgName"), TextBox)
                End If
            End If
 
            If Not ControlToFocus Is Nothing Then
                Dim script As String = [String].Format("$get('{0}').focus(); $get('{0}').select();", ControlToFocus.ClientID)
                RadScriptManager.RegisterStartupScript(Page, GetType(Page), "EditFocusScript", script, True)
 
            End If

Thanks!

Vasil
Telerik team
 answered on 28 Aug 2012
2 answers
71 views

Hi,

We are using the Real Font Sizes for the RadEditor.
When I create new line, RadEditor does not inherit font size to the line.

1. All clear
2. Input any string and set any font size.
3. move cursor to end of the string.
4. Input enter key.

Result:
 <p><span style="font-size: 22px;">testtesttest</span></p>
 <p>&nbsp;</p>

Expected Result:
 <p><span style="font-size: 22px;">testtesttest</span></p>
 <p><span style="font-size: 22px;">&nbsp;</span></p>

If I use the Default Font Size instead of the Real Font Size, the behavior is expected.

Please tell me any workarounds.
Thanks,
Akinori

Rumen
Telerik team
 answered on 28 Aug 2012
1 answer
91 views
I wonder how it is possible to make a filter in real time on a RadGridView

I do not know what event by my textBox to perform so that the filter will

update my RadGrid through just the characters that I'm typing

no more need to go on the bench ... research in itself is showing the list q grid.

- Code that updates my RadGrid -

private void BindToGridAllUsers (string domainIdentity)
         {
             / / Get list of domain users
             List <AllUsersr> listAllUser = (new viewGroups ()). GetAllUser (domainIdentity);

             / / Update the list of users of the grid
             radGridUsers.DataSource = listAllUser;
             radGridUsers.DataBind ();
         }

my code this variable "listAllUser" this taking the existing users and putting in my RadGridView.

I appreciate the help.

Information: Database SQL Server, Visual C # 2010 Ultimate, Telerik components
Eyup
Telerik team
 answered on 28 Aug 2012
8 answers
159 views
I have two problems with anchor tags. First, in preview mode, the full url of the current page is added, so rather than navigate to their targets, they try to open a new editor page. So, a tag like this:

<a href="#top">Return to Top</a>

opens a new window. I found a workaround for this. If you go to preview mode, then switch to html mode, and then back to preview mode, the anchor works properly. Without the back-and-forth, it opens a new window. I was able to reproduce this behavior in the editor demo.

Second, we had a case where the url of the editor page actually got added to the href of a number of anchor tags. I manually cleaned them up, and the problem did not recur (yet...). I can't reproduce it, but it is not the kind of thing a user could have done on purpose. I have asked the user for more info on how this may have happened, so I will post again if I hear anything interesting.

BTW - while researching this problem, I ran into this post (http://www.telerik.com/community/forums/aspnet-ajax/editor/editor-generates-target-and-re-target-properties-in-links.aspx) which discusses a 're-target' attribute being added to anchors. The anchors I cleaned up also had this attribute.
Rumen
Telerik team
 answered on 28 Aug 2012
1 answer
80 views
I built a dynamic tree structure on my web page and this tree has different asp.net and telerik controls (radtextbox checkbox, label..etc) as nodes.
everything works good except when a space button is clicked, I get javascript error saying "null is null or not an object".



Boyan Dimitrov
Telerik team
 answered on 28 Aug 2012
1 answer
95 views
Hello.
I have a problem when I tried to print generated html.
All elements in HTML has top and left attributes and in editor they looks good, but when I tried to print it all pages after first was overlaped.
I attached example pdf (printing result) and screenshot (from two parts) of the editor.
Thanks.

Attached printed pdf
Rumen
Telerik team
 answered on 28 Aug 2012
14 answers
381 views
I've been trying to use radeditor as an email editor and although most of my experience has been smooth I have a couple of issues as below:

a) when using any theme and I have a custom button I cannot get it to display the button normally without a problem with the background. I have added the below to my stylesheet as per the instructions but to no avail:
        .reTool .CRMTemplate<br>        {<br>            background-image: none !important;<br>        }<br>
This is my button definition:
                    <telerik:EditorTool Name="CRMTemplate" ImageUrl="/Images/insertField.png" ShowIcon="false"<br>                        ImageUrlLarge="/Images/insertField.png" Text="Insert CRM Template" Visible="true"<br>                        Enabled="true" ShowText="true" /><br>
The only way I have found to fix this was to add this in my page stylesheet:
        .reButton_text<br>        {<br>            background-image: none !important;<br>        }<br>
I don't know if that's normal behavior or an issue. You can find a sample of the problematic buttons at http://www.dotcy.com.cy/downloads/InvalidButtonBackground.png

b) the second problem I'm facing is with horizontal scrollbars when there is an image in the editor. It appears that automatically the minimum width of the editor becomes the width of the image. Even if I forcefully add a horizontal scrollbar it has no effect. You can find sample images at:
http://www.dotcy.com.cy/downloads/EditorScrollbar1.png and http://www.dotcy.com.cy/downloads/EditorScrollbar2.png

If anyone can help me solve these two issues I'd greatly appreciate it.

It appears issue b) is only occurring with full screen mode but I have to have it at full screen mode. I've been playing with the online demo and got very similar behavior. Please see the 2 attached image files.
Rumen
Telerik team
 answered on 28 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?