Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
93 views
Hi,
I have written code for selecting List Item.But it is not selecting the Items from DropDown.

I used following code

AFTSCL.myManager.ActiveBrowser.Find.ByExpression<HtmlListItem>("TagIndex=li:67").Click();

How can select Items from DropDown List.

Thanks,
Chandrakant.
Ivaylo
Telerik team
 answered on 07 Aug 2012
10 answers
185 views
This is getting frustrating.  According to other threads and the examples I should be able to simply hide or not hide a column in javascript with a simple function.  The problem is that when I use the hideColumn(x) function, it is not hiding one column, but always two.  (Whatever is the next column is hidden as well) This happens regardless of what index I pass to the function. (Though I'm only interested in hiding index 1)  I've tried experimenting, but no luck so far.  The relevant code is below:

<telerik:RadCodeBlock ID="codeBlock1" runat="server">
    <script type="text/javascript">
        var grid;
  
        function GetGridObject(sender, eventArgs)
        {
            grid = sender;
        }
  
        function showType(action)
        {
            if (action)
            {
                grid.get_masterTableView().showColumn(1);
            }
            else
            {
                grid.get_masterTableView().hideColumn(1);
            }
        }
    </script>
</telerik:RadCodeBlock>
                <telerik:RadGrid ID="gridLoads" runat="server" AllowPaging="false" EnableEmbeddedSkins="false" AutoGenerateColumns="false" Height="344px">
                    <MasterTableView CellSpacing="0" CellPadding="0" Width="612px" DataKeyNames="SortOrder" TableLayout="Fixed" ShowFooter="false">
                        <HeaderStyle BackColor="#FFFFFF" Font-Bold="true" ForeColor="#666666" Font-Names="Arial,Verdana,Sans-Serif" BorderWidth="0" BorderStyle="None" />
                        <ItemStyle BackColor="#EBECF2" Font-Names="Arial,Verdana,Sans-Serif" />
                        <AlternatingItemStyle BackColor="#EBECF2" Font-Names="Arial,Verdana,Sans-Serif" />
                        <NoRecordsTemplate></NoRecordsTemplate>
                        <Columns>
                            <telerik:GridTemplateColumn UniqueName="Title" HeaderText="Title" HeaderStyle-Width="320px"
                                ItemStyle-BorderWidth="1" ItemStyle-BorderColor="#cccccc">
                                <ItemTemplate>
                                    <telerik:RadTextBox ID="txtTitle" Skin="Simple" MaxLength="50" Width="315px" runat="server">
                                    </telerik:RadTextBox>
                                    <asp:RequiredFieldValidator ID="rfvTitle" Display="Dynamic" ControlToValidate="txtTitle" ValidationGroup="SaveExp"
                                        ErrorMessage="<br/>Please add a title for this item before adding!" EnableClientScript="false" runat="server">
                                    </asp:RequiredFieldValidator>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="Type" UniqueName="Type" HeaderText="Type" ItemStyle-BorderWidth="1"
                                ItemStyle-BorderColor="#cccccc" HeaderStyle-Width="93px" Display="false">
                                <ItemTemplate>
                                    <telerik:RadComboBox ID="ddlType" Skin="Simple" Width="90px" runat="server">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="Fuel" Value="Fuel" />
                                            <telerik:RadComboBoxItem Text="Chaff" Value="Chaff" />
                                            <telerik:RadComboBoxItem Text="Flares" Value="Flares" />
                                            <telerik:RadComboBoxItem Text="Bomb" Value="Bomb" />
                                            <telerik:RadComboBoxItem Text="Missle" Value="Missle" />
                                            <telerik:RadComboBoxItem Text="Ammo" Value="Ammo" />
                                            <telerik:RadComboBoxItem Text="External Tank" Value="External Tank" />
                                        </Items>
                                    </telerik:RadComboBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="Weight" HeaderText="Weight" UniqueName="Weight" ItemStyle-HorizontalAlign="Right"
                                ItemStyle-BorderWidth="1" ItemStyle-BorderColor="#cccccc"
                                HeaderStyle-Width="57px" HeaderStyle-HorizontalAlign="Right">
                                <ItemTemplate>
                                    <wyle:NumericTextBox ID="txtWeight" runat="server" ToolTip="Enter Weight Here"
                                        MaxLength="10" MaxValue="9999999999.9" Skin="Simple" DecimalPlaces="1" Width="50px" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="Moment" HeaderText="Moment" UniqueName="Moment" ItemStyle-HorizontalAlign="Right"
                                ItemStyle-BorderWidth="1" ItemStyle-BorderColor="#cccccc"
                                HeaderStyle-Width="79px" HeaderStyle-HorizontalAlign="Right">
                                <ItemTemplate>
                                    <img src="../../Images/calculator_20.png" onclick="openArm(this, '<%=gridLoads.ClientID %>', 7, 10);" title="Calculate moment based on new ARM"
                                        alt="Calculate moment based on new ARM" style="vertical-align:middle;" />
                                    <wyle:NumericTextBox ID="txtMoment" runat="server" ToolTip="Enter Moment Here"
                                        MaxLength="10" MaxValue="9999999999.9" Skin="Simple" DecimalPlaces="1" Width="50px" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings Scrolling-UseStaticHeaders="true" Scrolling-AllowScroll="true" AllowColumnHide="true">
                        <Resizing ClipCellContentOnResize="false" EnableRealTimeResize="true" AllowColumnResize="true" />
                        <ClientEvents OnGridCreated="GetGridObject"></ClientEvents>
                    </ClientSettings>
                </telerik:RadGrid>
Pavlina
Telerik team
 answered on 07 Aug 2012
4 answers
95 views
Hello,

I am trying to save the custom settings of a RadGrid (Sort expressions, Filter expressions, Column settings).
To achieve this, I am using the GridSettingsPersister (as described in http://www.telerik.com/help/aspnet-ajax/grid-saving-settings-on-per-user-basis.html) and a StreamWriter to save the data in a .txt-file while the application is being closed (Page_Unload). I would like to load the settings using a StreamReader and the GridSettingsPersister the next time I start the application (Page_Load), but there seems to be an error with that (System.InvalidCastException). Visual Studio is telling me that [A]GridSettingsCollection can't be transformed into [B]GridSettingsCollection.

Is that error expected or is there a workaround for this situation?

Thanks in advance,
Robin
Pavlina
Telerik team
 answered on 07 Aug 2012
1 answer
107 views

Hello, I’m trying to use the fileexplorer example published in the demos and it works but when it do a postbak the system redirects to the login page.  I use it in a private page and I use Forms authentification method with a ticket cookie.

Thanks in advance.


Here you can see my code but is just a copy from the demo

    <script type="text/javascript">
        //<![CDATA[
        function OnClientItemSelected(sender, args) {
            window.open(args.get_path());
        }
        function OnClientDelete(explorer, args) {
            // previewImage("");
        }

        //]]>
    </script>


<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="Server"/>
    <telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="860px" Height="520px" OnClientItemSelected="OnClientItemSelected" OnclientDelete="OnClientDelete">
        <Configuration ViewPaths="~/Otros/tmp" UploadPaths="~/Otros/tmp" DeletePaths="~/Otros/tmp" />
    </telerik:RadFileExplorer>
</form>


CS


protected void Page_Load(object sender, EventArgs e)
        {
            //set properties according to configuration panel
            //FileExplorer1.Configuration.SearchPatterns = new string[] { "*.jpg", "*.jpeg", "*.gif", "*.png" };
            FileExplorer1.Configuration.SearchPatterns = new string[] { "*.*" };
            FileExplorer1.VisibleControls = GetVisibleControls();
            FileExplorer1.EnableOpenFile = false;
            FileExplorer1.DisplayUpFolderItem = true;
            FileExplorer1.EnableCreateNewFolder = true;
            FileExplorer1.Configuration.UploadPaths = new string[0];
            FileExplorer1.Configuration.UploadPaths = new string[] { "~/Otros/tmp" };
            FileExplorer1.AllowPaging = false;
        }


        protected Telerik.Web.UI.FileExplorer.FileExplorerControls GetVisibleControls()
        {
            Telerik.Web.UI.FileExplorer.FileExplorerControls explorerControls = 0;
            explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.Grid;
            explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.Toolbar;
            explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.TreeView;
            explorerControls |= Telerik.Web.UI.FileExplorer.FileExplorerControls.ContextMenus;
            return explorerControls;
        }




Vessy
Telerik team
 answered on 07 Aug 2012
3 answers
207 views
I have a RadGrid which has a label, a combobox and a check box. I fill up the combobox on ItemDatabound Event of the RadGrid. What i do is create a new row on CheckedChange event of the row's CheckBox. When the grid is loaded for the first time I am storing the datasource in a session variable. When the row's checkbox is checked I am manipulating the datatable stored in session variable to add the new row in the session's datatable . I then bind the datasource of the RadGrid with the new Session Variable. I get the required RadGrid with the new row but  I am losing the selected value of all combo boxes in which a value had been selected before the checkbox was checked . I know this is the standard behaviour and there is nothing wrong with it but what i need to know is a way I can retain all the previously selected values of the comboboxes of RadGrid after the databind.

Thanks in advance.
Eyup
Telerik team
 answered on 07 Aug 2012
3 answers
121 views
I am developing line charts. I have two chart series items. One of the chart series style is Line another one is Dashed line. I want  the legend appearance exactly like how the series item is appeared in the chart. (like ----------- and -  -  -  -  -  - )
Evgenia
Telerik team
 answered on 07 Aug 2012
3 answers
959 views
I have formatted the headers and column widths to align properly when using static headers, scrolling, filtering and column resizing set to true (grid lines = none). Upon initial load the grid does not have a horizontal scroll, however, upon widening a column the horizontal scroll appears (desired functionality). All is fine until I scroll all the way to the right. The headers and table columns are not aligned.

I noticed that before horizontal scroll appears on the grid the header has additional space for the vertical scroll, this additional space disappears when horizontal scroll appears. Is there a way to fix this? I have attached screenshots to help visualize my issue.
Pavlina
Telerik team
 answered on 07 Aug 2012
2 answers
156 views

Problem 1: My requirement is to show 4 spline area series in one chart, and whenever two chart overlap to other series should be transparent (ex. In attached image Investment chart is overlapping the Home chart, but due to transparency in Investment chart Home Chart is visible.
Problem 2: How to show the Rad circled Legends in the Chart (refer chart.jpg )

My code to create the Spline Area series is as below

 

ASPX Code is

<telerik:RadChart ID="RadChart1" runat="server"></telerik:RadChart>

 

And code is as below

   protected void BindChart()

        {

 

            RadChart1.Height = System.Web.UI.WebControls.Unit.Pixel(1000);

            RadChart1.Width = System.Web.UI.WebControls.Unit.Pixel(1000);

 

            ChartSeries series1 = new ChartSeries("Series 1");

            series1.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Pink;

            series1.Type = ChartSeriesType.SplineArea;

           

            foreach (GraphDetail data in DebtGraph)

            {

                ChartSeriesItem item = new ChartSeriesItem();

                item.XValue = data.Age;

                item.YValue = data.Dollar;

                item.Label.Appearance.Visible = false;

                series1.Items.Add(item);

            }

 

            RadChart1.Series.Add(series1);

 

            ChartSeries series2 = new ChartSeries("Series 2");

            series2.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Green;

            series2.Type = ChartSeriesType.SplineArea;

            foreach (GraphDetail data in HomeGraph)

            {

                ChartSeriesItem item = new ChartSeriesItem();

 

                item.XValue = data.Age;

                item.YValue = data.Dollar;

                item.Label.Appearance.Visible = false;

                series2.Items.Add(item);

            }

 

            RadChart1.Series.Add(series2);

 

            ChartSeries series3 = new ChartSeries("Series 3");

            series3.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Red;

            series3.Type = ChartSeriesType.SplineArea;

            foreach (GraphDetail data in InvestmentGraph)

            {

                ChartSeriesItem item = new ChartSeriesItem();

                item.XValue = data.Age;

                item.YValue = data.Dollar;

                item.Label.Appearance.Visible = false;

                series3.Items.Add(item);

            }

 

            RadChart1.Series.Add(series3);

          

        }

this code gives me the Out put attached in myimplementation.jpg

 

Petar Marchev
Telerik team
 answered on 07 Aug 2012
3 answers
133 views
Hi everyone,

i Just installed Sharepoint Acceleration Kit SAK ,
and i was looking at this documentation
http://www.telerik.com/help/aspnet-ajax/moss-installing_radeditor__radgrid_web_parts_on_sharepoint_2010.html
"Sharepoint 2010" .
Well done, installed and i was able to use the webParts in my Sharepoint!, ok! that´s great !

But now i tried to create a Web Part using RadControls, because the SAK says RadControls ASP.NET Ajax are include !
i Create a Web Part and added the reference to
C:\Windows\assembly\GAC_MSIL\Telerik.Web.UI\2012.1.215.35__121fae78165ba3d4\Telerik.Web.UI.dll
Then i added Telerik.Web.UI.dll from GAC to my ToolBox ! and he added

<%@ Register Assembly="Telerik.Web.UI, Version=2012.1.215.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

Great!, than i added a simple numeric box
<telerik:RadNumericTextBox ID="tbxParcela" runat="server"  class="s40" ></telerik:RadNumericTextBox>

And i deployed the WebPart,! Well done!, its works, but in design mode DOES NOT ! I believe because i dont have the "Telerik.Web.Design.dll"
Why this DLL are not include ?
Why there is no documentation refering how to use the RadControls in SAK Package?
I believe the documentation about creating WebParts using SAK are missing.

Thank you very much

Tsvetoslav
Telerik team
 answered on 07 Aug 2012
1 answer
105 views
I have a template column on my RadGrid with just a textbox in it.  I want the user to be able to enter text into the box as normal without the grid being in edit mode.  By default, the textbox seems to be read only and won't allow input.  I can't find any settings to allow the user to type into it.

<telerik:GridTemplateColumn HeaderText="Position" ItemStyle-CssClass="position">
  <ItemTemplate>
     <asp:TextBox ID="txtPosition" runat="server" Width="40" CssClass="txt" MaxLength="5" />
   </ItemTemplate>
</telerik:GridTemplateColumn>
Vasil
Telerik team
 answered on 07 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?