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

I'm sure you have addressed this somewhere before, but I could not find it.

I am assigning a generic collection as the DataSource of a RadGrid control. The Items in the collection have one member which is also a generic collection which provide the children.

For Example:

public class WorkOrderDetails
{
    protected readonly IWorkOrder _workOrder;
    protected readonly List<ResourceRequirement> _resources = new List<ResourceRequirement>();
    public WorkOrderDetails(IWorkOrder wo)
    {
        _workOrder = wo;
        foreach (IWoResources res in wo.ResourcesChildren)
        {
            _resources.Add(new ResourceRequirement(res));
        }
    }
    public string WoNumber { get { return _workOrder.WoNumber; } }
    public string Title
    {
        get { return _workOrder.Description; }
    }
    public List<ResourceRequirement> Resources
    {
        get { return _resources; }
    }
}
public class ResourceRequirement
{
    private IResources _data;
    public ResourceRequirement(IResources res)
    {
        _data = res;
    }

      //
      // Summary
      //    The Unique ID of this ResourceRequiment (which is a "Skill").
      public string ID { get { return _data.ResourceId; } } 

    //
    // Summary:
    //     The property for the planned_hours column of the TabWare database wo_resources
    //     table.
    public decimal PlannedHours { get { return _data.PlannedHours; } }
    //
    // Summary:
    //     The property for the remaining_hours column of the TabWare database wo_resources
    //     table.
    public decimal RemainingHours { get { return _data.RemainingHours; } }
    //
    // Summary:
    //     The property for the workers column of the TabWare database wo_resources
    //     table.
    public int Workers { get { return _data.Workers; } }
}

The assignment looks something like this:

List<WorkOrderDetails> list = factory.GetWorkOrders();
RadGrid1.DataSource = list;

My goal is to display the Work Orders with the ResourceRequirement children grouped under each WorkOrderDetail line.
For Example:

WoNumber    Title
000010202    Repair light fixture
      ID             Planned Hrs           Remaining Hrs            Workers
      Electician      8.0                         8.0                            1
      Welder          8.0                         8.0                            1

I figured out how to get the headers defined, but I currently have no content showing up for the child rows. Here is my markup:

<telerik:RadGrid
    ID="rgPlannedWorkOrders" runat="server" 
    Width="480px" Height="392px"
    AutoGenerateColumns="False" AllowSorting="True"
    Skin="Sunset" GridLines="Vertical" CellSpacing="0" 
    AutoGenerateHierarchy="true">
    <ClientSettings>
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView Width="100%"
        HierarchyDefaultExpanded="True" HierarchyLoadMode="ServerBind">
        <Columns>
            <telerik:GridBoundColumn DataField="WoNumber" 
                FilterControlAltText="Filter WoNumber column" HeaderText="WoNumber" 
                ReadOnly="True" SortExpression="WoNumber" UniqueName="WoNumber">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Title" 
                FilterControlAltText="Filter Title column" HeaderText="Title" ReadOnly="True" 
                SortExpression="Title" UniqueName="Title">
            </telerik:GridBoundColumn>
        </Columns>
        <DetailTables>
            <telerik:GridTableView Name="SubLevel1" ShowHeadersWhenNoRecords="false"   AutoGenerateColumns="false">
                <%-- This level holds items of Type2 --%>
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" 
                        FilterControlAltText="Filter ID column" HeaderText="ID" 
                        ReadOnly="True" SortExpression="ResourceId" UniqueName="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="PlannedHours" DataType="System.Decimal"
                        FilterControlAltText="Filter PlannedHours column" HeaderText="Planned Hrs" ReadOnly="True" 
                        SortExpression="PlannedHours" UniqueName="PlannedHours">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RemainingHours" DataType="System.Decimal"
                        FilterControlAltText="Filter RemainingHours column" HeaderText="Remaining Hrs" 
                        ReadOnly="True" SortExpression="RemainingHours" UniqueName="RemainingHours">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Workers" DataType="System.Int32" 
                        FilterControlAltText="Filter Workers column" 
                        HeaderText="# Workers" ReadOnly="True" SortExpression="Workers" 
                        UniqueName="Workers">
                    </telerik:GridBoundColumn>
                </Columns>
            </telerik:GridTableView>
            </DetailTables>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
        <GroupHeaderItemStyle Height="32px" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
    </MasterTableView>
    <GroupingSettings GroupContinuesFormatString="" GroupContinuedFormatString=""></GroupingSettings>
    <FilterMenu EnableImageSprites="False"></FilterMenu>
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Sunset"></HeaderContextMenu>
</telerik:RadGrid>


