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

I have a requirement to implement "Tooltip" in html table row. In order to implement Tooltip functionality i have used RadToolTipManager, here i am getting tooltip while hovering on html table row, but unable to populate value in the tooltip, as AjaxUpdate event which i have declared in Customer.ascx.cs file is not working -

RadToolTipManager1= this.Page.Master.FindControl("RadToolTipManager1") as RadToolTipManager
RadToolTipManager1.AjaxUpdate += new ToolTipUpdateEventHandler(RadToolTipManager_AjaxUpdate);

 

Please help me in calling AjaxUpdate event in Customer.ascx.cs file so that i can update my Tooltip with the values coming from DB without using webservice.

I am giving code that i tried to implement Tooltip functionality. for reference -

Master page -

<telerik:RadToolTipManager RenderMode="Lightweight" ID="RadToolTipManager1" Width="400px" Height="200px" ContentScrolling="Auto" HideEvent="ManualClose" RelativeTo="Element" Position="BottomCenter" runat="server" IgnoreAltAttribute="true"></telerik:RadToolTipManager>

 

In script Tooltip.js file - 

showToolTip: function (element) {
                var tooltipManager = telerikDemo.tooltipManager;
              
                //If the user hovers the image before the page has loaded, there is no manager created
                 if (!tooltipManager) return;
                 
                ////Find the tooltip for this element if it has been created  
                 var tooltip = tooltipManager.getToolTipByElement(element);
                //Create a tooltip if no tooltip exists for such element 
                if (!tooltip) {
                  tooltip = tooltipManager.createToolTip(element);
                  //Use the fact that the image was named after a country
                  //Extract the country name from the image, and set it as the value to be supplied to the web-service
                    tooltip.set_targetControlID(element.id)
                }
                //Let the tooltip's own show mechanism take over from here - execute the onmouseover just once
                  element.onmouseover = null;
                //show the tooltip
                setTimeout(function () {
                    tooltip.show();
                }, 10);
            }

 

Customer.ascx

<tr id="Amount" onmouseover='telerikDemo.showToolTip(this)'>
 <td>
<%# Decimal.Parse(Eval("Amount").ToString()) < 0 ? String.Format("({0:N})", Math.Abs(Decimal.Parse(Eval("Amount").ToString()))) :String.Format("{0:N}", Decimal.Parse(Eval("Amount").ToString()))%>
</td>
</tr>

 

Customer.ascx.cs

public partial class Customer: System.Web.UI.UserControl{
   protected RadToolTipManager RadToolTipManager1;
   
 protected void Page_Load(object sender, EventArgs e)
        {
            RadToolTipManager1= this.Page.Master.FindControl("RadToolTipManager1") as RadToolTipManager;
            RadToolTipManager1.AjaxUpdate += new ToolTipUpdateEventHandler(RadToolTipManager_AjaxUpdate);
          }
          protected void RadToolTipManager_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
          {

             AjaxUpdate is not working.

          }
}

 

I tried to implement above "Tooltip" functionality by referring below link.
https://demos.telerik.com/aspnet-ajax/tooltip/examples/radtooltipmanagerclientapi/defaultcs.aspx

Thanks in advance.

Aditya


 

 

 

 

Eyup
Telerik team
 answered on 23 Aug 2019
4 answers
487 views
Hi,
i need to expand sub menus onClick but not onMouserHover. i have tried it by adding a property ClickToOpen="True"  but while clicking on menu sub menus are opening, page is taking a postback and sub menus are closing again. Sub menus should be in open state but it is closing. Requesting to provide me some solution on this.

Thanks and Regards
A.Rajender
Mukesh
Top achievements
Rank 1
 answered on 23 Aug 2019
4 answers
132 views
I noticed that there is this CSS selector which will screw up the content in the advanced edit form:

.RadScheduler * {
margin: 0;
padding: 0;
}

Is there any way to change this selector so it won't screw up the content in my edit form? I use a user control in there which we also use in the RadGrid where everything is fine.

Thanks!
Scott
Top achievements
Rank 1
 answered on 22 Aug 2019
