Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views

Hi,

Would it be possible to resize the RadWindow proportional only when manually resizing?

So, like when holding Shift key in PhotoShop.

 

Marc

Vessy
Telerik team
 answered on 08 Nov 2016
1 answer
363 views

Here is the idea: a tree view with nodes. Once a node is clicked, the server generates a panel with some buttons specific for that node. Those buttons once clicked (Click event postback) call the event handler on the server. Basically dynamically created nodes with postbacks after being clicked create buttons with postbacks. 

Here is my approach: I have a RadTreeView with some data. The RadTreeView has a "OnNodeClick" event handler that gets the actual clicked node. Then the server generates dynamically buttons on a panel based on the value in the node. Problem is that the "OnNodeClick" event handler is fired after the page load and therefore the postbacks from the buttons are not bound. So I tried another approach by adding the selected node value to the ViewState and then reading from it at Page_Load, but the problem is still the same. The chain is Page_Load -> OnNodeClicked, so the ViewState gets set only after the controls have been generated and therefore only on a second Page_Load I can actually get the value. 

Some code to make it clear:

    protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                    InitTreeNodesFromServices(resourceTree);
            }
            var resourceIdObj = ViewState["ResourceId"];
            if(resourceIdObj != null)
                GenerateButtonsForSelection((string)resourceIdObj);
        }
    protected void resourceTree_OnNodeClick(object sender, RadTreeNodeEventArgs e)
        {
            ViewState.Add("ResourceId", e.Node.Value);
        }

I know it's a simple issue, but I have been stuck with it for a whole day at this point. What is the right way to handle this situation? Maybe I need a different approach? Thank you. 

Ivan Danchev
Telerik team
 answered on 08 Nov 2016
3 answers
1.2K+ views
G'Day Guys,

What is the row above the header but below the caption called (the one with the "Add New Record" and "Refresh") and how do I get a template (small table with some html and images) into it?

Can I also include a similar row below the footer?

You may ask why not just put your tables above and below the grid, however I want to inherit the styling from the RadGrid when it is changed from one skin to the next.

Has anyone had success working with these rows?

Cheers

Ian.
Viktor Tachev
Telerik team
 answered on 08 Nov 2016
19 answers
974 views
I'm getting the following error when I try to attach the grid to a datasource (I've tried both an ObjectDataSource and an EntityDataSource and I get the same message:

  RadGrid - RadGrid1System.Web.HttpParseException (0x80004005): Cannot create an object of type 'System.Collections.Generic.List`1[[Telerik.Web.UI.GridTableView+PersistableColumnSetting, Telerik.Web.UI, Version=2013.1.403.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4]]' from its string representation '(Collection)' for the 'ColumnSettings' property. ---> System.Web.HttpParseException (0x80004005): Cannot create an object of type 'System.Collections.Generic.List`1[[Telerik.Web.UI.GridTableView+PersistableColumnSetting, Telerik.Web.UI, Version=2013.1.403.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4]]' from its string representation '(Collection)' for the 'ColumnSettings' property. ---> System.Web.HttpException (0x80004005): Cannot create an object of type 'System.Collections.Generic.List`1[[Telerik.Web.UI.GridTableView+PersistableColumnSetting, Telerik.Web.UI, Version=2013.1.403.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4]]' from its string representation '(Collection)' for the 'ColumnSettings' property. at System.Web.UI.PropertyConverter.ObjectFromString(Type objType, MemberInfo propertyInfo, String value) at System.Web.UI.ControlBuilder.AddProperty(String filter, String name, String value, Boolean mainDirectiveMode) at System.Web.UI.ControlBuilder.PreprocessAttribute(String filter, String attribname, String attribvalue, Boolean mainDirectiveMode, Int32 line, Int32 column) at System.Web.UI.ControlBuilder.PreprocessAttributes(ParsedAttributeCollection attribs) at System.Web.UI.ControlBuilder.Init(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs) at System.Web.UI.ControlBuilder.CreateBuilderFromType(TemplateParser parser, ControlBuilder parentBuilder, Type type, String tagName, String id, IDictionary attribs, Int32 line, String sourceFileName) at System.Web.UI.ControlBuilder.GetChildPropertyBuilder(String tagName, IDictionary attribs, Type& childType, TemplateParser templateParser, Boolean defaultProperty) at System.Web.UI.ControlBuilder.CreateChildBuilder(String filter, String tagName, IDictionary attribs, TemplateParser parser, ControlBuilder parentBuilder, String id, Int32 line, VirtualPath virtualPath, Type& childType, Boolean defaultProperty) at System.Web.UI.TemplateParser.ProcessBeginTag(Match match, String inputText) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.UI.DesignTimeTemplateParser.ParseControlsInternalHelper(DesignTimeParseData data, Boolean returnFirst) at System.Web.UI.DesignTimeTemplateParser.ParseControlsInternal(DesignTimeParseData data, Boolean returnFirst) at System.Web.UI.DesignTimeTemplateParser.ParseControl(DesignTimeParseData data) at System.Web.UI.Design.ControlSerializer.DeserializeControlInternal(String text, IDesignerHost host, Boolean applyTheme) at System.Web.UI.Design.ControlParser.ParseControl(IDesignerHost designerHost, String controlText, Boolean applyTheme) at System.Web.UI.Design.ControlDesigner.CreateClonedControl(IDesignerHost parseTimeDesignerHost, Boolean applyTheme) at System.Web.UI.Design.ControlDesigner.CreateViewControl() at System.Web.UI.Design.ControlDesigner.CreateViewControlInternal() at System.Web.UI.Design.ControlDesigner.get_ViewControl() at Telerik.Web.Design.RadGridDesigner.GetDesignTimeHtml(DesignerRegionCollection regions) at System.Web.UI.Design.ControlDesigner.GetViewRendering(ControlDesigner designer) 
