Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
349 views
Hello,

I am trying to create a dynamic tabstrip/multipage section of a page, where the tabs and radpageview instances are database driven. It is easy to bind the tabstrip to a data source, but I am really struggling with how to get a dynamic RadMultiPage. Because the content of each RadPageView is non-trivial, I do not want to build up the entire page view in code and would much rather use the templating capability of Repeater to do the heavy lifting.

But no matter how I play with the code, I cannot get it to do the right thing. I would like to have something like this:

<telerik:RadTabStrip ID="FormulaTabs" runat="server" MultiPageID="FormulaContexts" 
DataSourceID="ContextSource" DataTextField="qualifiedContextName" />

<telerik:RadMultiPage ID="FormulaContexts" runat="server">
<asp:Repeater ID="FormulaRepeater" runat="server" DataSourceID="ContextSource">
<ItemTemplate>
<telerik:RadPageView ID="FormulaPageSample" runat="server">
<asp:Label ID="Label2" runat="server" Text='<%# Eval("qualifiedContextName") %>' />
</telerik:RadPageView>
</ItemTemplate>
</asp:Repeater>
</telerik:RadMultiPage>

The goal is for the RadPageView to have content specific to the data source in the repeater and that, since the tabstrip is using the same data source and is pointing to the RadMultiPage, that the tabs would flip to the correct data. Of course, in the snippet above, VS complains because Repeater is not a recognized child element of RadMultiPage, and RadPageView is not a recognized child of Repeater. Putting RadMultiPage into the repeater's header template is equally invalid.

Is this at all possible?

Thanks, in advance,

Tom Otvos
Arsen
Top achievements
Rank 1
 answered on 19 Nov 2009
1 answer
91 views
Is it possible to use RadMenu Templates together with a DataSource?

The example uses hard-coded items for the menu.

Can someone provide an example of how to do this, if so?

I'm happy to hear about it if there is another forum post that addresses this, but I haven't found one yet.

Thanks!
Veselin Vasilev
Telerik team
 answered on 19 Nov 2009
1 answer
97 views
Hi,

Can I have an online demo of RADgrid using

RadGrid1.Controls.Add(New LiteralControl("Error. Reason: " + ex.Message));

in try... catch... block in the C# script.

Thanks,

Milind
Rosen
Telerik team
 answered on 19 Nov 2009
1 answer
151 views
Hi I am using RadControls for ASP.NET Q3 2007
I would like to reset (stop and star) a timer whenever any server events (update, insert, cancel delete etc) for a grid take place.
My code is

<radA:RadAjaxManager ID="RadAjaxManager1" runat="server">    
    <AjaxSettings>    
        <radA:AjaxSetting AjaxControlID="ClassUnlockTimer">    
            <UpdatedControls>    
                <radA:AjaxUpdatedControl ControlID="ClassUnlockTimer"/>    
            </UpdatedControls>    
        </radA:AjaxSetting> 
        <radA:AjaxSetting AjaxControlID="RadGrid1">    
            <UpdatedControls>    
                <radA:AjaxUpdatedControl ControlID="ClassUnlockTimer"/>    
            </UpdatedControls>    
        </radA:AjaxSetting> 
    </AjaxSettings>    
</radA:RadAjaxManager>    
 
 
<radA:RadAjaxTimer runat="server" ID="ClassUnlockTimer" AutoStart="false" /> 
<radG:RadGrid ID="RadGrid1" runat="server"  EnableAJAX="True"....  
 

protected void Page_Init(object sender, System.EventArgs e)  
    {  
        ClassUnlockTimer.Tick += new RadAjaxTimer.TickDelegate(timer_Tick);  
        ClassUnlockTimer.Interval = 40000;  
        ClassUnlockTimer.Stop();  
        ClassUnlockTimer.Start();  
    } 

it doesn't restart the timer somehow.
Am I missing something here??

Thanks

Toby
Iana Tsolova
Telerik team
 answered on 19 Nov 2009
1 answer
199 views
I have a grid on I must manage drag drop of a row on another one to know if i must merge theses two rows. On onrowdropping client event, I must know source and destination dataitem. Is it possible ?

Here's the code of my grid

<

telerik:RadGrid ID="Schedule" runat="server" AllowSorting="True" SortingSettings-SortToolTip="<%$ Resources:ToolTipSort %>"

 

 

Skin="Office2007" GridLines="None" AutoGenerateColumns="False">

 

 

<clientsettings AllowRowsDragDrop="True">

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

