Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
396 views
Hi 
I need to add a context menu to a treeviewcontext menu in asp.net Ajax. either to right on the tree view context or in the Menu format. The details to be bind from database.








Thanks
Boyan Dimitrov
Telerik team
 answered on 28 Jan 2013
5 answers
183 views

I have a grid with Auto Generate Columns at run time and Multi Row Selection:


<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="True"

       oncolumncreated="RadGrid1_ColumnCreated">

       <ClientSettings>

             <Selecting AllowRowSelect="True" />

       </ClientSettings>

       <MasterTableView DataKeyNames="InventarioID" GroupLoadMode="Client">

             <Columns>

                    <telerik:GridClientSelectColumn UniqueName="SelectColumn"/>

             </Columns>

       </MasterTableView>

</telerik:RadGrid>

C#:

protected void Page_Load(object sender, EventArgs e)

{

       string _anno = StringHelpers.Right(DateTime.Today.Year.ToString(), 2);

       RadGrid1.DataSource = new DataClaseDataContext().MyTable.Select(s => new {....my fields...});

}

protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)

{

       if (e.Column is GridBoundColumn)

       {

             ((GridBoundColumn)e.Column).DataFormatString = "<nobr>{0}</nobr>";

       }

}  


This works well and auto adjusts the column width to content, but this functionality is lost when grouped.


<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="True"

                    oncolumncreated="RadGrid1_ColumnCreated">

       <ClientSettings>

             <Selecting AllowRowSelect="True" />

       </ClientSettings>

       <MasterTableView DataKeyNames="InventarioID" GroupLoadMode="Client">

             <Columns>

                    <telerik:GridClientSelectColumn UniqueName="SelectColumn"/>

             </Columns>

             <GroupByExpressions>

                    <telerik:GridGroupByExpression>

                           <SelectFields>

                                  <telerik:GridGroupByField FieldName="Area"/>

                           </SelectFields>

                           <SelectFields>

                                  <telerik:GridGroupByField FieldName="AreaDescription"

HeaderText=" " HeaderValueSeparator="" />

                           </SelectFields>

                           <GroupByFields>

                                  <telerik:GridGroupByField FieldName="Area"/>

                           </GroupByFields>

                    </telerik:GridGroupByExpression>

             </GroupByExpressions>

       </MasterTableView>

</telerik:RadGrid>  


Any help?


Eyup
Telerik team
 answered on 28 Jan 2013
1 answer
82 views
Hi,

How can override default editor style with our own colors/images?
We are using moss radeditor latest version. We require outlook kind of stylesheet.css and  we can use in our own skin assembly just like we have used for other telerik controls(radgrid,tabstrip etc).
We have not found such resource  for moss radeditor.

Can you provide us the stylesheet for radeditor or skin file ?


Thanks,
Ankit Trivedi


Rumen
Telerik team
 answered on 28 Jan 2013
1 answer
131 views
I have a RadComboBox that has a single templated item that is a RadTreeView.

I'm looking for suggestions about how I might go about giving the RadTreeView keyboard focus when the RadCombobox's dropdown is opened.

Assume my markup is simpliar to this ...
<telerik:RadComboBox runat="server"
                     ID="RadComboBox1"
                     AutoPostBack="false"
                     AccessKey="V"
                     OnClientFocus="ComboFocus"
                     OnClientDropDownOpened="DropDownOpened">
    <ItemTemplate>
        <telerik:RadTreeView ID="RadTreeView1"
                             runat="server"
                             CausesValidation="false">
            <Nodes
                <telerik:RadTreeNode Text="Node 1" Value="1" /> 
                <telerik:RadTreeNode Text="Node 2" Value="2" Selected="true" /> 
                <telerik:RadTreeNode Text="Node 3" Value="3" /> 
            </Nodes
        </telerik:RadTreeView>
    </ItemTemplate>
    <Items>
        <telerik:RadComboBoxItem/>
    </Items>
</telerik:RadComboBox>

Where the ComboFocus function simply opens the dropdown.

So, what I'm trying to establish is, is there anyway I can - programmatically - give my treeview control of the keyboard?

--
Stuart


Boyan Dimitrov
Telerik team
 answered on 28 Jan 2013
1 answer
60 views
When using a custom icon for the title icon in a notification it doesnt understand or expand ~ (tilde).
I found this problem in version 2012.3.1308.40.

.aspx/.ascx

    <telerik:RadNotification runat="server" ID="rNotify" ClientIDMode="Static" VisibleOnPageLoad="false"
        Animation="Slide" Position="TopCenter" Width="250px" Height="100px" AutoCloseDelay="5000"
        TitleIcon="~/images/etrack1_16x16.png" ContentIcon="">
    </telerik:RadNotification>

For now i have implemented a work around, by simply adding the following to the Page_PreRender method:

        protected void Page_PreRender(object sender, EventArgs e)
        {

            if (this.rNotify.TitleIcon.Contains("~"))
            {
                this.rNotify.TitleIcon = Page.ResolveClientUrl(this.rNotify.TitleIcon);
            }
        }
Marin Bratanov
Telerik team
 answered on 28 Jan 2013
1 answer
362 views
Hi,

We are using Telerik.Web.UI.dll version - 2009.3.1314.20 with visual studio 2008.
Currently our radgrid displays as below. No. of Factories are fixed and Factory names are known before the grid is configured as usual. Since we know the no. of factories and factory names (i.e. column names of the grid) well before we are using a simple DTO structure, a class with the following 5 properties and binding to the radgrid respectively - ItemName, Fac1, Fac2, Fac3, Fac4.

