Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
127 views
Hi,

I've a radcontext menu with 5 menus under it. The problem is when i give the application for testing, ppl think that button is a normal button and do click and complain that clck of the button is not doing anything.
I need to tell them to right click so that they can then click.
So, how do i over come this.

Pls explain to me with code how do i get context menu even if user simply clcks thebutton(not just right click). thinking of user's point,.

Pls suggest a solution with code in c# .

thanks.
Princy
Top achievements
Rank 2
 answered on 27 Aug 2009
1 answer
57 views
I need to build a custom registration page. Is there an example on the site.
Princy
Top achievements
Rank 2
 answered on 27 Aug 2009
0 answers
125 views
Hi,
Can someone tell me how rad scheduler's weekly is calculated. when i have 10 occurences in end by selection , how's end after calculated  for weekly mode.

Thanks,
ZR
Ayesha
Top achievements
Rank 1
 asked on 27 Aug 2009
4 answers
96 views
Hi,
I am using RadControls for ASPNET AJAX Q2 2008.
I am using radcombobox.
On button click i am calling javascript function.

Function  work in IE7 .
But in IE6 it gives me error.
It does not get object in IE6.

 

var combo = $find("<%= RadCombobox1.ClientID %>");
Here value of combo is null in IE6

How can i solve this problem?

Thanks.

 

mark
Top achievements
Rank 1
 answered on 26 Aug 2009
1 answer
136 views
I'm getting a "Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object" error and I know why but I just don't know how to resolve it.

I've got a page with a RadGrid on it and in the ItemDataBound event I add a confirmation dialog to a column that contains a button as shown below and the reason for the above error is the use of the newline character in the javascript. I've tried using three and four backslashes just for giggles and it produces the same error. I've also tried wrapping the entire RadGrid in a RadScriptBlock and a RadCodeBlock but neither have any affect on the error.

How do I use the new line character in my confirmation dialog and prevent the above error?

                Button executeButton = dataItem["clmExecute"].Controls[0] as Button;
                if (executeButton != null)
                    executeButton.Attributes["onclick"] = string.Format("if(!confirm('Confirm that you want to execute the selected step(s) to:\\n\\nDeployment Date: {0}\\nDescription: {1}\\nRegion: {2}\\nEnvironment: {3}\\n')){{return false;}}", _master.DeploymentDate.ToShortDateString(), _master.DeploymentDateDescription, _master.Region, _master.Environment);
Joey
Top achievements
Rank 1
 answered on 26 Aug 2009
2 answers
338 views
I am on Vista, using Firefox 3.5.2, Visual Studio 2008, and Telerik 2009.02.0701.20

I have a Rad Grid that is using a collection of objects in the session as its data source. I find that when I edit the item in the grid on the UI, the edit form (defined in a template) is displayed, but when I click on the Insert / Update button, the form stays visible. Clicking on the Cancel button causes the form to disappear (as expected). What do I need to do to cause the edit form to disappear on Insert / Update?