<Selecting AllowRowSelect="True"/>

 

 

<ClientEvents OnRowDropping="onScheduleRowDropping"/>

 

 

</clientsettings>

 

 

<mastertableview commanditemdisplay="Top" datakeynames="ID" clientdatakeynames="ID"

 

 

gridlines="None" tablelayout="Auto" allowmulticolumnsorting="true">

 

 

<CommandItemTemplate>

 

 

</CommandItemTemplate>

 

 

<GroupByExpressions>

 

 

<telerik:GridGroupByExpression>

 

 

<SelectFields>

 

 

<telerik:GridGroupByField FieldName="DateBegin" FormatString="{0:D}" HeaderText=" "

 

 

HeaderValueSeparator=""></telerik:GridGroupByField>

 

 

</SelectFields>

 

 

<GroupByFields>

 

 

<telerik:GridGroupByField FieldName="DateBegin" SortOrder="Ascending"></telerik:GridGroupByField>

 

 

</GroupByFields>

 

 

</telerik:GridGroupByExpression>

 

 

</GroupByExpressions>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn HeaderText="<%$ Resources:Hour_GridHeader %>" ItemStyle-VerticalAlign="Top"

 

 

HeaderStyle-Width="80px" ItemStyle-Width="80px">

 

 

<ItemTemplate>

 

<%

#DataBinder.Eval(Container.DataItem, "Hours")%>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="<%$ Resources:Description_GridHeader %>"

 

 

ItemStyle-VerticalAlign="Top" HeaderStyle-Width="100%" ItemStyle-Width="100%">

 

 

<ItemTemplate>

 

 

<span style="position: relative; vertical-align: top">

 

 

<asp:Image ID="imgType" runat="server" />

 

 

<asp:Label ID="lblDescription" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Description")%>'></asp:Label>

 

 

</span>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="<%$ Resources:Priority_GridHeader %>" HeaderStyle-HorizontalAlign="Center"

 

 

ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="90px"

 

 

ItemStyle-Width="90px">

 

 

<ItemTemplate>

 

<%

#DataBinder.Eval(Container.DataItem, "PriorityDisplay")%>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn ItemStyle-VerticalAlign="Top" HeaderStyle-Width="60px"

 

 

ItemStyle-Width="60px">

 

 

<ItemTemplate>

 

 

<span id="ActionsToolBar" runat="server" onclick="event.cancelBubble=true;">

 

 

<telerik:RadToolBar ID="ActionsRadToolBar" runat="server" Skin="Office2007" OnClientButtonClicked="ActionsRadToolBar_OnClientButtonClicked" AppointmentId='<%# Eval("ID") %>'>

 

 

<Items>

 

 

<telerik:RadToolBarDropDown runat="server" Text="<%$ Resources:ActionsToolBarMenu %>" Width="100%" Height="18px">

 

 

<Buttons>

 

 

</Buttons>

 

 

</telerik:RadToolBarDropDown>

 

 

</Items>

 

 

</telerik:RadToolBar>

 

 

</span>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn UniqueName="HasWarningUnavailabilityConflict" DataField="HasWarningUnavailabilityConflict"

 

 

Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="HasWarningResourceConflict" DataField="HasWarningResourceConflict"

 

 

Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="AppointmentType" DataField="AppointmentType"

 

 

Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="Priority" DataField="Priority" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="IsFinished" DataField="IsFinished" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="IsCanceled" DataField="IsCanceled" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="FromOldPlanVersion" DataField="FromOldPlanVersion" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="ManualCreation" DataField="ManualCreation" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="VisitType" DataField="VisitType" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn UniqueName="IsUnasigned" DataField="IsUnasigned" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

<NoRecordsTemplate>

 

 

<asp:Literal ID="litNoRecords" runat="server" Text="<%$ Resources:NoRecords %>"></asp:Literal>

 

 

</NoRecordsTemplate>

 

 

</mastertableview>

 

 

</telerik:RadGrid>

And I want in OnRowDropping compare the AppointmentType to see if two rows had the same value

 

Princy
Top achievements
Rank 2
 answered on 19 Nov 2009
1 answer
207 views

Hi,

I've a radcombobox and I set the datasource to a  List<string>

 List<String> obDateItems   = GetDateForSelectedReports();

            m_radFromDateRangeCombo.DataSource  = obDateItems;
            m_radFromDateRangeCombo.DataBind();
            m_radFromDateRangeCombo.SelectedIndex = ???;

