Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
180 views
Hi, I am using a RadCombobox to display a list of values from a DB. i want to display two columns separated by a '-' as the Text so i used 
this:
<telerik:RadComboBox runat="server" ID="tlkBiennium" EmptyMessage="select a biennium from the list" Filter="Contains" Width="200" AppendDataBoundItems="true" DataValueField="BienniumId">
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td><%# DataBinder.Eval(Container.DataItem,"StartYear") %></td>
                                <td>-</td>
                                <td><%# DataBinder.Eval(Container.DataItem,"EndYear") %></td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </telerik:RadComboBox>

in the code behind:
if(!IsPostBack){
    tlkBiennium.DataSource = container.Bienniums.ToList();
    tlkBiennium.DataBind();
}

the items are displayed properly however when  select one, I get the name of the class in the combobox. 
can someone tell me what i am doing wrong?
thanks
ck
Top achievements
Rank 1
 asked on 29 Apr 2013
2 answers
159 views
Hi, I've searched and found similar topics but I'm seeing some unusual behaviour. For reference I am using 2013Q1 and have access to the latest version.

I know the fundamentals behind hiding the classes by pointing to an external empty css stylesheet or adding a blank class CssClasses.Add("", "") etc.

This doesn't work however because I want to hide the Apply Class dropdown list on the main editor toolbar (deleted from toolsfile), the add blank class doesn't work when it is omitted, as soon as I put it on the main editor the Apply Class dropdown list clears in the hyperlink manager.

I can leave the dropdown on the main toolbar if necessary, and that is what I am doing at the moment but was wondering if I could get access to add a blank style to the Apply Class dropdown list on the hyperlink manager without having to add it to the main editor toolbar?

Additionally I'd like to not map external templates if possible.

Thanks for any pointers,
John C.
John Colclough
Top achievements
Rank 1
 answered on 29 Apr 2013
2 answers
82 views