1 answer
111 views

     I've been tasked with writing a scheduler for football pitches. Each pitch can also be divided into two half pitches. Obviously if a half pitch is booked then the full pitch cannot be booked at the same time and I need to add a 15 minute interval between every booking. So if a half pitch is booked for 2pm the full pitch cannot be booked until 3.15pm (1 hour + 15 minutes). However, someone could book the other half for 2.15pm which means the full pitch would not be available until 3.30pm (2.15 + 1 hour + 15 minutes). I have tried to do this using resources but I cannot work out how to create a resource (pitch) which could be 1st half or 2nd half or full depending on the other bookings (appointments) around it.

Any help / ideas / pointers would be very much appreciated. 

Thank you!

Peter Milchev
Telerik team
 answered on 22 Aug 2019
6 answers
169 views

Hi,

I've got an issue where the RadGrid is hiding columns that it shouldn't do when Google Chrome has hardware acceleration disabled. We're not seeing the same behaviour on Edge or Internet Explorer, and it doesn't seem to happen every time.

I'm trying to work around it in JavaScript by raising RadAjaxManager.ajaxRequestWithTarget and raising the scroll event, but this just duplicates columns.

Can you give me a bit of guidance how to work round this?

Thanks

Attila Antal
Telerik team
 answered on 22 Aug 2019
0 answers
119 views

I have this Rad Grid setup

<telerik:RadGrid ID="RGLeadExaminer" runat="server"
                                        OnItemCommand="RadEmployees_ItemCommand"
                                        OnInsertCommand="RGLeadExaminer_InsertCommand"
                                        OnUpdateCommand="RGLeadExaminer_UpdateCommand"
                                        OnItemCreated="RGLeadExaminer_ItemCreated"
                                        OnItemInserted="RGLeadExaminer_ItemInserted"
                                        OnItemDataBound="RGLeadExaminer_ItemDataBound"
                                        AllowAutomaticInserts="false"
                                        AutoGenerateColumns="false"
                                        OnNeedDataSource="RGLeadExaminer_NeedDataSource"
                                        AllowAutomaticDeletes="true"
                                        AllowAutomaticUpdates="false"
                                        MasterTableView-AllowAutomaticInserts="true">
                                        <MasterTableView AutoGenerateColumns="false" CommandItemDisplay="Top"
                                            DataKeyNames="ExaminationId" Font-Size="Medium"
                                            NoMasterRecordsText="No Validations Added" InsertItemPageIndexAction="ShowItemOnCurrentPage"
                                            CommandItemSettings-AddNewRecordText="Add New Comparison">
                                            <Columns>
                                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" />
                                                <telerik:GridTemplateColumn UniqueName="" HeaderText="Lead Examiner Full Name">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblExaminerName" runat="server"
                                                            Text='<%# DataBinder.Eval(Container.DataItem, "ExaminerName") %>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:DropDownList ID="ddlExaminerName" runat="server" UniqueName="ExaminerName" DataTextField="ExaminerName" DataValueField="ExaminedById_FK" />
                                                    </EditItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn UniqueName="DateTemplateColumn" HeaderText="Comparison Date" SortExpression="ComparisonDate">
                                                    <ItemTemplate>
                                                        <asp:Label ID="ComparisonDateEditItemTemplate" runat="server"
                                                            Text='<%# DataBinder.Eval(Container.DataItem, "ExaminedDate","{0:MM/dd/yyyy}") %>'>
                                                        </asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <telerik:RadDatePicker ID="dpExaminationDate" UniqueName="ExaminationDatePicker" DateInput-DateFormat="MM/dd/yyyy" MinDate="2006/1/1" runat="server" DbSelectedDate='<%# Bind("ExaminedDate") %>'>
                                                        </telerik:RadDatePicker>
                                                    </EditItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn UniqueName="ExamByNonOCSO" HeaderText="Examined By Non OCSO">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblOtherAgency" runat="server" Visible="true"
                                                             Text='<%# DataBinder.Eval(Container.DataItem, "ExaminedByNoneOCSO") %>'></asp:Label>
                                                    </ItemTemplate>
                                                    <EditItemTemplate>
                                                        <asp:TextBox runat="server" ID="txtExamindedBy" Visible="true"></asp:TextBox>
                                                    </EditItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn AllowFiltering="false">
                                                    <ItemTemplate>
                                                        <asp:Button ID="btnComparisonDelete" CssClass="btn btn-xs btn-danger"
                                                            Text="Delete" runat="server" OnClick="btnComparisonDelete_Click"
                                                             OnClientClick="confirmAspButton(this); return false;"></asp:Button>
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </telerik:RadGrid>

 