I need to set my selectedIndex to the last item in the combobox . how do I do this in c#?Pls help me with code.

Thanks,
ZR

Shinu
Top achievements
Rank 2
 answered on 19 Nov 2009
1 answer
92 views
Hi

Can you suggest what is the simplest way to output grid data to a web service for consumption
by an iphone app?

I am not familiar with iphone programming but I believe the preferred interface is json, although I
think XML is feasible.

Perhaps Telerik might consider specific support for such an interface in the future?

Thanks

Clive

Nikolay Rusev
Telerik team
 answered on 19 Nov 2009
13 answers
497 views
Hello,

I'm trying to integrate your RadGrid control in a DynamicData Entity WebSite using the code I have downloaded from this Blog. In my Entity Model I have basically two Entity Sets: Orders and Customers from the Northwind database. Orders has a foreignkey on the parent table Customers. 

The Orders scaffold table should contain a navigation link to Customers Table. As a matter of fact the databind process fails returning the following exception:

exception

DataBinding: 'NorthwindModel.Orders' does not contain a property with the name 'Customers.CustomerID'.

stacktrace:
   at System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName)
   at System.Web.DynamicData.ModelProviders.TableProvider.EvaluateForeignKey(Object row, String foreignKeyName)
   at System.Web.DynamicData.MetaForeignKeyColumn.GetForeignKeyValues(Object row)
   at System.Web.DynamicData.MetaForeignKeyColumn.GetForeignKeyPath(String action, Object row, String path)
   at System.Web.DynamicData.FieldTemplateUserControl.get_ForeignKeyPath()
   at ForeignKeyField.GetNavigateUrl() in c:\Documents and Settings\Daniele\My Documents\Visual Studio 2008\Projects\DynamicDataRadGridTest\WebSite\DynamicData\FieldTemplates\ForeignKey.ascx.cs:line 59
   at ASP.dynamicdata_fieldtemplates_foreignkey_ascx.__DataBindingHyperLink1(Object sender, EventArgs e) in c:\Documents and Settings\Daniele\My Documents\Visual Studio 2008\Projects\DynamicDataRadGridTest\WebSite\DynamicData\FieldTemplates\ForeignKey.ascx:line 3
   at System.Web.UI.Control.OnDataBinding(EventArgs e)
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()

I have noticed two things:
1) the ForeignKeyField.FieldValue is null
2) the ForeignKeyField.Row is the Entity itself instead of an EntityDataSourceWrapper object

I could correct the first issue adding just a line of code in the Page_Load event handler of the ListDetails.aspx page
protected void Page_Load(object sender, EventArgs e)  
{  
    MetaTable table = GridDataSource.GetTable();  
    Title = table.DisplayName;  
 
    // Includes foreignKey Entities in the EntityDataSource  
    GridDataSource.Include = table.ForeignKeyColumnsNames;  
     
    //...  
} 

but I didn't figure out how to solve the databind issue

Any help is appreciated :)

Kind regards,
Simone

EDIT: I have uploaded my test project here. I hope this will help you to reproduce my problem
Nikolay Rusev
Telerik team
 answered on 19 Nov 2009
1 answer
93 views
Hi this is jewel jose from India.
I am using telerik rad grid for my web application development. Now i am trying to interchange selected data row with two grids using javascript support of the telerik rad grid. Following is the code snippet but i am experiencing some issues, i was able to set datasource for the 2nd grid with data of selected row from the firs grid and bind it also. But the grid is not showing up the data. I am not sure why it is happening so. showMessage is the javascript code that i am using for this.. If any one could please help me to get rid of this issue it will be a great help for me.
<%@ Page Language="VB" MasterPageFile="~/Masters/MFISoftMaster.master" AutoEventWireup="false" CodeFile="AreaOfOperation.aspx.vb" Inherits="Pages_AreaOfOperation" title="Untitled Page" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="CPHMain" Runat="Server"> 
<script language="javascript" type="text/javascript"> 
var obj= new Object(); 
function ShowMessage(sender, args) 
        { 
           var id = args.getDataKeyValue("Addressid"); 
            
           var tableView = $find("<%= Grid1.ClientID %>").get_masterTableView(); 
          //Get the clicked row  
            var index_id = 0; 
            var index = args.get_itemIndexHierarchical();  
            var item = args.get_tableView().get_dataItems()[index];  
            
            var rowElement = item.get_element(); 
            obj.Addressid = id; 
            obj.name = rowElement.innerText; 
            var tableView_temp = $find("<%= RadGrid2.ClientID %>"); 
            tableView_temp._updating = true; 
 
            var tableView1 = $find("<%= RadGrid2.ClientID %>").get_masterTableView(); 
            var data_items = tableView1._dataItems; 
            tableView1.set_dataSource(obj); 
            tableView1.dataBind(); 
             
            data_items = tableView1._dataItems; 
           
            
        } 
        
