Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
101 views
Hi,

Can any one please help on Exporting the radscheler appointments to an ics format?
I know we can do a pdf format using below
 <ExportSettings OpenInNewWindow="True">
                    <Pdf AllowCopy="True" />
                </ExportSettings>

But would like to know same for ICS
Boyan Dimitrov
Telerik team
 answered on 09 Sep 2013
1 answer
57 views
Hi Telerik,

Tried inserting appointments to my radscheduler and its getting inserted to previous day of the actual appointment.

Suppose If I try to insert an appointment foe Sep4th , I can see the aptmt getting inserted on Sep3rd. What would be the cause? Please help me on this. 
Plamen
Telerik team
 answered on 09 Sep 2013
5 answers
146 views
I've just realised that when hovering over a Main Menu item, the Sub Menu items don't appear in IE 10. I've tested with IE8 and Chrome and the Sub Menu items appear.
I have removed all my css from the RadMenu and it still doesn't seem to show in IE10.
I am using version 2013.2.611.45 of the Telerik.Web.UI dll.

A very simple example where it is not showing is:

<div style="height:20%;padding-top:51px;width:100%;">
        <telerik:RadMenu  CollapseAnimation-Duration="2000" ExpandAnimation-Duration="2000"  ID="RadMenu1" Style="float:right;" Flow="Horizontal" runat="server">
          
       <Items>
           <%--when moving the order of these items, make sure you update the Enum in code--%>
           <telerik:RadMenuItem Text="menu 1"></telerik:RadMenuItem>
           <telerik:RadMenuItem Text="menu 2"></telerik:RadMenuItem>
           <telerik:RadMenuItem Text="menu 3"></telerik:RadMenuItem>
           <telerik:RadMenuItem Text="menu 4"></telerik:RadMenuItem>
           <telerik:RadMenuItem Text="menu 5"></telerik:RadMenuItem>              
           <telerik:RadMenuItem Selected="true" Text="menu 6">             
               <Items>
                                           
                   <%--when moving the order of these items, make sure you update the Enum in code--%>
                   <telerik:RadMenuItem Text="Admin 1"></telerik:RadMenuItem>
                   <telerik:RadMenuItem Text="Admin 2"></telerik:RadMenuItem>
                   <telerik:RadMenuItem Text="Admin 3" ></telerik:RadMenuItem>
                   <telerik:RadMenuItem Text="Admin 4" ></telerik:RadMenuItem>
               </Items>
           </telerik:RadMenuItem>
       </Items>
   </telerik:RadMenu>
    </div>
David
Top achievements
Rank 1
 answered on 09 Sep 2013
1 answer
200 views
Testing out the abilities of the RadDockLayout control to persist state using EnableLayoutPersistence='True', and I've run into a bit of a snag..setting LayoutPersistenceRepositoryType='Custom' causes the following error in VS 2010 when debugging:

An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