So, my question is: how do I tell the control to use the "Resources" property of the WorkOrderDetails item to fill the content of the second level of the heirarchy?

Marin
Telerik team
 answered on 20 Jun 2011
2 answers
106 views
HI Telerik Team,

I have button when clicked shows the Loading image on the Grid, which is correct and display rows accordingly...

If the same button is clicked by Enter button (from keyboard) the Loading image is not displayed but records are displayed correctly.

Please suggest solution for the above.

Code is as below:
<telerik:AjaxSetting AjaxControlID="button">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridRecords" LoadingPanelID="RadAjaxLoadingPanel2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
sudhakar
Top achievements
Rank 1
 answered on 20 Jun 2011
1 answer
81 views
I have a grid that is hidden when the page initially loads.  So, the tab order is correct when the grid is hidden.  The user clicks or presses a button and the grid appears with the results.  Now the tab order is set to the first heading of the grid, which is correct.  Then it tabs through the grid.  But, after the grid instead of going to the menu on the page, it goes to some links on the bottom of the screen, then it goes to the browser URL, then the browser menu, which is not what I want to happen.  Is there a way to keep the tab order the same when the grid is hidden or not?  I'm not sure why it's going to the browser menu after the grid when it appears.

Thanks.
Radoslav
Telerik team
 answered on 20 Jun 2011
1 answer
87 views
I have a TreeList with Client-Side single-select turned on.  I am able to access the selected item in the PostBack, but want to be able to access the parent items (and their DataKeyValues) backwards through the top of the tree.  Is there a way to do this?
Marin
Telerik team
 answered on 20 Jun 2011
3 answers
629 views
Hi,

i am working on grid. 

<telerik:GridTemplateColumn UniqueName="display" HeaderText="Select">
<ItemTemplate>
<asp:ImageButton CommandName="select" runat="server"  ImageUrl="Images/geofence.png" OnClientClick= '<%# String.Format("javascript:EditItem();return false;",DataBinder.Eval(Container.DataItem,"LastName"))%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>


 function EditItem() {
//want to get here clicked image button row index
}

i want to get clicked image button row index in Edititem().

plz help me

Regards,

Faisal
faisal
Top achievements
Rank 1
 answered on 20 Jun 2011
1 answer
113 views
Hi,
I have a radgrid with paging. Currently on right side it is displaying something like "91 items in 19 pages". I want to display also something like "items 1 to 10 of 91"(10 is page size). Also I want to add feature that allows entering a specific page number and display it. The desired pager style is in image "PagerStyle.jpg". Thanks.   
Shinu
Top achievements
Rank 2
 answered on 20 Jun 2011
1 answer
71 views
Hello,

When I am using RadPanelbar all expanding and collapsing functions work well in IE and/or Chrome. But when I try it in Firefox 4 no expanding or collapsing occur. Here is my code :

   <telerik:RadPanelBar ID="RadPanelBar1" runat="server" EnableEmbeddedSkins="false"
                Height="100%" ExpandMode="SingleExpandedItem" Skin="ShowCategory" Width="100%"
                AllowCollapseAllItems="false" OnClientItemClicking="OnClientItemClicking">
            </telerik:RadPanelBar>

I am programmatically creating the items. 