Denius
Top achievements
Rank 1
 answered on 08 Nov 2016
14 answers
470 views
I'm looking to have the Scheduler display the current week on the timeline, but by default the first column will be today(which 6/7 times isn't Monday). Also when people select a date on the calendar that day is the start of the 7 columns shown by the timeline, rather than the Monday that starts that week.
Is there any way to ensure the Monday is always in the first column regardless of the current day or what is selected from navigation via the calendar?
Also, is there any way to make the calendar start on a Monday?
Thanks,
Edward
Anton
Telerik team
 answered on 08 Nov 2016
10 answers
366 views
I have basic radgrid with paging and grouping enabled. When my datasource has a small number of items everything is fine, however when the grid needs to use paging, my groups footer aggregate is evaluated on the rows of the current page only. I would like to build a custom aggregate function based on all the data (in the group) instead of having "per page per group" totals. How can it be done?

Given I achieve what I just described, would it be possible to hide the group footer ONLY when the end of group is not reached? As you can guess, it might be confusing to see multiple "group totals for the whole group"... Let's say I have a page size of 100 and my first group has 150 items, how could I force the group footer to appear only on the 2nd page (page 1 would have no group footer)?

Let me know if you want me to provide some code.
Kamesh
Top achievements
Rank 1
 answered on 08 Nov 2016
1 answer
102 views

I'm trying to implement two panels that slide and dock similar to visual studio's Solution Explorer and Properites. I was able to make them slide using splitter/slidingzone/slidingpane with a litlle tab appearing when they are hidden. I want to also be able to dock them side by side by dragging one of them next to the other one. For my search I found that it may be done using Dock but I did not find how to do it. I tried to implement it by it did not work with me and I had to revert back to the splitter code to implement other functionalities. what it did was putting the slidingzone inside the dock/dockzone/dockpane

<telerik:RadSplitter RenderMode="Lightweight" ID="RadSplitter1" Skin="Material" runat="server" Width="100%" Height="100%">
    <telerik:RadPane ID="LeftPane" runat="server" Width="22px" Scrolling="none" Locked="False">
        <telerik:RadSlidingZone ID="SlidingZone1" runat="server" Width="22px" RenderMode="Lightweight">
            <telerik:RadSlidingPane ID="RadSlidingPane1" Title="Emergency" runat="server" Width="300px" MinWidth="300">
                <uc1:EmergencyControl runat="server" ID="EmergencyControl" />
            </telerik:RadSlidingPane>
            <telerik:RadSlidingPane ID="Radslidingpane2" Title="Alarm" runat="server" Width="300px" MinWidth="300">
                <uc1:AlarmControl runat="server" ID="AlarmControl" />
            </telerik:RadSlidingPane>
        </telerik:RadSlidingZone>
    </telerik:RadPane>
    <telerik:RadPane ID="MiddlePane1" runat="server" Scrolling="None">
        <telerik:RadSplitter RenderMode="Lightweight" ID="Radsplitter2" runat="server" Orientation="Horizontal" VisibleDuringInit="false" Height="100%">
            <telerik:RadPane ID="MapPane" runat="server">
                <uc1:MapControl runat="server" ID="MapControl" Height="100%" />
            </telerik:RadPane>
        </telerik:RadSplitter>
    </telerik:RadPane>
    <telerik:RadPane ID="EndPane" runat="server" Width="22px" Scrolling="None">
        <telerik:RadSlidingZone ID="Radslidingzone1" runat="server" Width="22px" ClickToOpen="true"
            SlideDirection="Left">
            <telerik:RadSlidingPane ID="AlarmBtnPane" Title="Alarm Button" runat="server" Width="50px"
                MinWidth="50" EnableDock="False" EnableResize="False" TabView="TextAndImage">
                <uc1:AlarmBtnControl runat="server" ID="AlarmBtnControl" />
            </telerik:RadSlidingPane>
        </telerik:RadSlidingZone>
    </telerik:RadPane>
