Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
407 views
Hi ,
How could i set parentheses for negatives using boundcolumns without currency symbol something like this

(1,980.70)

actually i have this dataformatstring , and its cool 'cause completes the decimal position with #.00 always
<telerik:GridBoundColumn    DataField="Noviembre" Aggregate="Sum" HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:N2}" DataType="System.Decimal" 
                                                                            FooterAggregateFormatString="{0:N2}" FooterStyle-Font-Bold="true"
                                                                             <HeaderStyle HorizontalAlign="Right" /> 
                                                                             <ItemStyle HorizontalAlign="Right" /> 
                                                                     <FooterStyle HorizontalAlign="Right" /> 
                                                </telerik:GridBoundColumn> 
wih this code and setting the dataformatstring={"0:C"} parentheses works but whit the currency symbol
CultureInfo ci = new CultureInfo("es-PE"); 
ci.NumberFormat.CurrencyNegativePattern = 14
System.Threading.Thread.CurrentThread.CurrentCulture = ci

i hope you can help me, thanks

Regards
Gino


Shinu
Top achievements
Rank 2
 answered on 27 Jan 2010
1 answer
116 views
Hello Everybody,

I have problem with OnClienLoad property. We create dynamicly radeditor code behind like this:
 Dim editor As Control = CreateDhtmlEditor("editor")  
 Label1.Controls.Add(editor) 'Add control to label  
 'Find RadEditor and add Ajax to component  
 Dim RadEd As Telerik.WebControls.RadEditor = CType(Page.FindControl("editor"),Telerik.WebControls.RadEditor)  
RadAjaxManager1.AjaxSettings.AddAjaxSetting(btnOpenTemplate, CType(RadEd, Telerik.WebControls.RadEditor), AjaxLoadingPanel1)  
 RadAjaxManager1.AjaxSettings.AddAjaxSetting(btnOpenTemplate, CType(RadEd, Telerik.WebControls.RadEditor), AjaxLoadingPanel1)  
'add client side event  
RadEd.OnClientLoad="OnClientLoad" 