For a sample, here is my aspx page:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DiscountTest.aspx.cs" Inherits="Cleopatra.pages.Admin.DiscountTest" MasterPageFile="../../Main.Master" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="cphBody"> 
  <!-- custom head section --> 
  <style type="text/css"> 
    .bigModuleBottom td 
    { 
      padding: 0; 
    } 
  </style> 
  <!-- end of custom head section --> 
  <!-- content start --> 
  <span style="font-weight: bold;">Discounts</span> 
  <br /> 
  <br /> 
  <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
 
    <script type="text/javascript"> 
      function RowDblClick(sender, eventArgs) { 
        sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical()); 
      } 
    </script> 
 
  </telerik:RadCodeBlock> 
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
    <AjaxSettings> 
      <telerik:AjaxSetting AjaxControlID="RadGrid1"> 
        <UpdatedControls> 
          <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
        </UpdatedControls> 
      </telerik:AjaxSetting> 
    </AjaxSettings> 
  </telerik:RadAjaxManager> 
  <telerik:RadGrid ID="RadGrid1" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowSorting="True" AutoGenerateColumns="false" AllowPaging="True" 
    GridLines="None" runat="server" ShowFooter="True" PageSize="10" AllowAutomaticInserts="True" 
    OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_ItemInserted" 
    OnDeleteCommand="RadGrid1_ItemDeleted" OnUpdateCommand="RadGrid1_ItemUpdated"> 
    <PagerStyle Mode="NextPrevAndNumeric" /> 
    <MasterTableView Width="400px" CommandItemDisplay="TopAndBottom" DataKeyNames="EntryID"> 
      <Columns> 
        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" /> 
        <telerik:GridBoundColumn HeaderText="ID" DataField="EntryID" UniqueName="EntryID" Display="false" Visible="false" /> 
        <telerik:GridBoundColumn HeaderText="Flat Fee?" UniqueName="FlatFee" DataField="FlatFee" /> 
        <telerik:GridBoundColumn HeaderText="Number of Loans" DataField="NumLoans" UniqueName="NumLoans" /> 
        <telerik:GridBoundColumn HeaderText="Discount" DataField="Discount" UniqueName="Discount" /> 
        <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" ButtonType="ImageButton" /> 
      </Columns> 
      <EditFormSettings EditFormType="Template"> 
        <FormTemplate> 
          <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none" style="border-collapse: collapse; background: white;"> 
            <tr class="EditFormHeader"> 
              <td colspan="2" style="font-size: small"> 
                <b>Discount Details</b> 
              </td> 
            </tr> 
            <tr> 
              <td> 
                <table id="Table3" cellspacing="1" cellpadding="1" width="250" border="0" class="module"> 
                  <tr> 
                    <td> 
                      <asp:HiddenField runat="server" ID="hEntryID" Value='<%# Bind("EntryID") %>' /> 
                    </td> 
                    <td> 
                      &nbsp; 
                    </td> 
                  </tr> 
                  <tr> 
                    <td> 
                      <asp:CheckBox runat="server" ID="cbFlatFee" Text="Flat fee?" /> 
                    </td> 
                    <td> 
                      &nbsp; 
                    </td> 
                  </tr> 
                  <tr> 
                    <td> 
                      Number of Loans: 
                    </td> 
                    <td> 
                      <telerik:RadTextBox ID="txtNumLoans" runat="server" MaxLength="50" Text='<%# Bind("NumLoans") %>' /> 
                    </td> 
                  </tr> 
                  <tr> 
                    <td> 
                      Discount: 
                    </td> 
                    <td> 
                      <telerik:RadTextBox ID="txtDiscount" runat="server" MaxLength="50" Text='<%# Bind("Discount") %>' /> 
                    </td> 
                  </tr> 
                </table> 
              </td> 
            </tr> 
            <tr> 
              <td> 
                &nbsp; 
              </td> 
            </tr> 
            <tr> 
              <td align="right" colspan="2"> 
                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' /> 
                &nbsp; 
                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel" /> 
              </td> 
            </tr> 
          </table> 
        </FormTemplate> 
      </EditFormSettings> 
    </MasterTableView> 
    <ClientSettings> 
      <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" /> 
    </ClientSettings> 
  </telerik:RadGrid> 
  <!-- content end --> 
</asp:Content> 
 

And here is the code behind:

using System; 
using System.Collections.Generic; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Telerik.Web.UI; 
 
namespace Cleopatra.pages.Admin 
{ 
  public partial class DiscountTest : System.Web.UI.Page 
  { 
    private class DiscountEntry 
    { 
      private int _EntryID = -1; 
      public int EntryID 
      { 
        get { return _EntryID; } 
        set { _EntryID = value; } 
      } 
 
      private bool _DiscountIsRate = false;       
      public bool DiscountIsRate 
      { 
        get { return _DiscountIsRate; } 
        set { _DiscountIsRate = value; } 
      } 
 
      private int _NumLoans = 0;       
      public int NumLoans 
      { 
        get { return _NumLoans; } 
        set { _NumLoans = value; } 
      } 
 
