Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
93 views
I need to get a count of all items each time a group changes, for example:

year 2008: 100
  month January 3
  record 1
  record 2
  record 3
  month February 5
  record 4
  record 5
  record 6
  record 7
  record 8

etc
I have this code, but it only gets the group header having children records, and not the top level (year)

 foreach (GridGroupHeaderItem groupHeader in rgTickets.MasterTableView.GetItems(GridItemType.GroupHeader))
            {

                Created = Closed = 0;
                GridItem[] children = groupHeader.GetChildItems();
                try
                {
                    foreach (GridItem child in children)
                    {
                        GridDataItem dataItem = child as GridDataItem;
                        Created += Convert.ToInt32(dataItem["Created"].Text);
                        Closed += Convert.ToInt32(dataItem["Closed"].Text);
                    }

                    // strCount = children.Sum(n => Convert.ToInt32(n.Cells[5].Text));
                    groupHeader.DataCell.Text += "    Created:  " + Created.ToString();
                    groupHeader.DataCell.Text += "    Closed:  " + Closed.ToString();

                }
                catch (Exception ex)
                {

 

                }
              

            }





Zed
Top achievements
Rank 1
 answered on 10 Jul 2009
1 answer
97 views
I have a Grid (Q2 2009) where I am assigning a datarouce in Page Load. If I select Page 2 through n it brings up a blank grid. Also, if I select anything from the Page Size menu it wipes out the selection.

Never mind. I realize I need to rebind the datasource
Yavor
Telerik team
 answered on 10 Jul 2009
3 answers
170 views
Hi guys,

it seems that the scheduler have a little display bug. When you want to pick a date by the calendar, if the month have six rows (ex: may 2009), the bottom border is not shown. I've tested it in our pages and in your demos in IE8 and FF3 with different skins and it's always doing the same.

I have the latest version of your controls (asp.net Ajax 2009.2 701).

Not a big problem, but should be corrected in next version.

Continue your good work !!
Kamen Bundev
Telerik team
 answered on 10 Jul 2009
1 answer
109 views
I have a RadChart on a user control and I'm trying to determine how best to use the built in skins and set properties overtop of this.  I am basically giving the user an option to pick from available skins and apply to a chart.  This works fine as long as I set the SkinsOverrideStyles to True.  The problem I ran into is that certain properties don't stick when I set them on the chart instance. For example, I am trying to set the PointMark to show on a Line Chart.  When SkinsOverrideStyles is false, it works but not all of my Skin settings are shown.  When I set SkinsOverrideStyles to true, the chart gets settings from skin but other props (ie PointMark) are ignored.  I realize this is because it is getting the styles from the skin (when true) or the page (when false). 

What should I be doing here? How can I get the best of both worlds?  Apply the skin and then let me set the other props as needed. 

Thanks.
Ves
Telerik team
 answered on 10 Jul 2009
4 answers
196 views
Is there a way to define the ImageUrl property of the menu depending on the selected theme?

..   ImageUrl

="Images/16x16/Activity.gif">  
doesn't get the image from the theme folder and defining the path as "~/App_Themes/MSCRM12/Images/Activity.gif" isn't the best way.

I would like to use them as 'global images' and not specific to a control (like themeing of a control).

Thanks
Eric

Jon
Top achievements
Rank 1
 answered on 10 Jul 2009
3 answers
143 views
I have a tool tip that loads over a control. The tool tip contains a few RadComboBox's. It appears possible to click inside the combobox and the event is transferred to the control below.

I created simple page with a tooltip that loads over a RadCalendar and was able to reproduce. Am I missing something here or is this a bug?  I am using  2009.1 527 (May 27, 2009) and IE 8

It also appears to work fine in compatibility View.

<asp:Label ID="Label2" runat="server" Text="Hello World!"></asp:Label> 
        <telerik:RadToolTip ID="RadToolTip1" runat="server" Height="180px" Width="235px" TargetControlID="Label2" ManualClose ="true">  
            <table> 
            <tr> 
            <td> 
                <telerik:RadComboBox ID="RadComboBox2" runat="server" EmptyMessage="Testing combo...">  
                </telerik:RadComboBox> 
            </td> 
            </tr> 
            <tr> 
            <td> 
                <telerik:RadComboBox ID="RadComboBox3" runat="server" EmptyMessage="Testing combo...">  
                </telerik:RadComboBox> 
            </td> 
            </tr> 
            <tr> 
            <td> 
                <telerik:RadComboBox ID="RadComboBox4" runat="server" EmptyMessage="Testing combo...">  
                </telerik:RadComboBox> 
            </td> 
            </tr>             
              
            </table> 
        </telerik:RadToolTip>       
        <telerik:RadCalendar ID="RadCalendar2" runat="server" Font-Names="Arial, Verdana, Tahoma" 
            ForeColor="Black" Style="border-color: #ececec">  
        </telerik:RadCalendar>     