Item Name Factory 1   Factory 2   Factory 3   Factory 4
Item 1 12   13   14   15
Item 2 22   23   24   25
Item 3 32   33   34   35

But recently we have comeup with a new requirement that there will be a factory added on a regular basis, may be one factory per month / 2 months and we don't want to modify the code everytime when a factory is added. In this case, how can we modify the radgrid to meet this requirment ? Assuming that "Factory 5" is added next month and the output should be displayed as below. 

Item Name Factory 1   Factory 2   Factory 3   Factory 4 Factory 5
Item 1 12   13   14   15 16
Item 2 22   23   24   25 26
Item 3 32   33   34   35 36

So we don't know the no. of columns and column names during design time. I think single level DTO structure will not be sufficient. Can we use a two level DTO as below ? If yes, how can we bind a two level DTO to a grid ? How can we mention the "datafield" name while configuring a grid column using the two level DTO ?
Or can we add properties (factorynames) to a class dynamically in .NET 3.5 ?
Do we have any demo samples on this kind of behaviour ?
Any help on this is very much appreciated.

public class ItemFactoryDTO
    {
         
        [DataMember]
        public long ItemId
        { get; set; }
         
        [DataMember]
        public long ItemName
        { get; set; }
         
        [DataMember]
        public ICollection<FactoryQuantityDTO> factoryQuantityDTOs
        { get; set; }
        
    }
 
public class FactoryQuantityDTO
  {
    
    [DataMember]
    public string FactoryName { get; set; }
 
    [DataMember]
    public int? FactoryQuantity { get; set; }
 
  }


Antonio Stoilkov
Telerik team
 answered on 28 Jan 2013
2 answers
82 views
Hi Team,

Thank you for the amazing code snippets on client side binding, was able to implement it quickly. But I'm facing an issue on adding a new row to the grid. On creating a new row, client binding code is called to fetch all the rows and bind it again to the
grid.

ServiceNamespace.Service1.GetData(param1, param2, updateGrid);

//callback

 function updateGrid(result) {

  var tableView = $find("<%= Grid1.ClientID %>").get_masterTableView();    

  tableView.set_dataSource(result);

  tableView.dataBind();  




 

 


Bindu
Top achievements
Rank 1
 answered on 28 Jan 2013
7 answers
198 views
The 'Columns' property on all my RadInputBox's are no longer working. I have just upgraded to the latest version. I have a huge application and cannot override per page. All the text boxes on the page are now the same size. What do I need to do in order to have the 'columns' property working again.

Thanks,
Susan
Princy
Top achievements
Rank 2
 answered on 28 Jan 2013
1 answer
688 views
Hi, everybody!
I have a problem. When I click cell in radgrid,I want to call a function in codebehind and set value to this function. When selected row, I had cell value, but I can't call fuction in code behind.
Have you any ideas?
Thanks!
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BCKD9.ascx.cs" Inherits="BCKD_Web.Control.BCKD9" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
          var maNV = null;
          function rowSelected(sender, args) {           
            var MasterTableView = sender.get_masterTableView();
            var row = MasterTableView.get_selectedItems()[0];          
            maNV = MasterTableView.getCellByColumnUniqueName(row, "MA_DV");            
            var strMA_CTO = maNV.innerHTML;           
            alert(strMA_CTO);                    
        }           
        
    </script>
</telerik:RadCodeBlock>
<div style="width: 100%; height: 100%">
    <table style="width: 100%; height: 100%">
        <tr style="width: 100%; height: 100%">
            <td style="width:100%; height: 100%">
                <telerik:RadGrid ID="rgdBieu8" runat="server" GridLines="None"
                    AutoGenerateColumns="False" ShowFooter="true"
                    AllowMultiRowSelection="True" Skin="Windows7"
                    onitemevent="rgdBieu8_ItemEvent">
                    <MasterTableView ClientDataKeyNames="MA_DV" Width="100%">
                        <Columns>
                            <telerik:GridBoundColumn HeaderText="Mã đơn vị" DataField="MA_DV" UniqueName="MA_DV"
                                HeaderStyle-Width="10%">
                                <HeaderStyle Width="10%" HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Tên đơn vị" DataField="TEN_DV" UniqueName="TEN_DV" FooterText="Tổng"
                                HeaderStyle-Width="20%">
                                <HeaderStyle Width="20%" HorizontalAlign="Center" Font-Bold="True"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Left" Font-Underline="true"/>
                                <FooterStyle HorizontalAlign="Left" Font-Bold="true"/>
                            </telerik:GridBoundColumn>                                          
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowColumnsReorder="false" ReorderColumnsOnClient="true" EnableRowHoverStyle="true">
                        <Selecting AllowRowSelect="true" />
                        <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                        <ClientEvents OnRowSelected="rowSelected" />
                    </ClientSettings>
                </telerik:RadGrid>
            </td>
        </tr>
    </table>
</div>
Shinu
Top achievements
Rank 2
 answered on 28 Jan 2013
1 answer
94 views
Hi is there a technique to overstrike the contents of cell when exporting to excel using excelml format? 

I see it's fairly simply to set the text to bold or underline but have not found/figured out a way to set overstrike.

Any help would be appreciated.

Thanks,
Dan
Princy
Top achievements
Rank 2
 answered on 28 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?