</telerik:RadSplitter>

 

So I you can provide a example on how to implement it.

Ianko
Telerik team
 answered on 08 Nov 2016
6 answers
129 views

Hi, I am using  this kb article to display a RadConfirm when the user clicks on a Delete button. I am currently using the latest build.

Everything worked fine, but lately it doesn't postback anymore ONLY ON FireFox.

I tried to replicate the issue in a small project, but it works as expected, so I guess there should be something I do in other places that breaks the behavior of the toolbar (?).

Note that

- if I remove the RadConfirm (or simply I do not cancel the ButtonClicking event) it works, so all my other code runs without interfering with the postback

- if I try to force a postback by calling __doPostBack() (after clicking on the Delete button and answering the RadConfirm) it doesnt work too

- I have a version of the application that runs with Telerik version 2015.2.623 without any problem (I am now going to try to go back to this version and see if it solves anything)

I need a way I can debug this, as what happens after I click Yes on the RadConfirm is a mix of Telerik and MS code that is fairly complex.

Thanks in advance

Luca

Marin Bratanov
Telerik team
 answered on 08 Nov 2016
20 answers
1.1K+ views
Hi All

I have a radgrid and button (Export To pdf)

The radgrid contains the data

When I click the Export to pdf button

The datas are shown in the pdf

Before that a screen appears for open or save

if open i given it opens the pdf

If save is given then the path if asked, and then it is saved

IS THERE ANY OPTION TO AUTOMATICALLY SAVE THE PDF

-Anto
Daniel
Telerik team
 answered on 08 Nov 2016
1 answer
192 views

Hello all,

I have a Radgrid with a DeleteColumn. When I click in delete image the row dessapear but when I refresh the grid the row appear again.

I try with Datasource delete query and code behind, but OnDeleteCommand never triggered.

Code:

 