Georgi Tunev
Telerik team
 answered on 10 Jul 2009
1 answer
86 views
I created a custom web user control simply with a drop down box and an image.
I have a javascript on the user control to capture the click on the image and automatically fire off the drop down box (similar to your TimePicker)
Very simple.....

<

 

script language="javascript" type="text/javascript">

 

 

 

function SetFocus() {

 

 

var comboBox = $find("<%=cboTime.ClientID %>");

 

 

var input = comboBox.get_inputDomElement();

 

 

input.focus();

}

 

 

</

 

script>

 

 

 

<

 

telerik:RadComboBox ID="cboTime" Runat="server" Width="100px" AllowCustomText="true">

 

 

 

</

 

telerik:RadComboBox>&nbsp;&nbsp;<a href="JavaScript:SetFocus()"><asp:Image id = "imgClock" alt="Time" style="height:15; width:15;" runat="server" /></a>

 

 

 

 

 


I have placed 2 of the user controls on my page.

My problem is when I click on either of the images, the focus goes to the last instance of the drop down box.
I looked at the generated code and it appears that the script is in there both times and since the script is named the same, the last definition overwrites any earlier versions.

How do I uniquely define the script so that the click knows which drop down to get focus?
Also I'd like to fire the drop down instead of just focus...which event do I use?

Thanks
Greg
Veselin Vasilev
Telerik team
 answered on 10 Jul 2009
0 answers
89 views
Hi,

        I have a problem in sql, my value is 62.69 and if i split that values in "%" then 

  •     20% = 12.5380
  •     30%=18.8070
  •     50%=31.3450

    The sum of this Total will be 62.69

