Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
39 views
please disregard, sorry
Garrett
Top achievements
Rank 1
 asked on 22 Oct 2013
1 answer
85 views
Hi there.

How do I iterate through a Hierarchial Table and find the last row? Ive done this at the top level without DetailTables - OnPreRender I can go grab the Last GridItem and find the appropriate control and set the visibility. Thanks.

So something like -
if (rgQuestions.Items.Count > 0)
{
     GridItem gi = rgQuestions.Items[rgQuestions.Items.Count - 1];
     ImageButton btnDown = gi.FindControl("btnDown") as ImageButton;
     btnDown.Visible = false;
}
Roland
Top achievements
Rank 1
 answered on 22 Oct 2013
4 answers
390 views

Hi,
Iam creating a Class for Pivot grid for programatic creation of grid.
Example :

 public static void Layouts(RadPivotGrid grid, int height, int width, Boolean widthtype, Boolean allowsorting)
    {
   
        grid.Skin = "Office2007";// set the Skin

        grid.EmptyValue = "No data";     
          
        grid.Height = height; //Set the height of the grid  in % or in pixcel
        if (width > 0)
        {
            if (widthtype == false)
            {
                grid.Width = width; // set the Width of the grid  in % or in pixcel
            }
            else
            {
                grid.Width = Unit.Percentage(width);
            }
        }
        grid.AllowSorting = allowsorting;
        grid.AllowFiltering = false;
        grid.ShowFilterHeaderZone = false;
        grid.ShowDataHeaderZone = false;
        grid.ShowFilterHeaderZone = false;
        grid.ShowRowHeaderZone = false;
        grid.ClientSettings.Scrolling.AllowVerticalScroll = true;
        grid.ClientSettings.Scrolling.SaveScrollPosition = true;

    }

    #endregion

    //Set all the telerik Grid Page
    #region LayoutPage
    public static void LayoutPage(RadPivotGrid grid, int pagesize, Boolean allowpaging)
    {
        grid.PageSize = pagesize;//Set the Grid Page default page size
        grid.AllowPaging = allowpaging;//Set Paging for a grid as true or false
        //  grid.PagerStyle.PageSizeControlType = "RadDropDownList";
    

    }
    #endregion

    //This function is to set the visblity of Colum and Row total and Subtotal display
    #region TotalSettings
    public static void TotalSettings(RadPivotGrid grid, TotalsPosition ColumnGrandTotalsPosition, TotalsPosition ColumnsSubTotalsPosition, TotalsPosition RowGrandTotalsPosition, TotalsPosition RowsSubTotalsPosition)
    {
        grid.TotalsSettings.ColumnGrandTotalsPosition = ColumnGrandTotalsPosition;
        grid.TotalsSettings.ColumnsSubTotalsPosition = ColumnsSubTotalsPosition;
        grid.TotalsSettings.RowGrandTotalsPosition = RowGrandTotalsPosition;
        grid.TotalsSettings.RowsSubTotalsPosition=RowsSubTotalsPosition;
    

    }
    #endregion

    // bind the Datatable to  grid
    #region DataBind
    public static void DataBinds(RadPivotGrid grid, DataTable dataTable, Boolean needdatasource)
    {

        grid.DataSource = dataTable;
        if (!needdatasource)
        {
            grid.DataBind();
        }
    }
    public static void DataBinds(RadPivotGrid grid, DataSet dataSet, Boolean needdatasource)
    {
        DataBinds(grid, dataSet.Tables[0], needdatasource);
    }
    #endregion

    //here we define each column type and value and text
    #region PivotgridColumnType

    //To set the Grid header column groups
    #region PivotGridRowFiled
    public static void PivotGridRowFiled(RadPivotGrid grid,  String datafield, String UniqueName, int Width,TelerikControlType Columntype,String contolID)
    {
        PivotGridRowField rowField = new PivotGridRowField();
        if(Columntype!=TelerikControlType.None)
        {
        rowField.CellTemplate = new MyTemplate(datafield, Columntype.ToString(), Width - 2, contolID);
        }
        rowField.DataField = datafield;
        rowField.UniqueName = UniqueName;
        rowField.CellStyle.Width = Width;
        grid.Fields.Add(rowField);

    }
    #endregion

     #region PivotGridColumnFiled
    public static void PivotGridColumnFiled(RadPivotGrid grid,  String datafield, String UniqueName, int Width)
    {
        PivotGridColumnField  columnField = new PivotGridColumnField ();
       // rowField.CellTemplate=
        columnField.DataField = datafield;
        columnField.UniqueName = UniqueName;
        columnField.CellStyle.Width = Width;

        grid.Fields.Add(columnField);

    }
    #endregion

        #region PivotGridAggregateFiled
    public static void PivotGridAggregateFiled(RadPivotGrid grid,  String datafield, String UniqueName, int Width,String DataFormatString,String totalformatString)
    {
        PivotGridColumnField  aggregateField = new PivotGridColumnField ();
       // rowField.CellTemplate=
        aggregateField.DataField = datafield;
        aggregateField.UniqueName = UniqueName;
        aggregateField.CellStyle.Width = Width;
         aggregateField.DataFormatString = DataFormatString;
            aggregateField.TotalFormatString = totalformatString;
            grid.Fields.Add(aggregateField);

    }
    #endregion

    #endregion