However setting the property to Cookies, FileSystem or None allows the page to load correctly.  The ASPX code I'm using to test comes straight from Telerik's example (http://www.telerik.com/help/aspnet-ajax/introduction.html):

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<html lang="en">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadDockLayout runat="server" ID="RadDockLayout1" EnableLayoutPersistence="true"
        LayoutPersistenceRepositoryType="Custom" LayoutRepositoryID="CustomLayout">
        <telerik:RadDockZone runat="server" ID="RadDockZone1" Width="300" MinHeight="200">
            <telerik:RadDock runat="server" ID="RadDock1" Title="RadDock 1" Width="300">
            </telerik:RadDock>
            <telerik:RadDock runat="server" ID="RadDock2" Title="RadDock 2" Width="300">
            </telerik:RadDock>
        </telerik:RadDockZone>
        <telerik:RadDockZone runat="server" ID="RadDockZone2" Width="300" MinHeight="200">
        </telerik:RadDockZone>
    </telerik:RadDockLayout>
    </form>
</body>
</html>

There is no code-behind other than the page_init and the framework of the implemented IStateStorageProvider. 

I'm stumped.  I rebooted to see is Win7 wasn't flaked out, but even that didn't work.  If I can supply any other info please let me know.

Todd
Slav
Telerik team
 answered on 09 Sep 2013
3 answers
128 views
In my page, I have a radtabstrip which contains a user control in it. In user control, i have a jquery method for textbox onchange. In this onchange event, I am setting hidden field value which I need in my parent page. This is working fine if I changed the text and click on anywhere on the page or on focus change. But if I changed the textbox(without clicking anywhere on page/without changing focus) and click on radtab its not firing. The problem is in IE. It's working fine in Chrome and Mozilla.
Nencho
Telerik team
 answered on 09 Sep 2013
1 answer
56 views
Hi,

I will be using version 2013 2 717 of the ASP.NET for AJAX controls.

Q.  Can you tell me what you officially support with regards to resizing RadDocks that have their DockMode set to Docked?

Q.  From reading various forum posts, it seems that the resize feature is only "officially supported" when the docks are floating.  Is that correct?  I've seen javascript workarounds for when RadDocks are docked, but when I implement the workarounds I still encounter minor bugs that would prevent me from using the workarounds.

Q.  Do you know if you plan to support height and width resizing RadDocks that have their DockMode set to Docked in the future?

Thanks,
Brent
Slav
Telerik team
 answered on 09 Sep 2013
1 answer
92 views
In my application, it will pop up a radwindow when user add/edit record.
And I want to databind a combox from a string, but my code not working.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Allowance.aspx.vb" Inherits="Payroll_Allowance" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
 
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" Height="100%" Orientation="Horizontal">
 
        <telerik:RadPane ID="rpContent" runat="server">
 <asp:Panel ID="Panel1" runat="server" Width="100%"  CssClass=thePanel>
        <asp:Table ID="Table0" runat="server" Height="100%">
            <asp:TableRow>
                <asp:TableCell Font-Bold="true" font-size="10pt" CssClass=theHead>
        Payroll Allowance  
                </asp:TableCell>
            </asp:TableRow>
        </asp:Table>
    </asp:Panel>
    <telerik:RadToolBar ID="rtbMain" runat="server" Width="100%">
    <Items>
    <telerik:RadToolBarButton Width="80px" Value="Add" Text="Add" CausesValidation="false"></telerik:RadToolBarButton>
    <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton>
  <%--  <telerik:RadToolBarButton Width="80px" Value="Edit" Text="Edit" CausesValidation="false" Enabled=false></telerik:RadToolBarButton>
    <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton>
    <telerik:RadToolBarButton Width="80px" Value="Delete" Text="Delete" CausesValidation="false" Enabled=false></telerik:RadToolBarButton>
    <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton>
  --%> 
    <telerik:RadToolBarButton Width="80px" Value="Report" Text="Report" visible=false CausesValidation="false"></telerik:RadToolBarButton>
    <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton>
     
    </Items>
    </telerik:RadToolBar>
    <div id="printarea">
    <asp:Table ID="tblHistory" width=800px runat="server" >
    <asp:TableRow>
    <asp:TableCell>
    <asp:Table ID="Table1" runat="server" Width=650 BorderStyle=None>
    <asp:TableRow>
    <asp:TableCell CssClass=fieldheader Width=150>Staff Name</asp:TableCell>
    <asp:TableCell Width=250><asp:Label ID="lbStaffName" runat=server></asp:Label></asp:TableCell>
    <asp:TableCell CssClass=fieldheader Width=150>Staff No.</asp:TableCell>
    <asp:TableCell Width=250><asp:Label ID="lbStaffNo" runat=server></asp:Label></asp:TableCell>
 
    </asp:TableRow>
    </asp:Table>
    </asp:TableCell>
    </asp:TableRow>
    </asp:Table>
    <br />
    <telerik:RadGrid ID="rgAllowance" runat="server" DataSourceID="ldsAllowance"
                    GridLines="None" Width="800px" AllowSorting="True" AutoGenerateColumns="false" AllowFilteringByColumn="false" ShowGroupPanel=false ShowFooter="False"
                    AllowPaging="True" PageSize="15">
                    <PagerStyle Position="TopAndBottom" />
                     
        <ClientSettings EnablePostBackOnRowClick="True" AllowColumnsReorder="True" AllowDragToGroup="false" ReorderColumnsOnClient="True">
            <Selecting AllowRowSelect="True" />            
        </ClientSettings>
           
         
                    <MasterTableView DataSourceID="ldsAllowance" DataKeyNames="AllowanceID" >
                        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="10px"></HeaderStyle>
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="10px"></HeaderStyle>
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridBoundColumn DataField="AllowanceID" HeaderText="Allowance ID" ReadOnly="True"
                                SortExpression="AllowanceID" UniqueName="AllowanceID" Visible=false>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PPSCompanyCode" HeaderText="Allowance Code" ReadOnly="True"
                                SortExpression="PPSCompanyCode" UniqueName="PPSCompanyCode"><ItemStyle Font-Underline="True" BackColor=White ForeColor="Blue" BorderColor=ActiveBorder/>
                            </telerik:GridBoundColumn>                           
                            <telerik:GridBoundColumn DataField="EntitleFrom" HeaderText="Entitle From" ReadOnly="True"  DataFormatString="{0:dd-MMM-yyyy}"
                                SortExpression="EntitleFrom" UniqueName="EntitleFrom"><ItemStyle BackColor=White  BorderColor=ActiveBorder />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EntitleTo" HeaderText="Entitle To" ReadOnly="True"  DataFormatString="{0:dd-MMM-yyyy}"
                                SortExpression="EntitleTo" UniqueName="EntitleTo"><ItemStyle BackColor=White BorderColor=ActiveBorder/>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AllowanceAmount" HeaderText="Remarks" ReadOnly="True" DataFormatString="{0:N}"
                                SortExpression="AllowanceAmount" UniqueName="AllowanceAmount"><ItemStyle BackColor=White BorderColor=ActiveBorder/>
                            </telerik:GridBoundColumn>
                            
 
 
                            </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
    </div>
        </telerik:RadPane>
    </telerik:RadSplitter>
    <telerik:RadWindow ID="RadWindow1" runat="server" Width="580px" Height="300px" Behaviors="Close"
        Title="Add/Modify Payroll Allowance" >
        <ContentTemplate>
            <asp:Table ID="Table2" runat="server" Width="100%" Height="100%">
                
                <asp:TableRow >
                <asp:TableCell CssClass="editheader">Allowance Code: </asp:TableCell>
                <asp:TableCell>
                    <telerik:RadComboBox ID="dfAllowanceCode" runat="server" Width="250px"
                    AppendDataBoundItems="true" AutoPostBack="true"
                    OnDataBound="dfAllowanceCode_DataBound">
                     <Items>
                        <telerik:RadComboBoxItem Text="--Select--" Value="" />
                    </Items>
                    </telerik:RadComboBox>
 
                </asp:TableCell>
                  </asp:TableRow>
 
                <asp:TableRow>  
                    <asp:TableCell CssClass="editheader">Entitle From: </asp:TableCell>
                    <asp:TableCell>
                        <asp:HiddenField ID="dfAllowanceID" Value="0" runat="server" />
                        <telerik:RadDatePicker ID="dfStartDate" runat="server" Width="150px" DateInput-DateFormat="dd-MMM-yyyy" Enabled=false>
                        </telerik:RadDatePicker>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="* Required"
                            ControlToValidate="dfStartDate"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell CssClass="editheader">Entitle To: </asp:TableCell>
                    <asp:TableCell>
                       <telerik:RadDatePicker ID="dfEndDate" runat="server" Width="150px" DateInput-DateFormat="dd-MMM-yyyy" Enabled=false>
                        </telerik:RadDatePicker>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="* Required"
                            ControlToValidate="dfEndDate"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell CssClass="editheader">Amount: </asp:TableCell>
                    <asp:TableCell>
                        <telerik:RadNumericTextBox  ID="dfAmount" runat="server" Width="400px" Height="50px" Enabled="false"
                        NumberFormat-DecimalDigits="2" >
                        </telerik:RadNumericTextBox >
                    </asp:TableCell>
                </asp:TableRow>
 
                <asp:TableRow>
                    <asp:TableCell BackColor="#EEEEEE" ColumnSpan="2" HorizontalAlign="Center">
                        <asp:Button ID="btnSave" runat="server" Text="Save" Width="80px" />  
                        <asp:Button ID="btnDelete" runat="server" Text="Delete" Width="80px" CausesValidation="false" />
                        <asp:Button ID="btnCancel" runat="server" Text="Close" Width="80px" CausesValidation="false" />
                    </asp:TableCell>
                </asp:TableRow>
            </asp:Table>
        </ContentTemplate>
    </telerik:RadWindow>
 
    <asp:LinqDataSource ID="ldsAllowance" runat="server" ContextTypeName="dcHRISDataContext"
        OrderBy="EntitleFrom desc,AllowanceID desc"
        TableName="HRIS_PPSAllowances" Where="SID==@SID">
         <WhereParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="SID" QueryStringField="SID"
                Type="Int32" />               
        </WhereParameters>
    </asp:LinqDataSource>
 
    </form>
</body>
</html>

Code Behind:

Protected Sub dfAllowanceCode_DataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxItemEventArgs) Handles dfAllowanceCode.DataBound
    dfAllowanceCode.Items.Clear()
  
    Dim S As String = "PPS123, PPS22323, PPS5454, PPS1231"
    Dim arrayvalue As String() = S.Split(","c)
 
    For i As Integer = 0 To arrayvalue.Length - 1
        dfAllowanceCode.Items.Add(New Telerik.Web.UI.RadComboBoxItem(arrayvalue(i).ToString(), i))
    Next
 