<telerik:RadGrid  ID="RGVEmpresasEnCentro" runat="server" Width="500px"
                                RenderMode="Lightweight" GridLines="None" 
                                AllowAutomaticDeletes="true"
                                AllowAutomaticInserts="true"
                                PageSize="10"
                                OnPreRender="RGVEmpresasEnCentro_PreRender"
                                OnBatchEditCommand="RGVEmpresasEnCentro_BatchEditCommand"
                                OnDeleteCommand="RGVEmpresasEnCentro_DeleteCommand"
                                AllowAutomaticUpdates="true"
                                AllowPaging="true"
                                AutoGenerateColumns="False"
                                DataSourceID="SDSEmpresasEnCentro"
                                Skin="WebBlue" >
                <MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="id"
                    DataSourceID="SDSEmpresasEnCentro" HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False"
                    CommandItemSettings-AddNewRecordText="Insertar centro"
                    CommandItemSettings-SaveChangesText="Guardar"
                    CommandItemSettings-CancelChangesText="Cancelar"
                    CommandItemSettings-RefreshText="Refrescar"
                    NoMasterRecordsText="No hay empresas en el centro"
                    NoDetailRecordsText="No hay empresas en el centro">
                    <BatchEditingSettings EditType="Cell" />
                    <Columns>
                        <telerik:GridBoundColumn    DataField="id"
                                                    Visible="false"
                                                    DataType="System.Int32"
                                                    HeaderText="id"
                                                    SortExpression="id"
                                                    UniqueName="id"
                                                    ReadOnly="true"  />
                        <telerik:GridBoundColumn DataField="Empresa"
                            HeaderText="Empresa"
                            SortExpression="Empresa"
                            UniqueName="Empresa">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Numero"
                            HeaderText="Numero"
                            SortExpression="Numero"
                            UniqueName="Numero">
                        </telerik:GridBoundColumn>
                        <telerik:GridDateTimeColumn DataField="Desde"
                            HeaderText="Desde"
                            SortExpression="Desde"
                            UniqueName="Desde" PickerType="DatePicker" DataFormatString="{0:dd/MM/yyyy}" >
                        </telerik:GridDateTimeColumn>
                        <telerik:GridDateTimeColumn DataField="HastaEl" 
                            HeaderText="Hasta el"
                            SortExpression="HastaEl"
                            UniqueName="HastaEl"
                            PickerType="DatePicker"
                            DataFormatString="{0:dd/MM/yyyy}" >
                        </telerik:GridDateTimeColumn>
                         <telerik:GridButtonColumn
                             HeaderText="Delete" HeaderStyle-Width="50px"
                            CommandName="Delete"  Text="Delete" UniqueName="DeleteColumn">
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowKeyboardNavigation="true"></ClientSettings>
            </telerik:RadGrid>
 
        <asp:SqlDataSource ID="SDSEmpresasEnCentro" runat="server" ConnectionString="<%$ ConnectionStrings:PCMConnectionString %>"
                            SelectCommand="SELECT * From EmpresasEnCentros Where idRevisionCentros=@idRevisionCentros"
                            DeleteCommand="DELETE EmpresasEnCentros WHERE id = @id"
                            InsertCommand="INSERT INTO EmpresasEnCentros (idRevisionCentros,Empresa,Numero,Desde,HastaEl) VALUES (@idRevisionCentros,@Empresa,@Numero,@Desde,@HastaEl)"
                            UpdateCommand="UPDATE EmpresasEnCentros SET Empresa=@Empresa, Numero=@Numero,Desde=@Desde,HastaEl=@HastaEl WHERE id = @id">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32"></asp:Parameter>
            </DeleteParameters>
            <SelectParameters>
                <asp:parameter Name="idRevisionCentros" DefaultValue="0" type="Int32" />
            </SelectParameters>
            <InsertParameters>
                <asp:parameter Name="idRevisionCentros" type="Int32" />
                <asp:Parameter Name="Empresa" Type="String"></asp:Parameter>
                <asp:Parameter Name="Numero" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="Desde" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="HastaEl" Type="DateTime"></asp:Parameter>
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="id" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="Empresa" Type="String"></asp:Parameter>
                <asp:Parameter Name="Numero" Type="Int32"></asp:Parameter>
                <asp:Parameter Name="Desde" Type="DateTime"></asp:Parameter>
                <asp:Parameter Name="HastaEl" Type="DateTime"></asp:Parameter>
            </UpdateParameters>
        </asp:SqlDataSource>

 

protected void RGVEmpresasEnCentro_PreRender(object sender, EventArgs e)
    {
        RGVEmpresasEnCentro.Rebind();
        GridTableView masterTable = (sender as RadGrid).MasterTableView;
        foreach (GridColumn column in masterTable.RenderColumns)
        {
            if ((column is IGridEditableColumn) && (column as IGridEditableColumn).IsEditable && masterTable.GetBatchColumnEditor(column.UniqueName) != null)
            {
                Control container = (masterTable.GetBatchColumnEditor(column.UniqueName) as IGridColumnEditor).ContainerControl;
                if (container != null && container.Controls.Count > 0)
                {
                    (container.Controls[0] as WebControl).Width = Unit.Percentage(100);
                }
            }
        }
    }
protected void RGVEmpresasEnCentro_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
    {
        foreach (GridBatchEditingCommand command in e.Commands)
        {
            if(command.Type == GridBatchEditingCommandType.Insert)
            {
                Hashtable newValues = command.NewValues;
                if(!newValues.ContainsValue(null))
                {
                    string centro = Request.QueryString["Centro"];
                    string periodo = Request.QueryString["Periodo"];
                    int idRevisionCentro =CentrosBLL.ComprobarYCrearRegistros(centro, periodo, Session["codigoSap"].ToString());
                    string empresa = newValues["Empresa"].ToString();
                    int numero = Convert.ToInt32(newValues["Numero"]);
                    DateTime desde = Convert.ToDateTime(newValues["Desde"]);
                    DateTime hasta=Convert.ToDateTime(newValues["HastaEl"]);;
                    CentrosBLL.insertEmpresaCentro(idRevisionCentro,empresa,numero,desde,hasta);
                }
                e.Canceled = true;
            }
        }
    }
    protected void RGVEmpresasEnCentro_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        //Some code for delete programatically
    }
Pavlina
Telerik team
 answered on 08 Nov 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?