Telerik Forums
UI for ASP.NET AJAX Forum
14 answers
693 views
Hi all,

I have  RadNumericTextBox with 10 DecimalDigits. I would like to hide any trailing zeros. If value is 0.1456000000, I want to display 0.1456.

Any ideas?
 


Vasil
Telerik team
 answered on 26 Oct 2012
4 answers
70 views
Referring to forum append: http://www.telerik.com/community/forums/aspnet-ajax/grid/gridhtmleditorcolumn---how-to-control-size-in-edit-form.aspx
I'm still learning the grid.  I see how the size of the actual editing control (either the GridHtmlEditorColumn itself or a custom) can be controled.

What I'd like to know is if there's a way to control the area of the surface on which the editor itself opens.

What I mean is, if for example I set the editor height to 600 pixels given the technique outlined above, the editor overflows the bounds of the entire grid.  Under some conditions it could obscure other controls.

Anyway to control this?

Boris
Top achievements
Rank 1
 answered on 26 Oct 2012
1 answer
470 views

I have followed the examples found elsewhere in the forums for adding a radcombobox to a listbox. Now that I have that working, how do I add the items to the control?
In the item template I have the following:

<ItemTemplate>
   <span> <%# DataBinder.Eval(Container, "Text")%>
   <telerik:RadComboBox ID="radTimeClockIDs" runat="server" CausesValidation="False">
    <Items>
        <telerik:RadComboBoxItem Text="1" Value="1"/>
        <telerik:RadComboBoxItem Text="2" Value="2"/>
    </Items>
   </telerik:RadComboBox>
   </span>
</ItemTemplate>

In the codebehind, I am adding items to the radlistbox, but they do not appear. I suspect that is because of the item template.

Now that I have the template in place, how do I add list items programmatically? Also, preliminarily I simply placed some items in the RadComboBox that is displayed. However, I will need to be able to put different items in the combobox based on the item that is placed as the list item.

My specific scenario requires a list of items that can be checked so the information can be supplied to a database function, however, each of the items that will populate the list will have a secondary value that is part of a configuration setting. The possible configuration values should appear in the RadComboBox, but each combobox may hold different values.
Essentially it will be three columns in the listbox. One with a checkbox, one with a text value and one with a combobox that is filled based on the text value in the listitem.

Is that possible with this control? If not, is there a better solution?

Thanks!

Nencho
Telerik team
 answered on 26 Oct 2012
4 answers
499 views
hi guys (and telerik)

i am creating a custom skin based on the instruction from this page: http://www.telerik.com/help/aspnet-ajax/grdcreatingnewskins.html

it references another page: http://demos.telerik.com/aspnet-ajax/grid/examples/styles/customskin/defaultcs.aspx

where you can get the full CSS for the grid; however the CSS in the example is for the calendar?!

anybody have the CSS for the RadGrid (any of the skins) that i can manipulate?

Cheers
Galin
Telerik team
 answered on 26 Oct 2012
6 answers
121 views
Dear Supporter,

I've just started using Telerik, I could achieve a few things very nicely, but now I've run into a strange problem.
I'm trying to bind a grid to a hierarchical structure of business objects. I've set up the NeedDataSource event handler and even the DetailTableDataBind, and with the HierarchyDefaultExpanded = true parameter the hierarchy displays in the grid just as I need, the problem comes when the detail tables get collapsed and expanded again.

The code behind for a simple RadGrid (with 'RadGrid1' name):

public partial class Default : System.Web.UI.Page
{
    public class Customer
    {
        public int id { get; set; }
        public string name { get; set; }
        public string city { get; set; }
        public List<Contact> Contacts { get; set; }
    }
 
    public class Contact
    {
        public int id { get; set; }
        public string name { get; set; }
        public string email { get; set; }
    }
 
    public static List<Customer> Customers = new List<Customer> {
        new Customer() { id = 1, name = "Bridget", city = "New York", Contacts = new List<Contact>() {
                new Contact() { id = 1, name = "John", email = "johnny@hotmail.com" },
                new Contact() { id = 2, name = "Mark", email = "mark@hotmail.com" }
            }
        },
        new Customer() { id = 2, name = "Carol", city = "London", Contacts = new List<Contact>() {
                new Contact() { id = 1, name = "Henry", email = "henry@hotmail.com" },
                new Contact() { id = 2, name = "Hugo", email = "hugo@hotmail.com" },
            }
        }
    };
 