Recently our QA team assigned the issue to me. Cursor is blinking over tooltip in the IE10 (and older versions of the Internet Explorer.   

I am able to recreated the issue in the Telerik online examples, here http://demos.telerik.com/aspnet-ajax/tooltip/examples/waiariasupport/defaultcs.aspx

See attached image.

However there is no such issue in the Fire Fox or Google Chrome.

Any solutions for the problem?

Ruben Markosyan
Top achievements
Rank 1
 answered on 29 Apr 2013
4 answers
145 views
hello
 i want to display the bars on same chart with different color ,i tried many ways it's not working.....
Gokul
Top achievements
Rank 1
 answered on 29 Apr 2013
1 answer
100 views
I'm using version 2013.1.417.40 demo mode of the RadEditor. If I change the font in the middle of a line and start typing the new font works. When I press Enter to start a new line, the font reverts back. Is there a way to configure the editor to "carry" the font to the new line? I'm using IE10 on Win7. Thanks.
Misho
Telerik team
 answered on 29 Apr 2013
3 answers
135 views
I'm using External Edit in RadDock BUT I'm using EntityDataSources rather than SessionDataSources. On editing an appointment with my custom form (in the RadDock) the database is correctly updated but the RadScheduler is redrawn before the data update so it appears not to update on the page.
  • I've checked with Firebug and it definitely does make the ajax call and redraw with the pre-edit data, thus the problem is not that the AjaxManager fails to call (which was my first thought).
  • If I click on the today link (or in any way cause the RadScheduler to redraw again) all is well, the data is correctly displayed.
  • Immediately after editing the appointment the context menu (on the edited appointment only) fails, i.e. no longer comes up with the custom (EDIT and DELETE) but right click shows the browser's context menu. (Hovering on the appointment at this point gives a javascript error that l is null in this)
    var k=(l._allowDelete!=null)?l.get_allowDelete():this.get_allowDelete();
    Again a reload fixes this.
  • Drag and drop works
  • Delete works
  • Completely removing the RadAjaxManager (so the whole page reloads) does not change the behavior, still getting the pre-edit data back and the context menu problem.

Any Ideas?

Boyan Dimitrov
Telerik team
 answered on 29 Apr 2013
9 answers
277 views
Dear All,

I am using Telerik RAD Grid in my ASP.NET Application. The aspx form has more control so vertical scroll is enabled. when RAD Grid is in bottom or due to more data in the grid, current position of the form is at the bottom with scrolled down. if I add new item to grid, Edit Form is not visible, since it is appearing at the top of the form which is not in visible to user. 
The code I used for EditFOrm Popup is given below.

popUp = eventArgs.get_popUp();
popUp.style.position = "fixed";
var gridWidth = sender.get_element().offsetWidth - 100;
var gridHeight = sender.get_element().offsetHeight + 400;
var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
popUp.style.left = ((gridWidth) / 2 + sender.get_element().offsetLeft).toString() + "px";
popUp.style.top = ((gridHeight) / 2 + sender.get_element().offsetTop).toString() + "px";



I tried with the following code which is not working in RAD Windows (My form is part of RAD Windows and appear like modal popup) and in normal form also it is misbehaving.

var myWidth = 0, myHeight = 0;
if (typeof (window.innerWidth) == 'number')
{
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
}
else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
{
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
}
else if (document.body && (document.body.clientWidth || document.body.clientHeight))
{
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
}
 
popUp = eventArgs.get_popUp();
popUp.style.position = "fixed";
var gridWidth = myWidth;
var gridHeight = myHeight;
var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
popUp.style.left = ((gridWidth - popUpWidth) / 2) + "px";
popUp.style.top = ((gridHeight - popUpHeight) / 2) + "px";

Kindly Requesting your guidance on the same.


With Regards
Palanivelrajan.L
Angel Petrov
Telerik team
 answered on 29 Apr 2013
6 answers
345 views
Hi,

I have a grid doing an inline update to a stored procedure.  But I do not know how to get the value of the grid column passed as a parmater to the stored procedure using VS12 VB aspx.   Here is partial code.

           <telerik:RadGrid ID="dgPlans" GridLines="None" runat="server" AllowAutomaticDeletes="True"
              AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True"
              AutoGenerateColumns="False" CellSpacing="0" Width="716px" DataSourceID="sqlPlans"  

        <telerik:GridDropDownColumn DataField="PlanId" DataSourceID="sqlGetPlans"
            HeaderText="Plan" ListTextField="ippPlan" ListValueField="PlanId"
            UniqueName="ippPlanId" ColumnEditorID="GridDropDownColumnEditor1">
        </telerik:GridDropDownColumn>
    

            UpdateCommand="sp_Update_Plan" UpdateCommandType="StoredProcedure"

            <UpdateParameters>
                <asp:Parameter Name="EffectiveDate" Type="Datetime"></asp:Parameter>
                <asp:Parameter Name="ExpirationDate" Type="Datetime"></asp:Parameter>
                <asp:Parameter Name="Split" Type="Decimal"></asp:Parameter>
                <asp:Parameter Name="Level" Type="String"></asp:Parameter>
                <asp:Parameter Name="PlanId" Type="Int32"></asp:Parameter>
            </UpdateParameters>

Like I said the stored procedure name on my SQL box is sp_Update_Plan and it takes several params.  But what is used as the @ piece of the parameter? What part of the radgrid become the @piece to pass to my SP? The uniquename? The Datafield has to match the @parameter?

All the examples I have seen just have the SQL statement in the updatecommand I need to use as stored procedure.

thanks,

 


 

Maria Ilieva
Telerik team
 answered on 29 Apr 2013
5 answers
149 views
Hi,
I would like to set RowHeader cells' width individually. I use below code;
<telerik:PivotGridRowField DataField="INVENTSITE" Caption="Üretim Mer.">
                            <CellStyle Width="105" />
</telerik:PivotGridRowField>
But it seems this does not effect, somehow rendered output overwrites width value. I can see the cell property like style="width:105px;" with FireBug but computed values are different, actually wider. I need to fix this problem, because I have a cell that needs to be wider so that text inside this cell can be read. Please refer to attached image to see the problem. For example I set cell (line #1) width to 100px and cell (line #2) to 200px (so the text can be read) but no way. All my data and layout is as seen. How can I fix this problem?

TIA
Maria Ilieva
Telerik team
 answered on 29 Apr 2013
1 answer
137 views
Hi
i have question when i change from C# to vb  in default.aspx   the loaded control in content work but the problem  if i sort the datagrid its disappear ,same code for c# work Fine sort grid filtering .... ,  but when translate to vb this problem come ,  so i thing problem here when i make translation to vb



 C# Code
using System;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using Telerik.Web.UI;
using Telerik.Web.UI.Calendar;
 

public partial class _Default : Page, IViewSelector
{
    private const string ViewsFolder = "~/Views/";
    private const string DefaultContentControl = "Statistics.ascx";

    private string LoadedControlName
    {
        get
        {
            return (string)ViewState["LoadedControlName"] ?? DefaultContentControl;
        }

        set
        {
            ViewState["LoadedControlName"] = value;
        }
    }

    private int EmployeeID
    {
       

        get
        {
            if (Session["EmployeeID"] == null)
            {
                Session["EmployeeID"] = 1;
            }

            return (int) Session["EmployeeID"];
        }
        set
        {
            Session["EmployeeID"] = value;
        }
    }

    private DateTime StartDate
    {
        get
        {
            return StartDatePicker.SelectedDate.Value;
        }
    }

    private DateTime EndDate
    {
        get
        {
            return EndDatePicker.SelectedDate.Value;
        }
    }

    

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            EmployeesListView.Rebind();
            EmployeesListView.SelectedIndexes.Add(0);
        }
        LoadContent();
    }

    public void SelectView(string viewName)
    {
        var tab = ViewChooser.Tabs.FindTabByText(viewName);
        if (tab != null)
            tab.Selected = true;

        UpdateSelectedView();
    }

    protected void ViewChooser_TabClick(object sender, RadTabStripEventArgs e)
    {
        UpdateSelectedView();
    }

    private void LoadContent()
    {
        var control = LoadControl(ViewsFolder + LoadedControlName);
        control.ID = "contentControl";
        var contentControl = control as IContentControl;

        if (contentControl != null)
        {
            contentControl.EmployeeID = EmployeeID; // from ListView
            contentControl.StartDate = StartDate;
            contentControl.EndDate = EndDate;
        }

        var userDetailsPanel = (UserDetails) as IContentControl;
        userDetailsPanel.EmployeeID = EmployeeID;
        userDetailsPanel.StartDate = StartDate;
        userDetailsPanel.EndDate = EndDate;

        Content.Controls.Clear();
        Content.Controls.Add(control);
    }

    protected void UpdateSelectedView()
    {
        string selectedControl = ViewChooser.SelectedTab.Value;
        if (selectedControl != LoadedControlName)
        {
            LoadedControlName = selectedControl;
            LoadContent();
        }
    }

    public string GetSalesPercentage(int employeeID)
    {

        var empSales = 222;
        return (empSales * 100).ToString("F0");
    }

    protected void PagerSlider_ValueChanged(object sender, EventArgs e)
    {
        string newValue = (sender as RadSlider).Value.ToString();
        EmployeesListView.Items[0].FireCommandEvent(RadListView.PageCommandName, newValue);
    }

    protected void EmployeesListView_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
    {
       
    }

    protected void EmployeesListView_SelectedIndexChanged(object sender, EventArgs eventArgs)
    {
        EmployeeID = int.Parse(EmployeesListView.SelectedValue.ToString());     
        LoadContent();
        ScriptManager.RegisterStartupScript(Page, typeof(Page), "hide", "HideLoadingPanel()", true);
    }

    protected override void OnPreRenderComplete(EventArgs e)
    {
        base.OnPreRenderComplete(e);

        // Make the EmployeeID available to scripts
        ScriptManager.RegisterStartupScript(Page, typeof(Page), "employeeID" ,
            "function getEmployeeID()    { return " + EmployeeID + "; }", true);
    }

    protected void SelectedDataChanged(object sender, SelectedDateChangedEventArgs e)
    {
        LoadContent();
    }
}