End Sub








Nencho
Telerik team
 answered on 09 Sep 2013
1 answer
71 views
Hello,
I currently have a hierarchical grid where I need to selectively hide certain columns and prevent it from appearing in Add/Edit form. I am able to selectively hide the column but was not able to prevent it from appearing in the Edit Form when user click on Add or Edit

Here is the snippet of one of columns that I need to hide programatically. Note that I am not using GrodBoundColumn and most of my columns are using GridTemplateColumn with ItemTemplate and EditItemTemplate as shown below
<telerik:GridTemplateColumn UniqueName="WellnessFactor" HeaderText="Wellness Factor<span style='color:#CD4800'>*</span>">
      <ItemTemplate>
          <%#DataBinder.Eval(Container.DataItem, "WellnessFactor")%>
      </ItemTemplate>
      <EditItemTemplate>
          <telerik:RadComboBox ID="WellnessFactorComboBox" runat="server" AllowCustomText="false"
              AutoPostBack="false" CausesValidation="false" DataTextField="WellnessFactor"
              DataValueField="WellnessFactor" EmptyMessage="Please Select..." EnableVirtualScrolling="true"
              Height="45px" MarkFirstMatch="true" NoWrap="True" Skin="WebBlue" Width="150px">
              <Items>
                  <telerik:RadComboBoxItem Text="Yes" Value="Yes" />
                  <telerik:RadComboBoxItem Text="No" Value="No" />
              </Items>
          </telerik:RadComboBox>
          <asp:RequiredFieldValidator ID="ValidateWellnessFactorComboBox" runat="server" ControlToValidate="WellnessFactorComboBox"
              ValidationGroup="SubscriberGroup" ErrorMessage="*This field is required" ForeColor="Red"
              InitialValue="">
          </asp:RequiredFieldValidator>
      </EditItemTemplate>
  </telerik:GridTemplateColumn>