now everything looks good but i need to create a cell template which has Lable,Div controls need to add in aggregate and in row Column.

is there any sample for creating cell template for Pivot grid by program.
Syed
Top achievements
Rank 1
 answered on 21 Oct 2013
3 answers
195 views
I have a ASP.NET site which we are upgrading from .net framework 3.5 to 4.0 and everything seems to be working fine. I also upgraded from telerik dll from 2010.2.929.20 to 2011.1.315.40.

The only problem that I am having is the telerik controls placed in User Control which then placed on aspx page is not rendering in Visual Studio 2010. The user controls is displayed as error -

System.NotSupportedException:Specified method is not supported at System.Web.UI.Design.UserControlDesign.Dummy.RootDesigner.DummyWebFormsReferenceManager.RegisterTahPrefix(Type objectType) at ....(please see complete error in attached file)

I removed the old reference of telerik dlls and added them back again with the new dll..

Versions :
- Visual Studio 2010 Professional
- Telerik Control - 2011.1.315.40
- .net framework 4.0

Please advise.

Thanks.
James
Top achievements
Rank 1
 answered on 21 Oct 2013
6 answers
301 views
Hi All

I am having two questions.

1.  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 -  -  - -  - - )

2. Chart series labeltext values are overlapping. I want to keep the labeltext value at the end of series item. I have marked in the attached image.


Regards
Arima
Petar Kirov
Telerik team
 answered on 21 Oct 2013
1 answer
45 views
Hello there.

I have been trying to create an organization chart very similar to the "Transfer Employee"-example, but ran into a little problem, cause I needed to change it from a grouped binding to a single binding.

I played around with the OnClientDropping-function, but can't really twist it to fit my perpose.

When I drag an element from the listview, to an element in the OrgChart, it should make the new element a child of the element dropped on, and the ajax-update i working like a charm, but the _getRealHierarchicalIndex seems to return 0 every time.

function OnClientDropping(sender, args) {
    var orgChart = $find("<%= RadOrgChart1.ClientID %>");
    var itemText = args.get_sourceItem().get_text().trim();
    if (args.get_htmlElement().className.indexOf("rocItem") != -1 || $(args.get_htmlElement()).parents(".rocItem").length > 0) {
        var hierarchicalIndex = orgChart._extractNodeFromDomElement(args.get_htmlElement())._getHierarchicalIndex();
        hierarchicalIndex = orgChart._getRealHierarchicalIndex(hierarchicalIndex); //gets right index if drill down is on
        $find("<%= RadAjaxManager2.ClientID %>").ajaxRequest("drop-" + itemText + "-" + hierarchicalIndex);
    }
 
    dropClue.style.display = "none";
    noDropClue.style.display = "none";
}

As you can see, I have only changed the rocGroup to a rocItem, and ofcause it gives me some problems in the RadAjaxManager2_AjaxRequest, cause the ids contains ether 0 or 0:0

Here's the start of the AjaxRequest:
char[] seps = { '-' };
            string[] textAndIds = e.Argument.Split(seps, StringSplitOptions.None);
 
            char[] sep = { ':' };
            string[] stringIds = textAndIds[2].Split(sep, StringSplitOptions.RemoveEmptyEntries);
            int[] ids = new int[stringIds.Length];
            for (int i = 0; i < stringIds.Length; i++)
            {
                ids[i] = Int32.Parse(stringIds[i]);
            }
 
            if (textAndIds[0] == "drop")
            {
                string newText = textAndIds[1];
 
                OrgChartNode node = RadOrgChart1.GetNodeByHierarchicalIndex(ids);
 
                var rows = from myRow in initialeEmployees.AsEnumerable() where myRow.Field<string>("FullName") == newText select new { values = myRow };
                string imageUrl = "";
                string emloyeeId = "";
                foreach (var row in rows)
                {
                    imageUrl = row.values.Field<string>("ImageUrl");
                    emloyeeId = row.values.Field<string>("EmployeeID");
                    break;
                }
                employees.Rows.Add(new string[] { emloyeeId, node.ID, newText, imageUrl });
            }