Basicly this is how we create Editor to Webpage. I have written my onLoadevent into page.aspx file. This is written onload event on codebehind
 function OnClienLoad(editor)  
{  
   alert('Editor');  

Every time i get following error message:
Exception on excetuing Client event onclientload error:'OnClientLoad' is undifined.

Please some tell what I am doing Wrong. We are using RadEditor 7.12.


Jouni
Top achievements
Rank 1
 answered on 27 Jan 2010
3 answers
143 views
Hi

I am trying to display the orders related to a certain customer, at the moment i am displaying all orders for every customer?

regards

D

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="nestedviewtemplate.aspx.vb" 
    Inherits="_Default" %> 
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
</head> 
<body class="BODY"
    <form runat="server" id="mainForm" method="post"
    <telerik:RadScriptManager runat="server" ID="ScriptManager1"
    </telerik:RadScriptManager> 
    <!-- content start --> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> 
    <telerik:RadGrid ID="RadGrid1"  runat="server" AutoGenerateColumns="true" 
        AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" PageSize="5" 
        GridLines="None" ShowGroupPanel="true"
        <PagerStyle Mode="NumericPages"></PagerStyle> 
        <MasterTableView DataKeyNames="customerid" AllowMultiColumnSorting="True"
            <NestedViewTemplate> 
                <telerik:RadGrid runat="server" ID="nestedgrid" OnNeedDataSource="onneeddatasource_nestedgrid" 
                    ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false" OnItemCreated="nested_Created" 
                    OnItemCommand="Onitemcommand_nestedgrid_jahoor"
                    <MasterTableView ShowHeader="true" AutoGenerateColumns="true" AllowPaging="true" 
                        PageSize="7"
                        <Columns> 
                            <telerik:GridEditCommandColumn> 
                            </telerik:GridEditCommandColumn> 
                        </Columns> 
                        <EditFormSettings EditFormType="Template"
                            <FormTemplate> 
                                <asp:ImageButton ID="imgb" runat="server" CommandName="go" /> 
                                <asp:Button ID="btn1" runat="server" CommandName="buttonclicked" /> 
                                <asp:DropDownList ID="ddl1" runat="server"
                                </asp:DropDownList> 
                            </FormTemplate> 
                        </EditFormSettings> 
                    </MasterTableView> 
                </telerik:RadGrid> 
            </NestedViewTemplate> 
           <NestedViewSettings >   
               <ParentTableRelation>  
                   <telerik:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" />  
               </ParentTableRelation>  
           </NestedViewSettings>  
            <Columns> 
            </Columns> 
        </MasterTableView> 
        <ClientSettings AllowDragToGroup="true" /> 
    </telerik:RadGrid> 
    
    <!-- content end --> 
    </form> 
</body> 
 

Imports Telerik.Web.UI 
Imports System 
Imports System.Data 
Imports System.Data.SqlClient 
Imports System.Web.UI.WebControls 
Imports System.Configuration 
Partial Class _Default 
    Inherits System.Web.UI.Page 
 
 
    Dim ConnString As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString 
 
    Protected Sub nestedgrid_ItemCreated(ByVal sender As ObjectByVal e As GridItemEventArgs) 
        Dim btn As Button 
        Dim ddl As DropDownList 
        If e.Item.ItemType = GridItemType.EditFormItem And e.Item.IsInEditMode Then 
            Dim edititem As GridEditFormItem = CType(e.Item, GridEditFormItem) 
            ddl = CType(edititem.FindControl("ddl1"), DropDownList) 
            btn = CType(edititem.FindControl("btngo"), Button) 
 
            ddl.DataSource = dsddl() 
            ddl.DataTextField = "ShipName" 
            ddl.DataValueField = "OrderID" 
            ddl.DataBind() 
 
        End If 
    End Sub 
 
 
 
    Public Function myds() As DataSet 
        Dim conn As SqlConnection = New SqlConnection(ConnString) 
        Dim adapter As SqlDataAdapter = New SqlDataAdapter 
        adapter.SelectCommand = New SqlCommand("SELECT TOP 10 OrderID, ShipName, ShipAddress FROM Orders", conn) 
        Dim myDataSet As DataSet = New DataSet 
 
        conn.Open() 
        Try 
            adapter.Fill(myDataSet, "Orders"
            adapter.SelectCommand = New SqlCommand("SELECT OrderID, Quantity FROM [Order Details]", conn) 
            adapter.Fill(myDataSet, "OrderDetails"
        Finally 
            conn.Close() 
        End Try 
        Return myDataSet 
 
    End Function 
 
 
    Public Function dsddl() As DataSet 
        Dim conn As SqlConnection = New SqlConnection(ConnString) 
        Dim adapter As SqlDataAdapter = New SqlDataAdapter 
        Dim myDataSet As DataSet = New DataSet 
 
        conn.Open() 
        Try 
 
            adapter.SelectCommand = New SqlCommand("SELECT TOP 10 OrderID, ShipName FROM Orders", conn) 
            adapter.Fill(myDataSet, "OrderDetails"
        Finally 
            conn.Close() 
        End Try 
        Return myDataSet 
 
    End Function 
 
 
    Protected Sub nestedgrid_ItemCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) 
        If e.CommandName = "Go" Then 
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) 
            Dim editItem As GridEditFormItem = DirectCast(item.EditFormItem, GridEditFormItem) 
 
            Dim doptdown As DropDownList = DirectCast(editItem.FindControl("ddl1"), DropDownList) 
            Dim value As String = doptdown.SelectedItem.Text 
            Response.Write(value) 
        End If 
    End Sub 
 
    Public Function GetDataTable(ByVal query As StringAs DataTable 
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("NorthwindConnectionString").ConnectionString 
        Dim conn As SqlConnection = New SqlConnection(ConnString) 
        Dim adapter As SqlDataAdapter = New SqlDataAdapter 
        adapter.SelectCommand = New SqlCommand(query, conn) 
        Dim table1 As New DataTable 
        conn.Open() 
        Try 
            adapter.Fill(table1) 
        Finally 
            conn.Close() 
        End Try 
        Return table1 
    End Function 
 
 
 
    Public Sub onneeddatasource_nestedgrid(ByVal source As ObjectByVal e As GridNeedDataSourceEventArgs) 
        Dim grid As RadGrid = DirectCast(source, RadGrid) 
        ' Populate the grid         
        grid.DataSource = GetDataTable("SELECT * FROM orders"
    End Sub 
 
 
    Protected Sub Onitemcommand_nestedgrid_jahoor(ByVal source As ObjectByVal e As GridCommandEventArgs) 
        '  Throw New NotImplementedException() 
   Dim item As GridDataItem 
 
        If e.CommandName = "go" Then 
 
            If e.Item.ItemType = GridItemType.Item Then 
                item = CType(e.Item, GridDataItem) 
 
                Dim ddl As DropDownList = CType(item.EditFormItem.FindControl("ddl1"), DropDownList) 
                'ddlEventStatus = CType(itemEdit.FindControl("ddlEventStatus"), DropDownList) 
 
                Response.Write(ddl.SelectedItem.Text) 
            End If 
 
        End If 
    End Sub 
 
    Protected Sub nested_Created(ByVal sender As ObjectByVal e As GridItemEventArgs) 
 
        Dim ddl As DropDownList 
        If e.Item.ItemType = GridItemType.EditFormItem And e.Item.IsInEditMode Then 
            Dim edititem As GridEditFormItem = CType(e.Item, GridEditFormItem) 
            ddl = CType(edititem.FindControl("ddl1"), DropDownList) 
           
            ddl.DataSource = dsddl() 
            ddl.DataTextField = "ShipName" 
            ddl.DataValueField = "OrderID" 
            ddl.DataBind() 
 
        End If 
    End Sub 
 
    Protected Sub RadGrid1_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource 
        RadGrid1.DataSource = GetDataTable("Select * from customers"
    End Sub 
End Class 
 

Tsvetoslav
Telerik team
 answered on 27 Jan 2010
3 answers
167 views
I have a RadGrid with AutoGenerated GridBoundColumns.

This works great, however i am trying to make one of these columns a GridDropDownColumn from the ColumnCreated() event. I can't find any examples of this anywhere. This post: http://www.telerik.com/help/aspnet/grid/grdcustomizeconfiguregriddropdowncolumn.html is not helping me very much being that all my columns are GridBoundColumns, i have no GridDropDownColumns and (GridDropDownListColumnEditor)(editMan.GetColumnEditor()) fails every time.

Can someone tell me how to set a GridBoundColumn as a GridDropDownColumn?

Thanks,

Duncan
Princy
Top achievements
Rank 2
 answered on 27 Jan 2010
3 answers
172 views
I am using a bar chart with 3 stacked bars and a line, so 4 series total.   The xAxis label is going right through the xAxis, i really need to move the xAxis label down about 50px so it sets below the xAxis.


sample if ______________________ is the xAxis and 12345 is the label.


  2
__3_____________________________________
     4
       5

I am setting the following values.

            radChart.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 45
            radChart.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.Black; 
            radChart.PlotArea.XAxis.AxisLabel.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Bottom; 
            radChart.PlotArea.XAxis.AxisLabel.Appearance.Position.Auto = false
            radChart.PlotArea.XAxis.AxisLabel.Appearance.Position.X = 200
            radChart.PlotArea.XAxis.AxisLabel.Appearance.Position.Y = 125

Ideas?
Ves
Telerik team
 answered on 27 Jan 2010
2 answers
196 views
I have created custom control for RadRotator, the functionality of control is like http://demos.telerik.com/aspnet-ajax/rotator/examples/gallery/defaultcs.aspx. I am using RadAjaxManager to show the details section on click of the strip image. But its refreshing the whole page, instead of just refreshing the details section.

It will be highly appreciated if you could provide me the steps or sample code for configuring the RadAjaxManager in custom controls.

I am getting folowing error on the page

 
Message: Sys.ArgumentNullException: Value cannot be null.  
Parameter name: panelsCreated[2]  
 




Thanks
Datta Navatre

Rosen
Telerik team
 answered on 27 Jan 2010
1 answer
74 views
Hi All,

I have developed a custom control (a .cs file not .ascx file) in which I have used a RadRotator. I require a Rich Text ToolTip(consist of an image and some text) on the mouse hover event, on any of the images of the RadRotator. So I have used a RadToolTip.
The radrotator ItemTemplate consists of an image, a RadToolTip and some literal controls.

The problem I am facing is that I am able to see the tool tip correctly in IE 7 but in IE8 it does not appear at all.
Another issue that I am facing is that in Safari browser the ToolTip appears on the top of the browser(irrespective of the rotator position when scrolled).

Has anyone faced such kind of issue??
Any solution or hints will be appreciated.

Thanks.

Regards,
Manoj
Svetlina Anati
Telerik team
 answered on 27 Jan 2010
1 answer
95 views
Which chart versions are compatable with .net 1.1? I am currently using 3.0 and i want to upgrade!
Vladimir Milev
Telerik team
 answered on 27 Jan 2010
7 answers
113 views
Hi there,

I have a Line chart that displays two series. I have AutoLayout set to true. When the maximum values of the series is equal to the maximum label value of the Y axis, I get a flat line at the top of the chart. In theory this is fine, but the line appears cut off, so you only see half of it.

To work around this, I try to set the MaxValue on the YAxis programmatically to the maximum value of the items + 10%. So, if the highest items are 35000, I set MaxValue to 38500. In order for this to work, I also need to set AutoScale to False. However, as soon as I do that, my WebDevServer.exe hangs, and consumes all memory and CPU until it crashes. As soon as I remove the attribute, the page behaves OK, but the chart is cut off again.

You can see a repro scenario in this test project
http://imar.spaanjaars.com/Downloads/Other/TelerikChartIssue2.zip

I am not programmatically setting this attribute, but through markup:

<YAxis MaxValue="700000" > <%--AutoScale="false"--%>

If you add the AutoScale attribute to the YAxis element, the server hangs.

Is there a work around for this? How do I create some "padding" between the actual series line at the top of the PlotArea?

Thanks for looking into this.

Imar
Vladimir Milev
Telerik team
 answered on 27 Jan 2010
1 answer
96 views

Dependant combos on grid

 

Is possible to have dependant combos on a grid that are bound server side?

What I want to happen is somehow rebind the DataSource when another combo box in the grid changes.

So for example Combo A was Continents and Combo B was counties I would want to filter the country list (Combo B) depending on what is selected in the continents (Combo A).  I can’t see any server events that fire upon selecting a combo within a grid.

Note that to further complicate things my columns are dynamically created.  

Any help would be much appreciated!!!
 

Below is a shortened extract of my code:-

protected void uxResults_ItemDataBound(object sender, GridItemEventArgs e)

{

 

  GridDropDownListColumnEditor

 

combo = null;

  editMan = editedItem.EditManager;

  GridDataItem item = (GridDataItem)e.Item;

  if (e.Item is GridEditableItem )

  {

    if ((e.Item as GridEditableItem).IsInEditMode)

    {

      combo = editMan.GetColumnEditor(dr["Column Name"].ToString()) as GridDropDownListColumnEditor;

      combo.DataSource = ApplyFilter(item, combo, dr, ds);

      combo.DataBind();

    }

  }

}

Pavlina
Telerik team
 answered on 27 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?