      private double _Discount = 0.0;       
      public double Discount 
      { 
        get { return _Discount; } 
        set { _Discount = value; } 
      } 
    } 
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
      object obj = Session["discounts"]; 
      List<DiscountEntry> discounts = (List<DiscountEntry>) Session["discounts"]; 
      if (discounts == null) 
      { 
        discounts = new List<DiscountEntry>(); 
        Session.Add("discounts", discounts); 
      } 
    } 
 
    protected void RadGrid1_PreRender(object sender, System.EventArgs e) 
    { 
      if (!this.IsPostBack) 
      { 
        RadGrid1.EditIndexes.Add(1); 
        RadGrid1.Rebind(); 
        RadGrid1.MasterTableView.Rebind(); 
      } 
    } 
 
 
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
      List<DiscountEntry> discounts = (List<DiscountEntry>) Session["discounts"]; 
      RadGrid1.DataSource = discounts; 
    } 
 
    protected void RadGrid1_ItemUpdated (object source, GridCommandEventArgs e) 
    { 
      if (e.Item != null) 
      { 
        // Get the form controls out 
        GridEditFormItem editFormItem = (GridEditFormItem) e.Item; 
        HiddenField hEntryID = (HiddenField) editFormItem.FindControl("hEntryID"); 
        CheckBox cbFlatFee = (CheckBox) editFormItem.FindControl("cbFlatFee"); 
        RadTextBox txtNumLoans = (RadTextBox) editFormItem.FindControl("txtNumLoans"); 
        RadTextBox txtDiscount = (RadTextBox) editFormItem.FindControl("txtDiscount"); 
        int entryID = Convert.ToInt32(hEntryID.Value); 
        // Locate and update the discount entries 
        List<DiscountEntry> discounts = (List<DiscountEntry>) Session["discounts"]; 
        foreach (DiscountEntry entry in discounts) 
        { 
          if (entry.EntryID == entryID) 
          { 
            entry.DiscountIsRate = !cbFlatFee.Checked; 
            entry.NumLoans = Convert.ToInt32(txtNumLoans.Text); 
            entry.Discount = Convert.ToDouble(txtDiscount.Text); 
            break; 
          } 
        } 
      } // valid edit item 
      RadGrid1.Rebind(); 
      RadGrid1.MasterTableView.Rebind(); 
    } 
 
    protected void RadGrid1_ItemDeleted(object source, GridCommandEventArgs e) 
    { 
      if (e.Item != null) 
      { 
        List<DiscountEntry> discounts = (List<DiscountEntry>) Session["discounts"]; 
        discounts.RemoveAt(e.Item.ItemIndex); 
      } // valid delete item 
    } 
 
    protected void RadGrid1_ItemInserted(object source, GridCommandEventArgs e) 
    { 
      if ((e.Item is GridEditFormInsertItem) && (e.Item.OwnerTableView.IsItemInserted)) 
      { 
        // Get the user controls in the form 
        GridEditFormItem editFormItem = e.Item as GridEditFormItem; 
        HiddenField hEntryID = (HiddenField) editFormItem.FindControl("hEntryID"); 
        CheckBox cbFlatFee = (CheckBox) editFormItem.FindControl("cbFlatFee"); 
        RadTextBox txtNumLoans = (RadTextBox) editFormItem.FindControl("txtNumLoans"); 
        RadTextBox txtDiscount = (RadTextBox) editFormItem.FindControl("txtDiscount"); 
 
        // Create a new discount table entry and add it to the loan type 
        List<DiscountEntry> discounts = (List<DiscountEntry>) Session["discounts"]; 
        // Determine next available ID 
        int newEntryID = 0; 
        Dictionary<int,bool> discountHash = new Dictionary<int,bool>(); 
        foreach (DiscountEntry discount in discounts) 
        { 
          discountHash.Add(discount.EntryID, true); 
        } 
        int i = 0; 
        while (true) 
        { 
          if (!discountHash.ContainsKey(++i)) 
          { 
            newEntryID = i; 
            break; 
          } 
        } // while loop 
        DiscountEntry entry = new DiscountEntry(); 
        entry.EntryID = newEntryID; 
        entry.DiscountIsRate = !cbFlatFee.Checked; 
        entry.NumLoans = Convert.ToInt32(txtNumLoans.Text); 
        entry.Discount = Convert.ToDouble(txtDiscount.Text); 
        discounts.Add(entry); 
      } // valid insertion 
      RadGrid1.Rebind(); 
      RadGrid1.MasterTableView.Rebind(); 
    } 
  
  
  } 
} 
 
 

