Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
300 views
I have a telerik:RadGrid with inline editing using a user control.  The problem is that the user control when examined from inside the OnEditCommand event is always null; although a trace of the asp.net page shows that the controls are rendered.

My Radgrid definition:
<telerik:RadGrid runat="server" AllowPaging="True" ID="grdSPFilters" OnNeedDataSource="grdSPFilters_NeedDataSource"
                        Width="350px" OnRowDrop="grdSPFilters_RowDrop" AllowMultiRowSelection="false"
                        OnEditCommand="grdSPFilters_EditCommand" AutoGenerateColumns="false">

My Radgrid edit area definition:
<EditFormSettings UserControlName="FilterMatchRuleBuilder.ascx" EditFormType="WebUserControl">
                                <EditColumn UniqueName="FilterMatchRuleBuilder01">
                                </EditColumn>
 </EditFormSettings>

My event:
public void grdSPFilters_EditCommand(object sender, GridCommandEventArgs e)
 {
    // snip...
    GridDataItem item = (GridDataItem)e.Item;
   FilterMatchRuleBuilder frb = item.FindControl("FilterMatchRuleBuilder01") as FilterMatchRuleBuilder;

the problem is here - the item.Findcontrol never finds my user control.  I've tried enumerating through the entire item.Controls collection and no user controls exist.  Although a trace of the asp.NET page shows the user control has been rendered.  What is happening here?  All the Telerik articles I've seen demonstrate that you simply use an item.Findcontrol; however that simply does not work.

Another thing that doesn't make sense.  Inside my grdSPFilters_EditCommand method e.Item.IsInEditMode is always equal to false.
Geoff Ballard
Top achievements
Rank 1
 answered on 27 Feb 2013
1 answer
115 views
hi .i use RadSplitter in my masterpage and create mywebform by master page
but i have a problem with this commponent
i can use this but in run time i have problem and the problem is contentplaceholder in mywebform has merged by the footer of page and i cant use it in seperated window.
I've attached a picture to better understand the problem.
Please help.
MasterPge:
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs" Inherits="Automation.Main" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
    <link href="Styles/CssReset.css" rel="stylesheet" />
</head>
<body >
    <form ids="form1" runat="server">
       <telerik:RadScriptManager runat="server" ID="RadScriptManager1"></telerik:RadScriptManager>
        <div class="header">
            <h1>Your Name Here</h1>
            <h2>My Personal Site</h2>
         
            <div class="menua">
            </div>
        </div>
        <div class="context" >
         
            <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%">
            <telerik:RadPane runat="server" ID="RadPane1" Width="70%">
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                      </asp:ContentPlaceHolder>
            </telerik:RadPane>
            <telerik:RadSplitBar runat="server" ID="RadSplitbar1" CollapseMode="Backward" />
            <telerik:RadPane runat="server" ID="Radpane2" Width="330px">
            </telerik:RadPane>
        </telerik:RadSplitter>
           
        </div>
        <div class="footerbg">
            <div class="footer">
            </div>
        </div>
 
    </form>
</body>
</html>

Webform:
<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="Automation.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="content">
            <h3>Request an Account</h3>
            <p>Accounts will be activated pending the approval of the Administrator.</p>
            
        </div>
</asp:Content>

Dobromir
Telerik team
 answered on 27 Feb 2013
1 answer
92 views

I'm using a RadHtmlChart based on HTML5 from telerik. I'm using a Pie Chart, and I want to display the method's values. How should I save the values -- maybe as a list? It shouldn't have a big impact on the method itself, because I need this method for some report stuff.

public double GetBookedVacation(int year)
{
    int counter = 0;
    if (this.AnnualVacations.Any())
    {
        foreach (HtVacationDay vacationDay in HtVacationDays)
        {
            foreach (DateTime vacationDayDate in vacationDay.GetDates())
            {
                if (vacationDayDate.Year == year)
                {
                    counter++;
                }
            }
        }
    }
    return counter;
}

Thanks for help and fast answer.

Danail Vasilev
Telerik team
 answered on 27 Feb 2013
5 answers
135 views
hi I want to update a radgrid when my radwindow is closed. This demo suggest to use ajaxmanager in the page, but my ajaxmanager is actually in the master page. In my case is it still possible to update the grid on radwindow close?

please help
thanks in advance
Angel Petrov
Telerik team
 answered on 27 Feb 2013
14 answers
1.4K+ views
Hello,

I have to use asp:UpdatePanel in one part of my application. Is it still possible to show the telerik loading panel when it updates?
Unfortunately I couldn't find anything about it.

Thanks in advance.
Rob
Top achievements
Rank 1
 answered on 27 Feb 2013
1 answer
66 views
I just posted an Excel export solution to the pivot grid forum under the same title. You MAY want to have a look at it.
Kostadin
Telerik team
 answered on 27 Feb 2013
4 answers
214 views
I have a RadTextBox on the screen and I am trying to customize the label as illustrated in .http://www.telerik.com/help/aspnet-ajax/input-adding-labels.html.  I'm not sure I understand what I'm seeing.

It looks to me like some but not all aspects of the css class are being implemented in the box label.  I can set colors but so far I have been unable to set the font size or boldness. 

Suggestions?
Boris
Top achievements
Rank 1
 answered on 27 Feb 2013
3 answers
178 views
Hi,

I am trying to add a custom HeaderContextMenu item and handle the ItemClick.

Here is my code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    GridCGSI_UpdateDefaults(RadGrid1)
 
    AddHandler RadGrid1.HeaderContextMenu.PreRender, AddressOf HeaderContextMenu_PreRender
    AddHandler RadGrid1.HeaderContextMenu.ItemClick, AddressOf HeaderContextMenu_ItemClick
End Sub
 
Protected Sub HeaderContextMenu_PreRender(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim menu As RadContextMenu = RadGrid1.HeaderContextMenu
    Dim separator As New RadMenuItem()
    Dim item As New RadMenuItem()
 
    separator.IsSeparator = True
    menu.Items.Add(separator)
 
    item.Text = "Save settings"
    item.Value = "SaveSettings"
    item.PostBack = True
    menu.Items.Add(item)
End Sub
 
Protected Sub HeaderContextMenu_ItemClick(ByVal sender As Object, ByVal e As RadMenuEventArgs)
 
End Sub
 
Public Sub GridCGSI_UpdateDefaults(ByVal tmpGrid As RadGrid)
 
    tmpGrid.CellSpacing = "0"
    tmpGrid.AutoGenerateColumns = False
    tmpGrid.AllowPaging = True
    tmpGrid.PageSize = 40
    tmpGrid.AllowSorting = True
 
    tmpGrid.GridLines = GridLines.None
 
    tmpGrid.AllowFilteringByColumn = True
    tmpGrid.EnableHeaderContextMenu = True
    tmpGrid.ShowStatusBar = True
 
    tmpGrid.HeaderContextMenu.Enabled = True
    tmpGrid.MasterTableView.SortExpressions.AllowNaturalSort = False
    tmpGrid.AllowMultiRowEdit = False
 
End Sub

My problem is when I click on my custom item "Save settings" it shows me an asp error of a NullReferenceException:

[NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.]
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +147
   System.Web.UI.Page.FindControl(String id) +38
   Telerik.Web.UI.RadGrid.headerContextMenu_ItemClick(Object sender, RadMenuEventArgs e) +242
   Telerik.Web.UI.RadMenuEventHandler.Invoke(Object sender, RadMenuEventArgs e) +0
   Telerik.Web.UI.RadMenu.RaiseMenuItemEvent(Object eventKey, RadMenuEventArgs e) +123
   Telerik.Web.UI.RadMenu.OnItemClick(RadMenuEventArgs e) +42
   Telerik.Web.UI.RadMenu.RaiseItemClick(ControlItem item) +102
   Telerik.Web.UI.RadMenu.RaisePostBackEvent(String nodeIndex) +73
   Telerik.Web.UI.RadMenu.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String nodeIndex) +39
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Why this is happening?

Thanks.
Jocelyn
Top achievements
Rank 1
 answered on 27 Feb 2013
5 answers
303 views
Hi,

I am trying to deploy VS 2012 Pro and Telerik Dev UI using SCCM 2012.

Is there a commandline syntax for custom install dir. I want to install it to D: instead of normal c:\Program FilesXXXX.

Also will it work for other Dev UI Tools?

Regards

VJ
Vesko
Telerik team
 answered on 27 Feb 2013
3 answers
267 views
    I have a RadGrid with GridNumericColumn. The culture of page is "es-ES" and collate of SQL Server Database is "Modern_Spanish_CI_AI".

    In Spain decimal separator is "," and group separator is ".". RadGrid use culture "es-ES" in ViewMode, but in edit mode I belive that it use default culture.

    For example, in database i have stored the value "0,22" (this value is < 1 and >0, zero comma twenty two) (Sql server datatype => float, equivalent to double in .NET framework). Now:
  • In ViewMode: appear "0,22" (zero comma twenty two), but
  • In EditMode: appear "22" (twenty two)
Note: RadGrid use a SqlDataSource standard.

<telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server">   
            <NumericTextBox runat="server"
                <NumberFormat DecimalSeparator="," GroupSeparator="." />  
            </NumericTextBox>  
        </telerik:GridNumericColumnEditor>  
         
       <telerik:RadGrid ID="RadGrid1"  DataSourceID="SqlDataSource1" AllowMultiRowSelection="True" AllowMultiRowEdit="True" 
        Skin="Web20" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
        Width="99%" AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False" GridLines="None" OnItemDataBound="RadGrid1_ItemDataBound" > 
            <PagerStyle Mode="Slider" /> 
               
                <ClientSettings> 
                    <Selecting AllowRowSelect="True" /> 
                    <ClientMessages PagerTooltipFormatString="P&#225;gina: &lt;b&gt;{0}&lt;/b&gt; de &lt;b&gt;{1}&lt;/b&gt;" /> 
                </ClientSettings> 
            <MasterTableView CommandItemDisplay="Top" DataKeyNames="ID_MATERIAL" DataSourceID="SqlDataSource1" EditMode="InPlace"
                <ExpandCollapseColumn Resizable="False" Visible="False"
                    <HeaderStyle Width="20px" /> 
                </ExpandCollapseColumn> 
                <RowIndicatorColumn Visible="False"
                    <HeaderStyle Width="20px" /> 
                </RowIndicatorColumn> 
                <Columns> 
                    .... 
 
                    <telerik:GridNumericColumn DataType="System.Double" ColumnEditorID="GridNumericColumnEditor1" NumericType="Number" DataField="NUM_CONDUCTIVIDAD" HeaderText="Conductividad" 
                        SortExpression="NUM_CONDUCTIVIDAD" UniqueName="NUM_CONDUCTIVIDAD" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="10%" > 
                    </telerik:GridNumericColumn> 
...... 
 
 
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Editar" InsertText="Insertar" UpdateText="Actualizar"
                        <HeaderStyle Width="25px" /> 
                    </telerik:GridEditCommandColumn> 
                    <telerik:GridClientDeleteColumn ConfirmText="&#191;Est&#225; seguro?" ButtonType="ImageButton" ImageUrl="~/img/Grid/Delete.gif" Text="Delete" UniqueName="column"
                        <HeaderStyle Width="25px" /> 
                    </telerik:GridClientDeleteColumn> 
                </Columns> 
             
                <EditFormSettings ColumnNumber="2" CaptionDataField="DSC_MATERIAL" CaptionFormatString="Editando &lt;strong&gt;{0}&lt;/strong&gt;"
                    <FormTableItemStyle Wrap="False"></FormTableItemStyle> 
                    <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle> 
                    <FormMainTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" /> 
                    <FormTableStyle CellSpacing="0" CellPadding="2" CssClass="module" BackColor="White" /> 
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle> 
                    <EditColumn ButtonType="ImageButton" 
                        UpdateImageUrl="~\Img\Grid\Update.gif" EditImageUrl="~\Img\Grid\Edit.gif" 
                        InsertImageUrl="~\Img\Grid\Insert.gif" CancelImageUrl="~\Img\Grid\Cancel.gif" 
                        InsertText="Insertar" UpdateText="Actualizar" UniqueName="EditCommandColumn1" CancelText="Cancelar"
                    </EditColumn> 
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle> 
                    <PopUpSettings ScrollBars="None" /> 
                </EditFormSettings> 
             
            </MasterTableView> 
           <FilterItemStyle BackColor="Gainsboro" /> 
                         
        </telerik:RadGrid> 
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:LabLATConnectionString %>" 
        DeleteCommand="DELETE FROM [MATERIAL] WHERE [ID_MATERIAL] = @original_ID_MATERIAL" 
        InsertCommand="INSERT INTO [MATERIAL] ([DSC_MATERIAL], [NUM_CONDUCTIVIDAD], [BOL_ACTIVO], [DSC_USR_UPD], [DAT_UPD]) VALUES (@DSC_MATERIAL, @NUM_CONDUCTIVIDAD, @BOL_ACTIVO, @DSC_USR_UPD, @DAT_UPD)" 
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [ID_MATERIAL], [DSC_MATERIAL], [NUM_CONDUCTIVIDAD], [BOL_ACTIVO], [DSC_USR_UPD], [DAT_UPD] FROM [MATERIAL]" 
        UpdateCommand="UPDATE [MATERIAL] SET [DSC_MATERIAL] = @DSC_MATERIAL, [NUM_CONDUCTIVIDAD] = @NUM_CONDUCTIVIDAD, [BOL_ACTIVO] = @BOL_ACTIVO, [DSC_USR_UPD] = @DSC_USR_UPD, [DAT_UPD] = @DAT_UPD WHERE [ID_MATERIAL] = @original_ID_MATERIAL"
        <DeleteParameters> 
            <asp:Parameter Name="original_ID_MATERIAL" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="DSC_MATERIAL"      Type="String" /> 
            <asp:Parameter Name="NUM_CONDUCTIVIDAD" Type="Double"/> 
            <asp:Parameter Name="BOL_ACTIVO"        Type="Boolean" /> 
            <asp:Parameter Name="DSC_USR_UPD"       Type="String"  /> 
            <asp:Parameter Name="DAT_UPD"           Type="DateTime" /> 
            <asp:Parameter Name="original_ID_MATERIAL" Type="Int32"  /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="DSC_MATERIAL" Type="String" DefaultValue="" /> 
            <asp:Parameter Name="NUM_CONDUCTIVIDAD" Type="Double" /> 
            <asp:Parameter Name="BOL_ACTIVO" Type="Boolean" /> 
            <asp:Parameter Name="DSC_USR_UPD" Type="String"  /> 
            <asp:Parameter Name="DAT_UPD" Type="DateTime"  /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
Eyup
Telerik team
 answered on 27 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?