Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
188 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
198 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
87 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
483 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
88 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 objnew 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
182 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
2 answers
184 views
Hello,

I've built a "portal" interface, combining dynamic TabStrip and RadDockLayout/Zone/Dock controls, fed from a database.

When the user clicks on a different tab, I want to show a different set of docks.  On the postback, though, the docks from the soon-to-be-previous tab are still in viewstate and get reattached to their Zones.  I added a method to clear them:

    ''' <summary> 
    ''' Clear all docks from a given raddocklayout 
    ''' </summary> 
    ''' <param name="rdLayout">given raddocklayout</param> 
    ''' <remarks></remarks> 
    Public Sub ClearAllDocks(ByVal rdLayout As RadDockLayout) 
        Dim rdZones As ReadOnlyCollection(Of RadDockZone) = rdLayout.RegisteredZones() 
        For Each rdZone As RadDockZone In rdZones 
            rdZone.Docks.Clear() 
            'For Each rdDock As RadDock In rdZone.Docks() 
            '    rdDock.Closed = True 
            'Next 
        Next 
    End Sub 

The .Clear() method isn't working.  It just plain doesn't clear the Zone.  The Docks are still there, before and after the .Clear() call.

I changed to the (commented out) .Closed = True option, but that seems slow and klunky to me. 

a) is there a reason that .Clear() wouldn't work?  I do realize I'm using a readonly collection to access them, but RegisteredZones only returns readonly. 

b) is there a better way of clearing all the Docks in a Layout? 

Thanks!
skysailor
Top achievements
Rank 1
 answered on 19 Nov 2009
2 answers
229 views
Hi All. Is it possible to change the EditText on a GridEditCommandColumn to a different value for each row? For example, I'd like to enter edit mode by click on a persons name. I'm doing all this in the code behind (C#). I can set the 'text' property but then I loose the link button. Thanks.

Daniel
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 19 Nov 2009
2 answers
367 views
Hi,
I am using Telerik RadControls for ASPNET AJAX Q3 2008 on my current project.

I would like to disable the zebra effect on the grid on one of the web forms.

According to http://www.telerik.com/help/aspnet-ajax/grdcreatingnewskins.html I can do so by setting the ClientSettings -> EnableAlternatingItems property of the grid to false.

However the property does not seem to exist, and it is not possible to do this 

1. At design-time as follows:
    <telerik:RadGrid ID="radGrid" runat="server">
        <ClientSettings EnableAlternatingItems="false">
            <Scrolling UseStaticHeaders="true" />
        </ClientSettings>
    </telerik:RadGrid>

2. Programmatically as follows:
    this.radGrid.ClientSettings. EnableAlternatingItems  = false;

Can you please tell me how to do this?

Thanks & regards,
Herman Gouw
Herman Gouw
Top achievements
Rank 2
 answered on 19 Nov 2009
3 answers
177 views
Hi

I want to look like Sub tabs as looking in attachment. Now my Sub tabs are looking same as Main tabs. Any one can help?

Thanks
Muhammad Imran
Top achievements
Rank 1
 answered on 19 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?