    void RadGrid1_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
    {
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
        e.DetailTableView.DataSource = ((Customer)dataItem.DataItem).Contacts;
    }
 
    void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        if (!e.IsFromDetailTable)
            RadGrid1.DataSource = Customers;
    }
 
    protected void Page_Init(object sender, EventArgs e)
    {
        RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
        RadGrid1.DetailTableDataBind += RadGrid1_DetailTableDataBind;
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
            RadGrid1.MasterTableView.AutoGenerateColumns = true;
 
            RadGrid1.MasterTableView.DataKeyNames = new string[] { "id" };
 
            GridTableView contactsTable = new GridTableView(RadGrid1);
            contactsTable.AutoGenerateColumns = true;
 
            RadGrid1.MasterTableView.DetailTables.Add(contactsTable);
        }
    }
}


When I collapse a detail table (by clicking on the expand/collapse button at the left side of the master row) and when I try to expand that again, the DetailsTableDataBind event handler throws an exception, because it doesn't receive the real business object (of the master row) which would contain the needed Contacts child list (the dataItem.DataItem in  RadGrid1_DetailTableDataBind event handler is null after the collapse+expand action, but at first render it contains the needed Customer object as needed).

I have no more idea about the issue and I searched over the forum and googled a lot, but I always find solutions which binds to dataset or sqldatasources, but in our case custom classes is the only option.
I don't think I'm doing everything badly because the grid in full expanded mode displays correctly, only after collapse+expand the child table disappears (actually I think the master row's datasource is lost somewhere).

The pasted sample is a simplified version of our current situation, but it reflects my problem.
Btw. I was using RadControls for ASP.NET AJAX Q2 2012 SP2, Bin40 assemblies, 2012.2.912.40 versions.

Any help would be appreciated.


Regards,
Dexx
Andrey
Telerik team
 answered on 26 Oct 2012
3 answers
118 views

Folks,

Using VS 2010 with RadControls for ASP.NET AJAX Q3 2012. I am using below link as a prototype.

http://demos.telerik.com/aspnet-ajax/editor/examples/edittemplate/defaultcs.aspx

Attached is my Grid and I would like export only the Selected Row Rad Editor content to PDF in i a new window.  below is is my complete radgrid declaration.

Any help is appreciated.

Thanks

gc_0620

______________
<form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All"
        EnableRoundedCorners="false" />
    <telerik:RadGrid ID="MyDataGrid" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
        AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
        AutoGenerateEditColumn="True" AutoGenerateDeleteColumn="True" CellSpacing="0"
        GridLines="None" AllowFilteringByColumn="True" AllowSorting="True">
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <MasterTableView DataKeyNames="ID" CommandItemDisplay="Top">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridTemplateColumn UniqueName="ID" Display="false">
                    <ItemTemplate>
                        <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="Content">
                    <ItemTemplate>
                        <asp:Label ID="lblField1" CssClass="text" runat="server" Text='<%# Eval("Content") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadEditor ID="RadEditorEdit" SkinID="DefaultSetOfTools" ContentFilters="DefaultFilters,PdfExportFilter"
                            runat="server" content='<%# Bind("Content") %>'>
                            <ExportSettings OpenInNewWindow="true">
                            </ExportSettings>
                        </telerik:RadEditor>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <telerik:RadEditor ID="RadEditorEdit" runat="server" SkinID="DefaultSetOfTools" ContentFilters="DefaultFilters,PdfExportFilter"
                            content='<%# Bind("Content") %>'>
                            <ExportSettings OpenInNewWindow="true">
                            </ExportSettings>
                        </telerik:RadEditor>
                    </InsertItemTemplate>
                </telerik:GridTemplateColumn>
 
                <telerik:GridTemplateColumn UniqueName="Export">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" OnClick="Button1_Click" runat="server" Text="PDF Export"></asp:LinkButton>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                 
            </Columns>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString2 %>"
        SelectCommand="SELECT [ID], [Content] FROM [BlogPosts]" UpdateCommand="UPDATE [BlogPosts] SET [Content] = @Content WHERE [ID] = @ID"
        DeleteCommand="DELETE FROM [BlogPosts] WHERE [ID] = @ID" InsertCommand="INSERT INTO [BlogPosts] ([PublishDate], [Category], [Title], [Content]) VALUES (GETDATE(), 'Foo', 'Bar',@Content)">
        <DeleteParameters>
            <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Content" Type="String"></asp:Parameter>
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="Content" Type="String"></asp:Parameter>
            <asp:Parameter Name="ID" Type="Int32"></asp:Parameter>
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>

Rumen
Telerik team
 answered on 26 Oct 2012
4 answers
127 views
Hello,
I'm using FileExplorer with a custom DB content provider, and everything works beautifully with one small exception:  When I add directory items and do a refresh, the new child directories do not appear in the treeview, although they are correctly returned and displayed in the grid.  I have tried all manner of suggestions found in the forums here, but with no satisfaction.  The only thing that gets the new directories to display is a full refresh of the page containing the FileExplorer.  I am using version 2010.1.519.20 of the controls.  Any assistance would be appreciated.

--Derek Snyder
Rohan
Top achievements
Rank 1
 answered on 26 Oct 2012
3 answers
75 views

I have following code. 

1.  What I want to achieve is, to keep updating label2 as program statements proceeds eg.  "Loading,.... ", "Connecting....."
"Applying Changes......"   "Done..".   The Idea is to keep user inform about the current status , when processing takes longer time.

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Telerik" >
<asp:Label ID="Label2" runat="server" ForeColor="Red">Loading... </asp:Label>
<asp:Image ID="Image1" runat="server" Width="224px" Height="48px" ImageUrl="~/Loading.gif">
</asp:Image>
</telerik:RadAjaxLoadingPanel>

Following is my code behind.

protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
     {
         Label2.Text = "Connecting to Source";
  .........  Long code to retrieve data from DB into UC datasource.
         RadGrid1.DataSource = uc;
         Label2.Text = "Apply Results.";
     }


But this does not seem to work...... Is there a better workarond ?


-JD

Vasil
Telerik team
 answered on 26 Oct 2012
3 answers
71 views
Hi,

I have use radsplitter in my page .I have three radpane right left and center .Width for left and right is assigned but middle pane adjust its width accordingly.But whenever page load it flicker which is irratating.Please providee solution for this
Vessy
Telerik team
 answered on 26 Oct 2012
2 answers
189 views
I've got a radEditor in a form template of a radGrid editor. I had a problem with the size of the radEditor when it displays the first time, so on the advice of another forum post I added the following to my master page.
<telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server">
    <StyleSheets>
        <telerik:StyleSheetReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Skins.Editor.css" />
        <telerik:StyleSheetReference Assembly="Telerik.Web.UI.Skins" Name="Telerik.Web.UI.Skins.WebBlue.Editor.WebBlue.css" />
        <telerik:StyleSheetReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Skins.Window.css" />
        <telerik:StyleSheetReference Assembly="Telerik.Web.UI.Skins" Name="Telerik.Web.UI.Skins.WebBlue.Window.WebBlue.css" />
    </StyleSheets>
</telerik:RadStyleSheetManager>

This worked fine on my desktop at work, but on my laptap I get the following error:
 

Server Error in '/Workforce' Application.

Object reference not set to an instance of an object.

Description: 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.NullReferenceException: Object reference not set to an instance of an object.

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:

[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Web.UI.RadStyleSheetManager.GetIsValidScriptEntry(ScriptEntry scriptEntry) +20 Telerik.Web.UI.RadStyleSheetManager.RegisterValidStyleSheets(IList`1 styleSheets) +112 Telerik.Web.UI.RadStyleSheetManager.Page_PreRenderComplete(Object sender, EventArgs e) +114 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +9010682 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2716 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

Work computer is currently on Q2 2012 version and laptop is on Q3 2013. The only other difference I can find is that at work the referenced dlls are in my projects /Bin folder, and at home they are referenced from the GAC. Is there a problem with the StyleSheetManager finding dlls that are in the GAC?
Dimitar Terziev
Telerik team
 answered on 26 Oct 2012
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?