Peter Filipov
Telerik team
 answered on 21 Oct 2013
1 answer
97 views
When uploading a zero byte file neither Chrome nor FireFox send the file to the server.  IE sends the file where my upload handler assess the size and sends the error message back correctly.  I've seen other posts on the forum that have similar issues with FF and Chrome but there never are any solutions (in fact one seems to be exactly the same problem I am having but no solution).  Is there some configuration setting that I can set to make this work?

I'm using version 2011.3.1115.40.
Hristo Valyavicharski
Telerik team
 answered on 21 Oct 2013
2 answers
70 views
I have a RadToolTipManager that I want the onclientHide event to cause the page to reload, but when I handle the event it fires when the page loads

<telerik:RadAjaxPanel LoadingPanelID="OrderAdminLoadingPanel" runat="server">
      <telerik:RadToolTipManager runat="server" Modal="True"  Enabled="False" ID="RmaToolTipManager" ShowCallout="False" ShowEvent="OnClick"
                RelativeTo="BrowserWindow" Width="600" Style="z-index: 31000" Title="" Position="Center"
                    HideEvent="ManualClose" Animation="Fade" OnClientHide="alert('test')" OnAjaxUpdate="RmaToolTipManager_OnAjaxUpdate" RenderInPageRoot="True">
</telerik:RadToolTipManager>
        <div class="ctrydrop">
            Country:
            <asp:DropDownList runat="server" AutoPostBack="True"
                OnSelectedIndexChanged="CountryDropDown_OnSelectedIndexChanged"
                OnDataBound="CountryDropDown_OnDataBound" ID="CountryDropDown"
                DataTextField="CountryISO2Code" DataValueField="CountryISO2Code" />
        </div>
        <div class="griddiv" style="padding-left:20px; padding-right:20px">
            <telerik:RadGrid runat="server" ID="OrderAdminGrid"
                AllowCustomPaging="False" ShowGroupPanel="False" PageSize="15"
                AllowMultiRowSelection="True" AllowAutomaticDeletes="False"
                AllowAutomaticInserts="False" AllowPaging="true"
                ShowStatusBar="False" AllowSorting="True"
                EnableViewState="True" AutoGenerateColumns="False" AllowFilteringByColumn="true"
                DataSourceID="OrderAdminDataSource"
                OnItemCommand="OrderAdminGrid_OnItemCommand"
                OnItemCreated="OrderAdminGrid_OnItemCreated"
                OnItemDataBound="OrderAdminGrid_OnItemDataBound">
                <GroupingSettings CaseSensitive="False"></GroupingSettings>
                <clientsettings AllowColumnsReorder="False" enablerowhoverstyle="True">
                   <Selecting AllowRowSelect="True"></Selecting>
                   <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
                       AllowColumnResize="True"></Resizing>
                </clientsettings>
                <pagerstyle mode="NextPrevNumericAndAdvanced" AlwaysVisible="True"></pagerstyle>
                <mastertableview autogeneratecolumns="False" datakeynames="OrderId"
                    editmode="EditForms" nomasterrecordstext="No orders found." allowsorting="True"
                    allowmulticolumnsorting="False">
                    <Columns>
                        <telerik:GridTemplateColumn HeaderStyle-CssClass="order-admin-select-column-header"
                                    ItemStyle-CssClass="order-admin-select-column" HeaderText="Select" AllowFiltering="False">
                            <ItemTemplate>
                                <asp:CheckBox ID="SelectCheckBox" runat="server"/>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn UniqueName="OrderNumber" DataField="OrderNumber" AutoPostBackOnFilter="True" HeaderText="Order Number"
                                    HeaderStyle-CssClass="order-admin-order-number-column-header" ItemStyle-CssClass="order-admin-order-number-column"
                             ShowSortIcon="True" ShowFilterIcon="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CustomerName" AutoPostBackOnFilter="True" HeaderText="Customer Name"
                                    HeaderStyle-CssClass="order-admin-select-column-header" ItemStyle-CssClass="order-admin-select-column"
                            ShowFilterIcon="False" >
                            <HeaderStyle HorizontalAlign="Center" Width="110px" />     
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CustomerEmail" AutoPostBackOnFilter="True" HeaderText="Customer Email"
                            ShowSortIcon="True" ShowFilterIcon="False" >
                            <HeaderStyle HorizontalAlign="Center" Width="150px" />   
                        </telerik:GridBoundColumn>
                        <telerik:GridDateTimeColumn DataField="OrderDate"  AllowFiltering="True" EnableRangeFiltering="True"  AutoPostBackOnFilter="True" HeaderText="Order Date"
                             ShowSortIcon="True" SortExpression="OrderDate" PickerType="DatePicker" EnableTimeIndependentFiltering="True" FilterListOptions="VaryByDataType"
                             DataFormatString="{0:MM/dd/yyyy}" ShowFilterIcon="False">
                         <HeaderStyle HorizontalAlign="Center" Width="165px" />
                        <ItemStyle HorizontalAlign="Center" />
                       </telerik:GridDateTimeColumn>
                        <custom:FilteringGridBoundColumn UniqueName="OrderStatus" DataField="OrderStatus" HeaderText="Order Status" />
                        <custom:FilteringGridBoundColumn UniqueName="ShippingMethod" DataField="ShippingMethod" HeaderText="Shipping Method" />
                        <custom:FilteringGridBoundColumn UniqueName="ShipmentStatus" DataField="ShipmentStatus" HeaderText="Shipment Status" />
                        <telerik:GridBoundColumn  DataField="OrderTotal" AutoPostBackOnFilter="True" HeaderText="Order Total"
                            DataFormatString="{0:C}" ShowSortIcon="True" ShowFilterIcon="True" ></telerik:GridBoundColumn>                  
                       <telerik:GridTemplateColumn HeaderText="View Detail"  AllowFiltering="False" >
                            <ItemTemplate>
                                <div>
                                    <asp:ImageButton ID="ViewDetailButton" runat="server" ImageUrl="images/mag.png" OnClientClick='<%#String.Format("openRadWin(\"{0}?pstordrnum=\",\"{1}\"); return false;", GetViewDetailPageUrl(), Eval("OrderNumber")) %>' />
                                </div>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="40px" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Return" AllowFiltering="False" Visible="False">
                            <ItemTemplate>
                                <div>
                                    <asp:ImageButton ID="ReturnButton" runat="server" ImageUrl="images/Return.png" Enabled="False" CommandArgument='<%# Eval("OrderId") %>'/>
                                </div>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="50px" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Notes" AllowFiltering="False" Visible="True">
                            <ItemTemplate>
                                <div>
                                    <asp:ImageButton ID="NotesButton" runat="server" ImageUrl="images/Comment.png" Enabled="True" CommandArgument='<%# Eval("OrderId") %>'/>
                                </div>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="60px" />
                        </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn HeaderText ="Process Refund" Visible="False" AllowFiltering="False" >
                           <ItemTemplate>
                                <div>
                                    <asp:ImageButton Visible="False" ID="DoProcessReturn" runat="server" ImageUrl="images/refund.png" Enabled="True" CommandArgument='<%# Eval("OrderId") %>' />
                                </div>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" Width="60px" />
                       </telerik:GridTemplateColumn>
                    </Columns>
                </mastertableview>
            </telerik:RadGrid>
        </div>
        <div class="selbut">
            <asp:Button runat="server" Text="Select All" ID="SelectAllButton" OnClick="SelectAllButton_OnClick" />
            <asp:Button runat="server" Text="Clear Filters" ID="ClearFiltersButton" OnClick="ClearFiltersButton_OnClick"/>
        </div>
        <div>
            <asp:Label runat="server" ID="StatusLabel"></asp:Label>
        </div>
    </telerik:RadAjaxPanel>


Any help would be great!

Thanks

Dash
Dash
Top achievements
Rank 1
 answered on 21 Oct 2013
2 answers
119 views
Is it possible to have a dropdown column, and based on whats chosen in the dropdown column, it then autocompletes a text column within a grid? If so, does anyone have an example on how to do that?
Viktor Tachev
Telerik team
 answered on 21 Oct 2013
1 answer
302 views
As show in real time the number of characters being entered in RadTextBox multline?

Attention! Time typing!
Vasil
Telerik team
 answered on 21 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?