</script> 
<div style="text-align: center; vertical-align: middle; position: absolute; top: 130px; 
        left: 100px;"> 
        <MFI:PentaPanel ID="pnlContainer" Title="Area Of Operation" runat="Server" RenderNormally="False" 
            CommandPanelId="PnlCommand" Height="340px" Width="850px" ShowPrintIcon="true" 
            PrintIconUrl="~\Includes\Images\print1.ico"> 
            <div style="width: 770px; height: 330px"> 
            <table> 
            <tr align="left"> 
                <td align="left"> 
                  <telerik:RadGrid ID="Grid1" runat="server" AutoGenerateColumns="false"  
                  GridLines="None" ClientSettings-AllowExpandCollapse="true"  
                  ClientSettings-AllowKeyboardNavigation="true" 
                  AutoGenerateDeleteColumn="false" PageSize="15" AutoGenerateEditColumn="false" 
                  Width="300px" Skin="Outlook" Height="300px" EnableViewState="True"> 
                   
                  <ClientSettings Selecting-AllowRowSelect="true" EnableRowHoverStyle="true"> 
                        <ClientEvents OnRowSelected="ShowMessage" /> 
                  </ClientSettings> 
                   
                   <MasterTableView DataKeyNames="Addressid" ClientDataKeyNames="Addressid"> 
                        <RowIndicatorColumn> 
                                <HeaderStyle Width="20px" /> 
                        </RowIndicatorColumn> 
                        <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px" /> 
                        </ExpandCollapseColumn> 
                   <Columns> 
                        <telerik:GridBoundColumn DataField="Addressid" ItemStyle-Width="0PX" Visible="false" UniqueName="Addressid"></telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="name" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left" HeaderText="Name" UniqueName="name"></telerik:GridBoundColumn> 
                   </Columns> 
                   </MasterTableView>  
                  </telerik:RadGrid> 
                </td> 
                <td> 
                     <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="false"  
                  GridLines="None"  
                  ClientSettings-AllowKeyboardNavigation="true" 
                  AutoGenerateDeleteColumn="false" PageSize="15" AutoGenerateEditColumn="false" 
                  Width="300px" Skin="Outlook" Height="300px" EnableViewState="True" 
                  ShowFooter="True" AllowSorting="true"  
                        AllowAutomaticDeletes = "False" AllowAutomaticUpdates ="False"  
                        AllowAutomaticInserts="False" > 
                   
                  <ClientSettings Selecting-AllowRowSelect="true" EnableRowHoverStyle="true"> 
                           <%--<ClientEvents OnRowSelected="ShowMessage" />--%> 
                  </ClientSettings> 
                   
                   <MasterTableView DataKeyNames="branch_oper_districtid" ClientDataKeyNames="branch_oper_districtid"> 
                        <RowIndicatorColumn> 
                                <HeaderStyle Width="20px" /> 
                        </RowIndicatorColumn> 
                        <ExpandCollapseColumn> 
                                <HeaderStyle Width="20px" /> 
                        </ExpandCollapseColumn> 
                   <Columns> 
                        <telerik:GridBoundColumn DataField="Addressid" ItemStyle-Width="0PX" Visible="false" UniqueName="Addressid"></telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="name" ItemStyle-Width="200px" ItemStyle-HorizontalAlign="Left" HeaderText="Name" UniqueName="name"></telerik:GridBoundColumn> 
                   </Columns> 
                   </MasterTableView>  
                  </telerik:RadGrid> 
                </td> 
            </tr> 
            </table> 
            </div> 
        </MFI:PentaPanel> 
    </div> 
</asp:Content> 


Yavor
Telerik team
 answered on 19 Nov 2009
2 answers
191 views
Hi:

I'm wondering if there is a way to hide the context menu using server-side code.  Specifically, If a user is logged in, then when the page loads, they can right-click and see the context menu.  If the user is not logged in, then right-clicking on a node won't do anything.

The context menu is already built at design time. I don't want to re-build the menu at runtime.

Any help on how to ahcieve this is appreciated!

Thanks!
JustinWong
Top achievements
Rank 1
 answered on 19 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?