Any thoughts and ideas for me?
Dan
Top achievements
Rank 1
 answered on 26 Aug 2009
1 answer
128 views
hi,

it is possible that the scheduler has always the same height as the browser?

thanks
christian
Doug Beard
Top achievements
Rank 2
 answered on 26 Aug 2009
1 answer
142 views
Hi guys

Thanks for all your help so far!

Following the help docs I have added this in code behind to add a very simple tooltip
to my grid which should show the record ID on mouseover.

Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs)  
         
        If (TypeOf e.Item Is GridDataItem) Then  
            Dim gridItem As GridDataItem = CType(e.Item, GridDataItem)  
 
            For Each column As GridColumn In RadGrid1.MasterTableView.RenderColumns  
                If (TypeOf column Is GridBoundColumn) Then  
 
                    gridItem(column.UniqueName).ToolTip = ("ID: " + gridItem.OwnerTableView.DataKeyValues(gridItem.ItemIndex)("ID").ToString)  
                      
                End If  
            Next  
        End If  
    End Sub 

This doesn't actually do anything - no hand appears on mousover, no tooltip.

Do I also need RadAjax Manger and Tooltip manager in the declarations? The docs don't mention it but
the demo shows them so added this as my grid has paging and sorting  (I already have radajaxmanager in master page):
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
                    <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                        <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
                    </telerik:RadAjaxManagerProxy> 
                  
                <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"   
                        ManualClose="True">  
                    </telerik:RadToolTipManager> 

Still haven't succeeded.   Maybe some 'imports'missing in code behind? 

Can you suggest where I am going wrong?

Thanks

Clive

Schlurk
Top achievements
Rank 2
 answered on 26 Aug 2009
5 answers
187 views
Hello,

I have a RadGrid that i am using for edit mode only, in a spreadsheet type scenario.  This means that i will not be performing any sort of row selection.  Currently i can start from the first control and tab through the remaining controls exactly like i want.  However what i am trying to do now is provide keyboard up and down support so they can choose to select boxes in that way.

I basically have 3 columns of editable data.  At the moment if you tab it goes from box 1 row 1 to box 2 row 1 to box 3 row 1 to box 1 row 2.  This is how i want tabbing to work.

For the up down if i am on box 1 row 1 and i hit down i want it to go to box 1 row 2 then box 1 row 3 then if i only have 3 rows and hit down again i want it to go to box 1 row 1.

Is there any way to build support for this?
Michael Arocho
Top achievements
Rank 2
 answered on 26 Aug 2009
4 answers
174 views
I used ASPNETAJAX Q1 2009 and copy the black skin with css to my project (See picture below)

http://img196.imageshack.us/img196/2914/externalcss03.png

When I will the web page the result look like this (See picture below)

http://img441.imageshack.us/img441/3349/externalcss01.png

For picture above, I can change any presentation in Menu.Black.CSS.  However, the property that I want to change is the .RadMenu .rmItem{} which located in WebResource.axd?d*snDMiF8h..............................................  (Please refer to picture below).  I can only see this properties in firebug.

http://img81.imageshack.us/img81/3082/externalcss02.png

As you can see from the picture, I can change the property I want in firebug and make the item float from the right.  I tried to copy all code from Menu.CSS to Menu.Black.CSS.  But It didn't work.  In other word, the change I want to make is in the Menu.CSS which shows on firebug as WebResource.axd?d*snDMiF8h..............................................    How do I get rid on WebResource and like Menu.CSS to my project so that I can modify any property in there?

Thanks in Advance
Urt
Top achievements
Rank 1
 answered on 26 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?