Here is the snippet of code use to hide the column

protected void RadGrid1_OnPreRender(object sender, EventArgs e)
{
    if (listHideColumn.Count > 0)
    {
        foreach (GridColumn column in RadGrid1.Columns)
        {
            foreach (string columnName in listHideColumn)
            {
                if (column.UniqueName == columnName)
                {
                    column.Visible = false;
                    //(column as GridBoundColumn).Visible = false;
                    break;
                }
            }
        }
    }
}

Most of the solution I found online is to make the column readonly. But I am not using GridBoundColumn. Is there a way to prevent it from appearing it in Edit Form when user click on Add or Edit since they are not visible on the Grid. Note that I am using auto generating form.

Your help in resolving this will be greatly appreciated.

Thank you.

-Yoong
Shinu
Top achievements
Rank 2
 answered on 09 Sep 2013
5 answers
155 views
Hi Telerik.

I was looking in forums for excel 2010 support in Telerik Rad Grid.
As currently when we export to excel it prompts following message:

The file you are trying to open, '[filename].xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?

Which users find annoying. When I was going through  forums I had read that you are going to add support for excel 2010 in Q3-Q4 2012.
However didn't find any concrete answers yet on this release.

Could you please let us know whether the support for excel 2010 has been released for Telerik Rad Grid which will also suppress above message?