One more thing, in all other browser I can call OnClientItemClicking event but in FireFox 4.0 its not firing. FYI, added script below :

 <script type="text/jscript">
        function OnClientItemClicking(sender, args) {
            debugger;
            if (args.get_item().get_level() == 0) {
                args.set_cancel(true);
               args.get_item().set_expanded(!args.get_item().get_expanded());
            }
       }            
    </script>

I am using Telerik  2010.1.519.35.

What can cause that problem? Any Idea?


Veselin Vasilev
Telerik team
 answered on 20 Jun 2011
0 answers
190 views
Hello,telerik?
   In my project,I use the toolbar of telerik controls
  How to control the width of toolbar?
  My scenario is : navigator using the toolbar is under of banner consisting of pictures?
  How to make the toolbar size following the size of banner ?
  i.e.the width of banner is equal to the width of toolbar.
  I use the table to control the size of banner.\
when I use the "100%" of the toolbar width property ,  the size of the banner and toolbar can not fill the screen of window.
how to solve it?
thanks.hope your reply
songsp
Top achievements
Rank 1
 asked on 19 Jun 2011
1 answer
103 views
Hi,
I have a radgrid that need paging. The problem is that it can only display 1 page even if there are more than 1 page. Also on right side displaying "0 item in 1 page" is not correct.  Also I want to add feature that can go to specific page entered. The problem is in image "Pager_problem.jpg". The desired pager style is in image "PagerStyle.jpg". Thanks.    The code is:
<telerik:RadGrid ID="RadGrid1" runat="server" style="margin-left:5px"
    AllowPaging="True" AllowCustomPaging="True"
    AllowFilteringByColumn="True"  AllowSorting="True"                
    DataSourceID="SqlDataSource1" GridLines="None">
 
    <MasterTableView DataSourceID="SqlDataSource1" AutoGenerateColumns="False"
         PagerStyle-Position="TopAndBottom"
         PagerStyle-AlwaysVisible="true" PagerStyle-Mode="NextPrevAndNumeric" PageSize="10">
    <RowIndicatorColumn>
    <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>
         
    <ExpandCollapseColumn>
    <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="OrderDate" DataType="System.DateTime"
                HeaderText="Order Date" SortExpression="OrderDate"
                CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="OrderDate">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="FirstName" HeaderText="First Name"
                SortExpression="FirstName" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="FirstName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Email" HeaderText="Email"
                SortExpression="Email" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="Email">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="GreetingCode" HeaderText="Greeting Code"
                SortExpression="GreetingCode" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="GreetingCode">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ChildFirstName" HeaderText="Child's FirstName"
                SortExpression="ChildFirstName" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="ChildFirstName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ChildLastName" HeaderText="Child's LastName"
                SortExpression="ChildLastName" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="ChildLastName">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ChildGender" HeaderText="Child's Gender"
                SortExpression="ChildGender" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" UniqueName="ChildGender">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


york
Top achievements
Rank 1
 answered on 19 Jun 2011
1 answer
115 views
I am following the Demo Project

AsyncUpload / Ajax Processing


In the demo, it states to setup the RadAjax Manager as such:

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Thumbnail" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>


Since my Asych Upload control is in a Content Page, I am using an RadAjaxManagerProxy.  My problem is if I set the AjaxContorlID to the Proxy's ID, I get a javascript error that I have nested Update Panels.  If I set it to the MasterPage's RadAjaxManager ID, I get a javascript error that ID can't be found.
    
Here is my code.

MasterPage:
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientIDMode="Static"
        DefaultLoadingPanelID="ralpDefault">
        <ClientEvents OnRequestStart="centerLoadingPanel"></ClientEvents>
        <AjaxSettings>
        </AjaxSettings>
    </telerik:RadAjaxManager>
     
Content Page:
 
<telerik:RadAjaxManagerProxy ID="rampMyAccount" runat="server" ClientIDMode="Static">
    <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rbiAvatar" />
                </UpdatedControls>
            </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

Peter Filipov
Telerik team
 answered on 19 Jun 2011
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?