But i need only decimal with 2 percision then the values "%" value would be like this

  •     20% = 12.54 (rounded as 12.54  for(12.5380)
  •     30%=18.81 (rounded as 12.54  for(18.8070)
  •     50%=31.35 (rounded as 12.54  for(31.3450) 

        The Sum of the Total will be 62.70.

So how to handle such case, can any one help me out in this

Thanks,
Jayashree.S

 

Jayashree
Top achievements
Rank 1
 asked on 10 Jul 2009
1 answer
333 views
Hi,

I like to have a grid, which displays pictures like in your examples. in my testsite I have a small data table which contains the binary image and the name of the image. But for some reason the grid doesn't get bind properly. It shows no records, but the database contains three records. No matter if I create a dataset or use my openaccess datasource. I've changed some things in the code but the most code point to your examples:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=binaryimage



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test1.aspx.cs" Inherits="ProtelShop.Admin.test1" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register assembly="Telerik.OpenAccess, Version=2009.1.405.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" namespace="Telerik.OpenAccess" tagprefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
      
     <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:radscriptblock id="RadScriptBlock1" runat="server">  
            <script type="text/javascript">  
            //On insert and update buttons click temporarily disables ajax to perform upload actions  
            function conditionalPostback(sender, args)  
            {  
                var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig");  
    
                if (args.get_eventTarget().match(theRegexp))  
                {  
                    var upload = $find(window['UploadId']);  
     
                    //AJAX is disabled only if file is selected for upload  
                    if(upload.getFileInputs()[0].value != "")  
                    {  
                        args.set_enableAjax(false);  
                    }  
                 }  
             }  
 
             function validateRadUpload(source, e) {  
                 e.IsValid = false;  
 
                 var upload = $find(source.parentNode.getElementsByTagName('div')[0].id);  
                 var inputs = upload.getFileInputs();  
                 for (var i = 0; i < inputs.length; i++) {  
                     //check for empty string or invalid extension  
                     if (inputs[i].value != "" && upload.isExtensionValid(inputs[i].value)) {  
                         e.IsValid = true;  
                         break;  
                     }  
                 }  
             }  
 
            </script> 
        </telerik:radscriptblock> 
      
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" clientevents-onrequeststart="conditionalPostback">  
 
    <telerik:radprogressmanager id="RadProgressManager1" runat="server"/>  
<telerik:radgrid runat="server" id="RadGrid1" onitemdatabound="RadGrid1_ItemDataBound" GridLines="None" AllowPaging="true" AllowSorting="true" OnPreRender="RadGrid1_PreRender" 
            PageSize="6">  
             <PagerStyle Mode="NextPrevAndNumeric" /> 
 
 <mastertableview  DataKeyNames="ShopImageID">  
  <columns> 
   
   <telerik:gridtemplatecolumn uniquename="Upload">  
    <itemtemplate> 
     <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %> 
                    <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>' 
                        runat="server">  
                         
 
                        <telerik:RadBinaryImage runat="server" ID="test" DataValue='<%# Eval("Image")%>' /> 
                
                    </asp:Panel> 
      
    </itemtemplate> 
    <edititemtemplate> 
     <telerik:radupload id="RadUpload1" runat="server" /> 
    </edititemtemplate> 
   </telerik:gridtemplatecolumn> 
   </columns> 
   <editformsettings> 
     <editcolumn uniquename="EditCommandColumn1"></editcolumn> 
   </editformsettings> 
   </mastertableview> 
</telerik:radgrid> 
</telerik:RadAjaxPanel> 
        <telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server"   
            ContextTypeName="" EnableDelete="True" EnableInsert="True" EnableUpdate="True"   
            ObjectContextProvider="ProtelAccess.ObjectScopeProvider1, ProtelAccess"   
             TypeName="ProtelAccess.ShopImage" > 
        </telerik:OpenAccessDataSource> 
    </form> 
</body> 
</html> 
 

using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.OpenAccess;  
using Telerik.OpenAccess.Query;  
using Telerik.Web.UI;  
using ProtelAccess;  
using ProtelShop;  
using Telerik.Charting;  
using System.Data;  
using System.Drawing;  
using System.IO;  
using System.Drawing.Imaging;  
 
namespace ProtelShop.Admin  
{  
    public partial class test1 : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            RadGrid1.DataSourceID= "OpenAccessDataSource1";  
            RadGrid1.DataBind();  
    
        }  
 
        protected void RadGrid1_PreRender(object sender, EventArgs e)  
        {  
            int itemCount = (sender as RadGrid).MasterTableView.GetItems(GridItemType.Item).Length + (sender as RadGrid).MasterTableView.GetItems(GridItemType.AlternatingItem).Length;  
            foreach (GridItem item in (sender as RadGrid).Items)  
            {  
                if (item is GridDataItem && item.ItemIndex < itemCount - 1)  
                {  
                    ((item as GridDataItem)["shopImageID"] as TableCell).Controls.Add(new LiteralControl("<table style='display:none;'><tr><td>"));  
                }  
            }  
        }  
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
            {  
                RadUpload upload = e.Item.FindControl("RadUpload1") as RadUpload;  
                RadAjaxPanel1.ResponseScripts.Add(string.Format("window['UploadId'] = '{0}';", upload.ClientID));  
 
                  
 
 
            }  
        }  
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
            {  
                GridBinaryImageColumnEditor editor = ((GridEditableItem)e.Item).EditManager.GetColumnEditor("Upload") as GridBinaryImageColumnEditor;  
                TableCell cell = (TableCell)editor.RadUploadControl.Parent;  
                CustomValidator validator = new CustomValidator();  
                validator.ErrorMessage = "Please select file to be uploaded";  
                validator.ClientValidationFunction = "validateRadUpload";  
                validator.Display = ValidatorDisplay.Dynamic;  
                cell.Controls.Add(validator);  
            }  
        }  
 
 
 
    }  
}  
 

thanks
Sebastian
Telerik team
 answered on 10 Jul 2009
4 answers
523 views
Hi!

I have a radgrid which has a column that is always rendered in edit mode. The column is declared like this:
...
<
tel:GridTemplateColumn HeaderText="Tillægsværdi"  UniqueName="ShowTillaegProcent"> 
                            <EditItemTemplate> 
                                <tel:RadNumericTextBox ID="txtTillaegProcent" MinValue="0" MaxValue="100" DataType="System.Decimal" Type="Percent" DbValue='<%# Bind("TillaegProcent") %>' NumberFormat-DecimalDigits="2" Width="50" runat="server" /> 
                            </EditItemTemplate> 
                            <ItemTemplate> 
                                  <%# DataBinder.Eval(Container.DataItem, "TillaegProcent")%> 
                            </ItemTemplate> 
                        </tel:GridTemplateColumn>
...

Unfortunately, this makes the grid render very, very slowly. It takes approx. 30 seconds to render about 100 records. As soon as I remove the
DbValue='<%# Bind("TillaegProcent") %>' 
- the grid renders in "normal" time. The performance impact seems to be bigger in IE7 than FF3
How can this be? Is it bad practice to use the DbValue='# Bind.....' syntax?

Best regards

Henrik M Kristensen






Pavlina
Telerik team
 answered on 10 Jul 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?