Thanks,
Aditi
Kostadin
Telerik team
 answered on 09 Sep 2013
1 answer
200 views
Hello Telerik Team,

I am having a problem when rebind the grid on second time with same data source . Everything is same . When first time i call the Rebind function it works fine but on second time it throws Syntax error: Missing operand before 'is' operator. Please help me.

Here is my code
Aspx file
 <telerik:RadGrid ID="rdGridDetailTable" runat="server" AllowSorting="true" Height="400px"
                                                                                    GridLines="both" AutoGenerateColumns="false" OnDetailTableDataBind="rdGridDetailTable_DetailTableDataBind"
                                                                                    OnNeedDataSource="rdGridDetailTable_NeedDataSource" AutoGenerateHierarchy="true"
                                                                                    MasterTableView-ExpandCollapseColumn-HeaderStyle-Width="30px">
                                                                                    <MasterTableView>
                                                                                    </MasterTableView>
                                                                                    <ClientSettings>
                                                                                        <Scrolling AllowScroll="True" SaveScrollPosition="True"></Scrolling>
                                                                                    </ClientSettings>
                                                                                    <HeaderStyle CssClass="HeaderRow" />
                                                                                    <CommandItemStyle BorderColor="#003399" BorderStyle="Solid" BorderWidth="1px" />
                                                                                    <FilterMenu EnableImageSprites="False">
                                                                                    </FilterMenu>
                                                                                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                                                                                    </HeaderContextMenu>
                                                                                </telerik:RadGrid>