VB Code

Imports System.Configuration
Imports System.Data.SqlClient
Imports System.Linq
Imports System.Web.UI
Imports System.Web.UI.WebControls

Imports Telerik.Web.UI
Imports Telerik.Web.UI.Calendar
Partial Class Default3
    Inherits Page
    Implements IViewSelector
    Private Const ViewsFolder As String = "~/Views/"
    Private Const DefaultContentControl As String = "Statistics.ascx"

    Private Property LoadedControlName() As String
        Get
            Return If(DirectCast(ViewState("LoadedControlName"), String), DefaultContentControl)
        End Get

        Set(value As String)
            ViewState("LoadedControlName") = value
        End Set
    End Property

    Private Property EmployeeID() As Integer


        Get
            If Session("EmployeeID") Is Nothing Then
                Session("EmployeeID") = 1
            End If

            Return CInt(Session("EmployeeID"))
        End Get
        Set(value As Integer)
            Session("EmployeeID") = value
        End Set
    End Property

    Private ReadOnly Property StartDate() As DateTime
        Get
            Return StartDatePicker.SelectedDate.Value
        End Get
    End Property

    Private ReadOnly Property EndDate() As DateTime
        Get
            Return EndDatePicker.SelectedDate.Value
        End Get
    End Property



    Protected Sub Page_Load(sender As Object, e As EventArgs)
        If Not IsPostBack Then
            EmployeesListView.Rebind()
            EmployeesListView.SelectedIndexes.Add(0)
        End If
        LoadContent()
    End Sub

    Public Sub SelectView(viewName As String)
        Dim tab = ViewChooser.Tabs.FindTabByText(viewName)
        If tab IsNot Nothing Then
            tab.Selected = True
        End If

        UpdateSelectedView()
    End Sub

    Protected Sub ViewChooser_TabClick(sender As Object, e As RadTabStripEventArgs)
        UpdateSelectedView()
    End Sub

    Private Sub LoadContent()
        Dim control = LoadControl(ViewsFolder & LoadedControlName)
        control.ID = "contentControl"
        Dim contentControl = TryCast(control, IContentControl)

        If contentControl IsNot Nothing Then
            contentControl.EmployeeID = EmployeeID
            ' from ListView
            contentControl.StartDate = StartDate
            contentControl.EndDate = EndDate
        End If

        Dim userDetailsPanel = TryCast(UserDetails, IContentControl)
        userDetailsPanel.EmployeeID = EmployeeID
        userDetailsPanel.StartDate = StartDate
        userDetailsPanel.EndDate = EndDate

        Content.Controls.Clear()
        Content.Controls.Add(control)
    End Sub

    Protected Sub UpdateSelectedView()
        Dim selectedControl As String = ViewChooser.SelectedTab.Value
        If selectedControl <> LoadedControlName Then
            LoadedControlName = selectedControl
            LoadContent()
        End If
    End Sub

    Public Function GetSalesPercentage(employeeID As Integer) As String

        Dim empSales = 222
        Return (empSales * 100).ToString("F0")
    End Function

    Protected Sub PagerSlider_ValueChanged(sender As Object, e As EventArgs)
        Dim newValue As String = TryCast(sender, RadSlider).Value.ToString()
        EmployeesListView.Items(0).FireCommandEvent(RadListView.PageCommandName, newValue)
    End Sub

    Protected Sub EmployeesListView_NeedDataSource(sender As Object, e As RadListViewNeedDataSourceEventArgs)

    End Sub

    Protected Sub EmployeesListView_SelectedIndexChanged(sender As Object, eventArgs As EventArgs)
        EmployeeID = Integer.Parse(EmployeesListView.SelectedValue.ToString())
        LoadContent()
        ScriptManager.RegisterStartupScript(Page, GetType(Page), "hide", "HideLoadingPanel()", True)
    End Sub

    Protected Overrides Sub OnPreRenderComplete(e As EventArgs)
        MyBase.OnPreRenderComplete(e)

        ' Make the EmployeeID available to scripts
        ScriptManager.RegisterStartupScript(Page, GetType(Page), "employeeID", "function getEmployeeID()" & vbTab & "{ return " & EmployeeID & "; }", True)
    End Sub

    Protected Sub SelectedDataChanged(sender As Object, e As SelectedDateChangedEventArgs)
        LoadContent()
    End Sub

End Class








error message :
  1.  Error    5    Overload resolution failed because no accessible 'Int' accepts this number of arguments.    C:\Users\Administrator\Documents\Visual Studio 2010\WebSites\abc\Default3.aspx    
  2. Error    7    Class 'Default3' must implement 'Sub SelectView(viewName As String)' for interface 'IViewSelector'.    C:\Users\Administrator\Documents\Visual Studio 2010\WebSites\abc\Default3.aspx.vb   

so what i did

  1. replace  int by  integer .....so problem solved
  2. replace   Public Sub SelectView(viewName As String)    by         Public Sub SelectView(viewName As String)   Implements IViewSelector.SelectView         .....so problem solved

but problem explained above occur, any suggestion ?...sorry for stretching

Maria Ilieva
Telerik team
 answered on 29 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?