The Radgrid works fine to display the data.  The problem is I cannot add, delete or edit any records.  If I click the delete button or edit icon nothing happens.  If I click the Add new comparison link all of the controls used to add a new record are displayed. The drop down list shows the first record for the list, but I cannot get the drop down list to open and show other selections, I cannot click into the text box to add new text.

But for some reason I can select a date for the date picker.  If I click the Insert or cancel links nothing happens.  What have I done wrong with this setup.

 

I am using a SQL Server view as my datasource for this grid.  I have used views in the past without this problem.

Perry
Top achievements
Rank 1
 asked on 21 Aug 2019
5 answers
223 views

Hello, have good time
I have a page where it's a grid.

In this grid one of the columns is hidden where the user ID is and in the other column it fills the user name with another table in the event ItemDataBound
But when grouping it shows the user ID while I need the name to show it.

  protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {

 if (e.Item is GridDataItem)// to access a row
            {
                GridDataItem item = (GridDataItem)e.Item;
                if (RadGrid1.GroupingEnabled)
                {
                    item["UserFLName"].Text = LstUser.FindAll(x => x.User_ID_ == int.Parse(item["User_ID"].Text))[0].User_FName + " " + LstUser.FindAll(x =>     x.User_ID_ == int.Parse(item["User_ID"].Text))[0].User_LName;
                }
            }

Attila Antal
Telerik team
 answered on 21 Aug 2019
4 answers
277 views
I have a Telerik AJAX Radtoolbar act against a RadGrid. I have code behind to do something when I click items on the ToolBar base on row selected in the grid, but before the post back, I need some client side validation, post back won't happen if validation fails. I tried to use
<telerik:RadToolBar runat="server" Width="100%" ID="RadToolBar1" EnableRoundedCorners="true"  OnClientButtonClicked="javascript:if(!PageValidation()){return false;}"  OnButtonClick="RadToolBar1_ButtonClick" EnableShadows="true" Skin="Office2007" Height="27px" AutoPostBack="false">
                      <Items>
                       <telerik:RadToolBarButton Text="Export" Value="1" PostBack="true" />
                        <telerik:RadToolBarButton IsSeparator="true" />
function PageValidation() {
                var IsValid = false;
                      var error = document.getElementById("errorMsg");
                var mastertableView = $find("<%= RadGrid1.MasterTableView.ClientID %>");
                 var count = mastertableView.get_selectedItems().length;
                    if (count < 1) {
                                 error.style.display = "inherit";
                        IsValid = false;
                    }
                    else {
                         error.style.display = "none";
                        IsValid = true;
                    }
                 
                return IsValid;
 
            }
However, this causes the RadToolBar unclickable and even jam all other AJAX functions on the page. if I changed the OnClientClicked to "OnClientButtonClicked="PageValidation" ", the client side validation works with the error msg pop up but it cannot stop the post back.

Are there any other ways that I can work around or did I miss something using this method?

Thanks!
Peter Milchev
Telerik team
 answered on 21 Aug 2019
6 answers
286 views

Hello Guys

I have a problem. When i using RenderMode in RadGrid , I got this error:

Specified argument was out of the range of valid values.

Parameter name: valueDescription: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: value

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace: 

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: value] System.Web.UI.WebControls.Unit.GetTypeFromString(String value) +3065878 System.Web.UI.WebControls.Unit..ctor(String value, CultureInfo culture, UnitType defaultType) +261

.

.

.

This is my aspx:

<telerik:RadGrid ID="gvRad2" runat="server" OnNeedDataSource="gvRad2_OnNeedDataSource"
            utoGenerateColumns="false" AllowPaging="true"
            AllowSorting="True"
            AllowFilteringByColumn="True"
            RenderMode="Lightweight">
            <MasterTableView DataKeyNames="PostLetterID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                <Columns>
                    <telerik:GridBoundColumn DataField="PostLetterID" HeaderText="haha"
                        
                        ReadOnly="true"
                        ForceExtractValue="Always" ConvertEmptyStringToNull="true" AllowFiltering="False"></telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

Vessy
Telerik team
 answered on 20 Aug 2019
5 answers
782 views
Hi All,

I need to show confirmation before performing action when i click on RadButton. 

please help.

Regards,

Prassin
Peter Milchev
Telerik team
 answered on 20 Aug 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?