aspx.cs


   #region Show Graphs
        private void ShowTable(string value)
        {
                    chartHolder.Controls.Clear();
                    DataSet ds = CalculateAttractivity();
                    PopulateTable(ds.Tables[0], ds.Tables[1]);
                    break;
            
        }
        #endregion


        #region populate table
        private void PopulateTable(DataTable dtData, DataTable dtDataDetails)
        {
            if (GridStructure == false)
            {
                DefineGridStructure(dtData, dtDataDetails);
            }
            trUserDataArea1.Style.Add(" background-color", GraphMin.BackColor.ToString());
            tblDetails.Style.Add("display", "block");
            tblDetails.Visible = true;
            chartHolder.Visible = false; //showing chart 
            Attractivity = dtData;
            AttractivityDetails = dtDataDetails;
            rdGridDetailTable.Rebind();
        }
        #endregion

 #region RadGrid Structure
        private void DefineGridStructure(DataTable dtData, DataTable dtDetail)
        {
            SystemLocalizationBO systemLocalizationBO = new SystemLocalizationBO(true);
            SystemSession sys = hdr.SysSession;
            var weight = SessiontblComponentModel1.Rows.Cast<DataRow>().Select(row => row[10].ToString()).ToArray();
            rdGridDetailTable.Columns.Clear();
            rdGridDetailTable.MasterTableView.Columns.Clear();
            rdGridDetailTable.MasterTableView.DataKeyNames = new string[] { dtData.Columns[0].ColumnName };
            rdGridDetailTable.Width = Unit.Percentage(98);
            rdGridDetailTable.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
            rdGridDetailTable.MasterTableView.DataMember = "Table";
            rdGridDetailTable.AutoGenerateColumns = false;
            string strTable = "<table><tr><td>";
            //Add columns
            int Count = 0;
            foreach (DataColumn dc in dtData.Columns)
            {
                strTable = "<table><tr><td>";
                GridBoundColumn boundColumn;
                boundColumn = new GridBoundColumn();
                boundColumn.DataField = "[" + dc.ColumnName + "]";

                if (Count > 2)
                {
                    strTable = strTable + dc.ColumnName + "</td></tr><tr><td>";
                    strTable = strTable + weight[Count - 3] + "</td></tr></table>";
                    boundColumn.HeaderStyle.Width = 10;
                    boundColumn.HeaderText = strTable;
                    boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    boundColumn.HeaderStyle.VerticalAlign = VerticalAlign.Middle;
                }
                else
                {
                    
                    boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    boundColumn.HeaderStyle.VerticalAlign = VerticalAlign.Middle;
                    if (Count == 1)
                    {
                        strTable = strTable + dc.ColumnName + "</td></tr><tr><td>";
                        strTable = strTable + systemLocalizationBO.GetErrorMessage(31075, sys.CurrentUserLanguage.ToString()) + "</td></tr></table>";
                        boundColumn.HeaderText = strTable; 
                    }
                    else
                    {
                        strTable = strTable + dc.ColumnName + "</td></tr><tr><td>";
                        strTable = strTable  + "&nbsp;</td></tr></table>";
                        boundColumn.HeaderText = strTable;
                    }
                }
                rdGridDetailTable.MasterTableView.Columns.Add(boundColumn);
                Count++;
            }
            //Detail table - Orders (II in hierarchy level)
            GridTableView tableViewOrders = new GridTableView(rdGridDetailTable);
            tableViewOrders.Columns.Clear();
            tableViewOrders.Width = Unit.Percentage(100);
            tableViewOrders.DataKeyNames = new string[] { dtData.Columns[0].ColumnName };
            tableViewOrders.DataMember = "Table";
            GridRelationFields relationFields = new GridRelationFields();
            tableViewOrders.ParentTableRelation.Add(relationFields);
            relationFields.MasterKeyField = dtData.Columns[0].ColumnName;
            relationFields.DetailKeyField = dtData.Columns[0].ColumnName;
           
            rdGridDetailTable.MasterTableView.DetailTables.Add(tableViewOrders);
            //Add columns
            Count = 0;
            foreach (DataColumn dc in dtDetail.Columns)
            {
                GridBoundColumn boundColumn;
                boundColumn = new GridBoundColumn();
                boundColumn.DataField = "[" + dc.ColumnName + "]";
                boundColumn.HeaderText = dc.ColumnName;
                if (Count == 0)
                {
                    boundColumn.Visible = false;
                }
                tableViewOrders.Columns.Add(boundColumn);
                Count = 1;
            }
            GridStructure = true;
        }
        #endregion

   protected void rdGridDetailTable_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (Attractivity != null)
            {
                rdGridDetailTable.DataSource = Attractivity;
                rdGridDetailTable.MasterTableView.DetailTables[0].DataSource = AttractivityDetails;
            }
        }


protected void rdGridDetailTable_DetailTableDataBind(object sender, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            try
            {
                GridDataItem parentItem = e.DetailTableView.ParentItem as GridDataItem;
                if (parentItem.Edit)
                {
                    return;
                }
                if (parentItem.GetDataKeyValue(AttractivityDetails.Columns[0].ColumnName).ToString() != string.Empty)
                {
                    e.DetailTableView.DataSource = AttractivityDetails.Select(AttractivityDetails.Columns[0].ColumnName + " = '" + parentItem.GetDataKeyValue(AttractivityDetails.Columns[0].ColumnName).ToString() + "'").CopyToDataTable();
                }
                
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

Thanks in advance

Nishant Mittal
Kostadin
Telerik team
 answered on 09 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?