Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
316 views
It's great to have this feature in the grid, but do you have it so the pdf will export to landscape and retain the formatting of the grids theme?
Mike
Top achievements
Rank 1
 answered on 22 Aug 2008
0 answers
75 views
I have created a user control in asp.net and want to place in radtabstrip but facing an error "there must only one form server tag on page" but i dont have any <form> tag on page where i am placing this tabstrip but having it on user control, one more thing is this the page is inherited from master page.
Faisal
Top achievements
Rank 1
 asked on 22 Aug 2008
1 answer
107 views

Hello,

We are having some issues with Events that occurs every x day of the month.  To explain further, below are the steps in recreating the issue:

1. Create an event that occurs every first Saturday of the month starting September and should end after 3 occurances. The recurring event details are as follows:
From = 9/6/2008 1:00PM
To = 9/6/2008 2:00PM
Check the "Recurring appointment" check box
From the "Recurrence" section, select "Monthly" option
Still on the "Recurrence" section, select "The <first> <saturday> of every <1> 
        month(s)"
From the "Range of recurrence" section, select "End after <3> occurrences"

2. FIRST ISSUE/PROBLEM: Once the recurring event is created, you will notice that the event shows up in the calendar in "October 1" slot... instead of the "September 6" slot. (September 6 is the first Saturday of the month of September).

3. Edit the event, (in our test case, we edited the series of the event), the values shown for editing are as follows:  From date/time value is "9/6/2008 1:00PM" and the To date/time value is 9/6/2008 2:00PM. The From and To date/time values are basically correct. (Please see Step1).

4. SECOND ISSUE/PROBLEM: From the "Recurrence" section, you will notice that the values have changed. It is now "The <first> <day> of every <1> month(s)" instead of the value from Step1.

From the database, here is the RecurrencePattern that has been created:
DTSTART:20080906T130000Z  DTEND:20080906T140000Z  RRULE:FREQ=MONTHLY;COUNT=3;INTERVAL=1;BYSETPOS=1;BYDAY=MO,TU,WE,TH,FR,SA,SU 

Please advise as to what was going on.  Thanks so much for your help.  Appreciate it so much.

Thanks,
Annie

T. Tsonev
Telerik team
 answered on 22 Aug 2008
1 answer
193 views
I have a template column that represents a checkbox.  The checkbox is filled in on a databind,  from a list.  The other columns come from a sqldatasource.

I need to sort the column based upon whether it's checked or not.   I can't find an easy way to dynamically adjust the sort expression (it won't bind).

???

Thanks,
Nick H
Nikita Gourme
Top achievements
Rank 1
 answered on 22 Aug 2008
2 answers
320 views

I have problems binding my ascx file to control, during debug time you can see the data being inserted to the controls that is inside the ascx file but when the process is finish it doesnt return anything, it doesnt bind.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Ticket_Default" %>
<%@ Reference Control="~/Component/DAL/Tickets.ascx" %>
<%@ 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">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>

</div>
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
</telerik:RadScriptManager>


<telerik:RadGrid ID="RadGridTicket" runat="server" AutoGenerateColumns="false"
onneeddatasource="RadGridTicket_NeedDataSource"

PageSize="5" OnItemUpdated="RadGridTicket_ItemUpdated"
OnItemInserted="RadGridTicket_ItemInserted"
OnUpdateCommand="RadGridTicket_UpdateCommand"
onitemcommand="RadGridTicket_ItemCommand" >
<MasterTableView AllowPaging="True" EditMode="PopUp" CommandItemDisplay="Top">
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton"
UpdateImageUrl="/Update.gif" >
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn CommandName="Delete" Text="Delete"
UniqueName="Delete" >
</telerik:GridButtonColumn>
<telerik:GridBoundColumn
UniqueName="ParentTicketId"
HeaderText="Parent Ticket Id"
DataField="ParentTicketId"
ReadOnly="true"
Display="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
UniqueName="Title"
HeaderText="Title"
DataField="Title"
EditFormColumnIndex="3">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
UniqueName="Details"
HeaderText="Details"
DataField="Details">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
UniqueName="IsHtml"
HeaderText="Is Html"
DataField="IsHtml">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
UniqueName="Owner"
HeaderText="Owner"
DataField="Owner">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn
UniqueName="UserIdAssignedTo"
HeaderText="UserId Assigned To"
DataField="UserIdAssignedTo"
ReadOnly="true"
Display="false">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="CurrentStatusSetBy"
HeaderText="Current Status Set By"
DataField="CurrentStatusSetBy">
</telerik:GridBoundColumn>


<telerik:GridBoundColumn
UniqueName="PriorityId"
HeaderText="Priority Id"
DataField="PriorityId"
ReadOnly="true"
Display="false">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="AffectsCustomer"
HeaderText="Affects Customer"
DataField="AffectsCustomer">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="PublishedToKb"
HeaderText="Published To Kb"
DataField="PublishedToKb">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="CompanyId"
HeaderText="Company Id"
DataField="CompanyId"
readonly="true"
display="false">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="PercentageCompleted"
HeaderText="Percentage Completed"
DataField="PercentageCompleted">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="Active"
HeaderText="Active"
DataField="Active">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="TicketCreatedByUserId"
HeaderText="TicketCreated By UserId"
DataField="TicketCreatedByUserId">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="ProjectId"
HeaderText="Project Id"
DataField="ProjectId"
ReadOnly="true"
Display="false">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="ProjectGroupId"
HeaderText="Project Group Id"
DataField="ProjectGroupId"
ReadOnly="true"
Display="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="StartDate"
HeaderText="Start Date"
DataField="StartDatee">
</telerik:GridBoundColumn>

<telerik:GridBoundColumn
UniqueName="EndDate"
HeaderText="End Date"
DataField="EndDate">
</telerik:GridBoundColumn>
</Columns>
<RowIndicatorColumn Visible="False" >
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn Visible="False" Resizable="False">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

<EditFormSettings EditFormType="WebUserControl"
ColumnNumber="3" UserControlName="~\Component\DAL\Tickets.ascx" PopUpSettings-Width="800px">
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>

<PopUpSettings ScrollBars="None"></PopUpSettings>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
</form>
</body>
</html>


Ticket.ascx.cs

using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
using System.Data.SqlClient;  
using Telerik.Web.UI;  
using MWS2;  
using MWS2.CollectionClasses;  
using MWS2.EntityClasses;  
 
public partial class Component_DAL_Tickets : System.Web.UI.UserControl  
{  
    private int _TicketID;  
    public int TicketID  
    {  
 
        get { return _TicketID; }  
        set { _TicketID = value;  
        _TicketEntity = new MwsTicketsEntity(_TicketID);  
        bindFormTicketControlFormObject();  
        }  
    }  
    private String _editMode;  
    public string EditMode  
    {  
 
        get { return _editMode; }  
        set  
        {  
            _editMode = value;   
        }  
    }  
    private MwsTicketsEntity _TicketEntity;  
    public MwsTicketsEntity TicketEntity  
    {  
 
        get { return _TicketEntity; }  
        set { _TicketEntity = value; }  
    }  
 
 
    protected void Page_PreRender(object sender, EventArgs e)  
    {  
 
   // bindFormTicketControlFormObject();  
    }  
 
 
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
        if (!IsPostBack)  
        {  
 
              
                   
        }  
 
          
         if (!string.IsNullOrEmpty(_editMode) || (_TicketEntity != null))  
        {  
               
            if (_editMode == "Edit")  
            {  
                  
            }  
            else  
            {  
 
 
            }//presume it is an insert  
        }  
        else  
        {  
              
              
 
        }  
 
         
 
    }  
 
 
    private void bindFormTicketControlFormObject() {  
 
        //_TicketEntity = new MwsTicketsEntity(33);  
        ParentTicketIdText.Text = Convert.ToString(TicketEntity.MwsTickets.ParentTicketId);  
        ParentTicketIdText.DataBind();  
        PriorityIdText.Text = Convert.ToString(TicketEntity.MwsTickets.PriorityId);  
        TicketCreatedByUserIDText.Text = Convert.ToString(TicketEntity.MwsTickets.TicketCreatedByUserId);  
        TitleText.Text = TicketEntity.MwsTickets.Title;  
        AffectsCustomerCheckBox.Checked = TicketEntity.MwsTickets.AffectsCustomer;  
        ProjectIdText.Text = Convert.ToString(TicketEntity.MwsTickets.ProjectId);  
        IsHtmlCheckBox.Checked = TicketEntity.MwsTickets.IsHtml;  
        PublishedToKbCheckBox.Checked = TicketEntity.MwsTickets.PublishedToKb;  
        ProjectGroupIdText.Text = Convert.ToString(TicketEntity.MwsTickets.ProjectGroupId);  
        OwnerText.Text = TicketEntity.MwsTickets.Owner;  
        CompanyIdText.Text = Convert.ToString(TicketEntity.MwsTickets.CompanyId);  
        StartDateText.Text = Convert.ToString(TicketEntity.MwsTickets.StartDate);  
        UserAssignToText.Text = Convert.ToString(TicketEntity.MwsTickets.UserIdAssignedTo);  
        PercentageCompleteText.Text = Convert.ToString(TicketEntity.MwsTickets.PercentageCompleted);  
        EndDateText.Text = Convert.ToString(TicketEntity.MwsTickets.EndDate);  
        CurrentStatusSetByText.Text = TicketEntity.MwsTickets.CurrentStatus;  
        ActiveText.Checked = TicketEntity.MwsTickets.Active;  
        DetailText.Text = TicketEntity.MwsTickets.Details;  
        CurrentStatusText.Text = TicketEntity.MwsTickets.CurrentStatus;  
            
        
    }  
 
 
    protected void btnUpdate_Click(object sender, EventArgs e)  
    {  
          
        int ParentTicketId=Convert.ToInt32(ParentTicketIdText.Text);  
        int UserAssignTo=Convert.ToInt32(UserAssignToText.Text);  
        int PriorityId=Convert.ToInt32(PriorityIdText.Text);  
        int CompanyId= Convert.ToInt32(CompanyIdText.Text);  
        int PercentageCompleted = Convert.ToInt32(PercentageCompleteText.Text);  
        int TicketCreatedByUserID = Convert.ToInt32(TicketCreatedByUserIDText.Text);  
        int projectId= Convert.ToInt32(ProjectIdText.Text);  
        int ProjectGroupId=Convert.ToInt32(ProjectGroupIdText.Text);  
        DateTime startdate = Convert.ToDateTime(StartDateText.Text);  
            DateTime endDate = Convert.ToDateTime(EndDateText.Text);  
            DAL.Lite.Ticket.TicketsUpdate(33,ParentTicketId, TitleText.Text, DetailText.Text  
                , IsHtmlCheckBox.Checked, TicketCreatedByUserIDText.Text, OwnerText.Text, UserAssignTo  
                , CurrentStatusText.Text, CurrentStatusSetByText.Text, PriorityId, AffectsCustomerCheckBox.Checked  
                , PublishedToKbCheckBox.Checked, CompanyId, PercentageCompleted, ActiveText.Checked  
                , TicketCreatedByUserID, projectId, ProjectGroupId, startdate, endDate);  
         
    }  
}  

 

Tickets.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Tickets.ascx.cs" Inherits="Component_DAL_Tickets" %>  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>  
<style type="text/css">  
    .style3  
    {  
        width: 100%;  
    }  
    .style4  
    {  
        width: 145px;  
    }  
    .style5  
    {  
        width: 170px;  
    }  
    .style6  
    {  
        width: 147px;  
    }  
    .style7  
    {  
        width: 275px;  
    }  
    .style8  
    {  
        width: 299px;  
    }  
</style>  
<table class="style3">  
    <tr>  
        <td class="style4">  
            <asp:Label ID="ParentTicketIdLabel" runat="server" Text="Parent Id"></asp:Label>  
        </td>  
        <td class="style5">  
            <asp:TextBox ID="ParentTicketIdText" runat="server"  
             ></asp:TextBox>  
        </td>  
        <td class="style6">  
            <asp:Label ID="PriorityIdLabel" runat="server" Text="Priority Id"></asp:Label>  
        </td>  
        <td class="style8">  
            <asp:TextBox ID="PriorityIdText" runat="server"  
             ></asp:TextBox>  
        </td>  
        <td class="style7">  
            <asp:Label ID="TicketCreatedByUserIDLabel" runat="server"   
                Text="Ticket Created By User"></asp:Label>  
        </td>  
        <td>  
            <asp:TextBox ID="TicketCreatedByUserIDText" runat="server"></asp:TextBox>  
        </td>  
    </tr>  
    <tr>  
        <td class="style4">  
            <asp:Label ID="TitleLabel" runat="server" Text="Title"></asp:Label>  
        </td>  
        <td class="style5">  
            <asp:TextBox ID="TitleText" runat="server"   
           ></asp:TextBox>  
        </td>  
        <td class="style6">  
            <asp:Label ID="AffectsCustomerLabel" runat="server" Text="Affects Customer"></asp:Label>  
        </td>  
        <td class="style8">  
            <asp:CheckBox ID="AffectsCustomerCheckBox" runat="server"   
             />  
        </td>  
        <td class="style7">  
            <asp:Label ID="ProjectIdLabel" runat="server" Text="Project Id"></asp:Label>  
        </td>  
        <td>  
            <asp:TextBox ID="ProjectIdText" runat="server"></asp:TextBox>  
        </td>  
    </tr>  
    <tr>  
        <td class="style4">  
            <asp:Label ID="IsHtmlLabel" runat="server" Text="Is Html"></asp:Label>  
        </td>  
        <td class="style5">  
              
            <asp:CheckBox ID="IsHtmlCheckBox" runat="server"   
             />  
        </td>  
        <td class="style6">  
            <asp:Label ID="PublishToKbLabel" runat="server" Text="Published To KB"></asp:Label>  
        </td>  
        <td class="style8">  
        <asp:CheckBox ID="PublishedToKbCheckBox" runat="server"/>  
              
        </td>  
        <td class="style7">  
            <asp:Label ID="ProjectGroupIdLabel" runat="server" Text="Project Group Id"></asp:Label>  
        </td>  
        <td>  
            <asp:TextBox ID="ProjectGroupIdText" runat="server"></asp:TextBox>  
        </td>  
    </tr>  
    <tr>  
        <td class="style4">  
            <asp:Label ID="OwnerLabel" runat="server" Text="Owner"></asp:Label>  
        </td>  
        <td class="style5">  
            <asp:TextBox ID="OwnerText" runat="server" ></asp:TextBox>  
        </td>  
        <td class="style6">  
            <asp:Label ID="CompanyIdLabel" runat="server" Text="Company Id"></asp:Label>  
        </td>  
        <td class="style8">  
            <asp:TextBox ID="CompanyIdText" runat="server"></asp:TextBox>  
        </td>  
        <td class="style7">  
            <asp:Label ID="StartDateLabel" runat="server" Text="Start Date"></asp:Label>  
        </td>  
        <td>  
            <asp:TextBox ID="StartDateText" runat="server"></asp:TextBox>  
        </td>  
    </tr>  
    <tr>  
        <td class="style4">  
            <asp:Label ID="UserAssignToLabel" runat="server" Text="User Assign To"></asp:Label>  
        </td>  
        <td class="style5">  
            <asp:TextBox ID="UserAssignToText" runat="server" ></asp:TextBox>  
        </td>  
        <td class="style6">  
            <asp:Label ID="PercentageCompleteLabel" runat="server"   
                Text="Percentage Complete"></asp:Label>  
        </td>  
        <td class="style8">  
            <asp:TextBox ID="PercentageCompleteText" runat="server"></asp:TextBox>  
        </td>  
        <td class="style7">  
            <asp:Label ID="EndDateLabel" runat="server" Text="End Date"></asp:Label>  
        </td>  
        <td>  
            <asp:TextBox ID="EndDateText" runat="server"></asp:TextBox>  
        </td>  
    </tr>  
    <tr>  
        <td class="style4">  
            <asp:Label ID="CurrentStatusSetByLabel" runat="server"   
                Text="Current Status SetBy"></asp:Label>  
        </td>  
        <td class="style5">  
            <asp:TextBox ID="CurrentStatusSetByText" runat="server" ></asp:TextBox>  
        </td>  
        <td class="style6">  
            <asp:Label ID="ActiveLabel" runat="server" Text="Active"></asp:Label>  
        </td>  
        <td class="style8">  
            <asp:CheckBox ID="ActiveText" runat="server" />  
        </td>  
        <td class="style7">  
            <asp:Label ID="CurrentStatusLabel" runat="server" Text="CurrentStatus"></asp:Label>  
        </td>  
        <td>  
            <asp:TextBox ID="CurrentStatusText" runat="server"></asp:TextBox>  
        </td>  
    </tr>  
    <tr>  
        <td class="style4">  
            &nbsp;</td>  
        <td class="style5">  
            &nbsp;</td>  
        <td class="style6">  
            &nbsp;</td>  
        <td class="style8">  
            &nbsp;</td>  
        <td class="style7">  
            &nbsp;</td>  
        <td>  
            &nbsp;</td>  
    </tr>  
    <tr>  
        <td class="style4">  
            <asp:Label ID="DetailLabel" runat="server" Text="Details"></asp:Label>  
        </td>  
        <td class="style5">  
              
            <asp:TextBox id="DetailText"   
            runat="server" TextMode="MultiLine" Rows="5" Columns="40" tabIndex="3"   
                Width="206px"></asp:TextBox>  
        </td>  
        <td class="style6">  
            &nbsp;</td>  
        <td class="style8">  
            &nbsp;</td>  
        <td class="style7">  
            &nbsp;</td>  
        <td>  
            &nbsp;</td>  
    </tr>  
    <tr>  
        <td class="style4">  
              
            <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'  
            runat="server"   
                  
                  
                CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' onclick="btnUpdate_Click"   
                >  
           </asp:Button>  
           </td>  
        <td class="style5">  
           <asp:button id="btnCancel" text="<%$ Resources:Main, Cancel %>" Ref="Cancel" runat="server" causesvalidation="False"   
                commandname="Cancel" ></asp:button>  
        </td>  
        <td class="style6">  
            &nbsp;</td>  
        <td class="style8">  
            &nbsp;</td>  
        <td class="style7">  
            &nbsp;</td>  
        <td>  
            &nbsp;</td>  
    </tr>  
    <tr>  
        <td class="style4">  
            &nbsp;</td>  
        <td class="style5">  
            &nbsp;</td>  
        <td class="style6">  
            &nbsp;</td>  w
        <td class="style8">  
            &nbsp;</td>  
        <td class="style7">  
            &nbsp;</td>  
        <td>  
            &nbsp;</td>  
    </tr>  
</table>  
 
 

DragonBall
Top achievements
Rank 1
 answered on 22 Aug 2008
1 answer
169 views
Hello forumees,

I have the following 2 level grid in place. I have combed forums and guides and am miffed. I need the ability to click(select) the second level(nested) grid ONLY and also ensure only one grid node can be expanded at any time? If anybody has source, i'd be happy to explore and thanks for the help. Ajax manager left out for brevity. Please excuse VPC: in place of telerik: tagnames.

Here's current code:

<VPC:RadGrid ID="kitsPerUserGrid" Width="445" AutoGenerateColumns="false" GridLines="None" AllowMultiRowSelection="true" OnDetailTableDataBind="AssignedKitsPerUserDetailTableDataBind" EnableEmbeddedSkins="false" Skin="SonyGrid" runat="server">  
                                    <ClientSettings> 
                                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" /> 
                                        <ClientEvents OnRowContextMenu="RowContextMenu"  /> 
                                    </ClientSettings> 
                                    <MasterTableView DataKeyNames="AssignedUser">  
                                        <DetailTables> 
                                            <VPC:GridTableView DataKeyNames="AssignedUser" GroupsDefaultExpanded="true" Name="assignedUserKitDetails" Width="100%" GridLines="None">  
                                                <Columns> 
                                                    <VPC:GridClientSelectColumn /> 
                                                    <VPC:GridBoundColumn DataField="RecId" UniqueName="RecId" ReadOnly="true" ItemStyle-Width="15%" /> 
                                                    <VPC:GridBoundColumn DataField="Kits" UniqueName="Kits" ReadOnly="true" ItemStyle-Width="50%" /> 
                                                    <VPC:GridBoundColumn DataField="Parts" UniqueName="Parts" ReadOnly="true" ItemStyle-Width="25%" /> 
                                                    <VPC:GridBoundColumn DataField="UsersOrder" UniqueName="UsersOrder" ItemStyle-Width="10%" /> 
                                                </Columns> 
                                                <NestedViewTemplate> 
                                                    <fieldset> 
                                                        <legend>&nbsp;&nbsp;Part(s) for Kit:   
                                                            <asp:Label ID="RecID" Text='<%# Eval("RecId") %>' Visible="false" runat="server" /> 
                                                            <asp:Label ID="KitsSmallDescription" Text='<%# Eval("Kits") %>' runat="server" />&nbsp;&nbsp;  
                                                        </legend> 
                                                        <asp:SqlDataSource ID="AssignedKitDetailsDataSource" ConnectionString="<%$ ConnectionStrings:SLManagerConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT PartNum, Description, Qty FROM SLM_Parts where KitID = @RecId" runat="server">  
                                                            <SelectParameters> 
                                                                <asp:ControlParameter ControlID="RecID" PropertyName="Text" Type="String" Name="RecId" /> 
                                                            </SelectParameters> 
                                                        </asp:SqlDataSource> 
                                                        <VPC:RadGrid ID="assignedNestedKitGrid" Width="100%" GridLines="None" AutoGenerateColumns="false" EnableEmbeddedSkins="false" Skin="SonyGrid" DataSourceID="AssignedKitDetailsDataSource" runat="server">     
                                                            <ClientSettings /> 
                                                            <MasterTableView> 
                                                                <Columns> 
                                                                    <VPC:GridBoundColumn DataField="PartNum" UniqueName="PartNum" ItemStyle-Width="20%" /> 
                                                                    <VPC:GridBoundColumn DataField="Description" UniqueName="Description" ItemStyle-Width="68%" /> 
                                                                    <VPC:GridBoundColumn DataField="Qty" UniqueName="Qty" ItemStyle-Width="12%" /> 
                                                                </Columns> 
                                                            </MasterTableView>                                    
                                                        </VPC:RadGrid>                                    
                                                    </fieldset> 
                                                </NestedViewTemplate> 
                                            </VPC:GridTableView> 
                                        </DetailTables> 
                                        <Columns> 
                                            <VPC:GridBoundColumn DataField="AssignedUser" UniqueName="AssignedUser"  ItemStyle-Width="50%" /> 
                                            <VPC:GridTemplateColumn DataField="Quantity" UniqueName="QuantityColumn" ItemStyle-Width="50%">  
                                                <ItemTemplate> 
                                                    <%# Eval("Quantity") %> Kit(s)  
                                                    <asp:Label ID="UserIdentity" Text='<%# Eval("AssignedUser") %>' Visible="false" runat="server" /> 
                                                </ItemTemplate> 
                                            </VPC:GridTemplateColumn> 
                                        </Columns> 
                                    </MasterTableView> 
                                </VPC:RadGrid> 

Thank you!
Nikita Gourme
Top achievements
Rank 1
 answered on 22 Aug 2008
1 answer
137 views
Hello forumees,

I have the following 2 level grid in place. I have combed forums and guides and am miffed. I need the ability to click(select) the second level(nested) grid ONLY and also ensure only one grid node can be expanded at any time? If anybody has source, i'd be happy to explore and thanks for the help. Ajax manager left out for brevity. Please excuse VPC: in place of telerik: tagnames.

Here's current code:

<VPC:RadGrid ID="kitsPerUserGrid" Width="445" AutoGenerateColumns="false" GridLines="None" AllowMultiRowSelection="true" OnDetailTableDataBind="AssignedKitsPerUserDetailTableDataBind" EnableEmbeddedSkins="false" Skin="SonyGrid" runat="server">  
                                    <ClientSettings> 
                                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" /> 
                                        <ClientEvents OnRowContextMenu="RowContextMenu"  /> 
                                    </ClientSettings> 
                                    <MasterTableView DataKeyNames="AssignedUser">  
                                        <DetailTables> 
                                            <VPC:GridTableView DataKeyNames="AssignedUser" GroupsDefaultExpanded="true" Name="assignedUserKitDetails" Width="100%" GridLines="None">  
                                                <Columns> 
                                                    <VPC:GridClientSelectColumn /> 
                                                    <VPC:GridBoundColumn DataField="RecId" UniqueName="RecId" ReadOnly="true" ItemStyle-Width="15%" /> 
                                                    <VPC:GridBoundColumn DataField="Kits" UniqueName="Kits" ReadOnly="true" ItemStyle-Width="50%" /> 
                                                    <VPC:GridBoundColumn DataField="Parts" UniqueName="Parts" ReadOnly="true" ItemStyle-Width="25%" /> 
                                                    <VPC:GridBoundColumn DataField="UsersOrder" UniqueName="UsersOrder" ItemStyle-Width="10%" /> 
                                                </Columns> 
                                                <NestedViewTemplate> 
                                                    <fieldset> 
                                                        <legend>&nbsp;&nbsp;Part(s) for Kit:   
                                                            <asp:Label ID="RecID" Text='<%# Eval("RecId") %>' Visible="false" runat="server" /> 
                                                            <asp:Label ID="KitsSmallDescription" Text='<%# Eval("Kits") %>' runat="server" />&nbsp;&nbsp;  
                                                        </legend> 
                                                        <asp:SqlDataSource ID="AssignedKitDetailsDataSource" ConnectionString="<%$ ConnectionStrings:SLManagerConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT PartNum, Description, Qty FROM SLM_Parts where KitID = @RecId" runat="server">  
                                                            <SelectParameters> 
                                                                <asp:ControlParameter ControlID="RecID" PropertyName="Text" Type="String" Name="RecId" /> 
                                                            </SelectParameters> 
                                                        </asp:SqlDataSource> 
                                                        <VPC:RadGrid ID="assignedNestedKitGrid" Width="100%" GridLines="None" AutoGenerateColumns="false" EnableEmbeddedSkins="false" Skin="SonyGrid" DataSourceID="AssignedKitDetailsDataSource" runat="server">     
                                                            <ClientSettings /> 
                                                            <MasterTableView> 
                                                                <Columns> 
                                                                    <VPC:GridBoundColumn DataField="PartNum" UniqueName="PartNum" ItemStyle-Width="20%" /> 
                                                                    <VPC:GridBoundColumn DataField="Description" UniqueName="Description" ItemStyle-Width="68%" /> 
                                                                    <VPC:GridBoundColumn DataField="Qty" UniqueName="Qty" ItemStyle-Width="12%" /> 
                                                                </Columns> 
                                                            </MasterTableView>                                    
                                                        </VPC:RadGrid>                                    
                                                    </fieldset> 
                                                </NestedViewTemplate> 
                                            </VPC:GridTableView> 
                                        </DetailTables> 
                                        <Columns> 
                                            <VPC:GridBoundColumn DataField="AssignedUser" UniqueName="AssignedUser"  ItemStyle-Width="50%" /> 
                                            <VPC:GridTemplateColumn DataField="Quantity" UniqueName="QuantityColumn" ItemStyle-Width="50%">  
                                                <ItemTemplate> 
                                                    <%# Eval("Quantity") %> Kit(s)  
                                                    <asp:Label ID="UserIdentity" Text='<%# Eval("AssignedUser") %>' Visible="false" runat="server" /> 
                                                </ItemTemplate> 
                                            </VPC:GridTemplateColumn> 
                                        </Columns> 
                                    </MasterTableView> 
                                </VPC:RadGrid> 

Thank you!
Nikita Gourme
Top achievements
Rank 1
 answered on 22 Aug 2008
1 answer
112 views
Hi There,

I just came across the client side references to the RadComboBoxes, tlrkComboBoxes, which I have found very useful.  I was wondering if all of the RadControls have these clientside objects defined?  Is there a list of these and their corresponding properties and methods?

I am particularly interested in accessing the clientside reference for a RadTextBox.

Thanks, Dan
Maria Ilieva
Telerik team
 answered on 22 Aug 2008
2 answers
134 views
I wonder if it's possible to somehow get the edit form in  a separate container, eg. a pane outside the grid. I know this is possible using regular detailview, formview etc, but then i'd have to input the different fields myself in the formview.

Basically what i want is to click edit on the grid, and the edit form appears in a outside pane, without me putting  the fields in that pane. (i know of the popup feature, but i'd like to place it someplace else, an arbitrary location).

I'm not talking about http://www.telerik.com/help/aspnet-ajax/grdwindowediting.html, cause that implies that you have to make the editform yourself.
(The question also applies to display)

Thank you

Best regards,

Kjartan
Dimo
Telerik team
 answered on 22 Aug 2008
4 answers
286 views
I have the following grid:

<telerik:RadGrid ID="grdList" runat="server" AutoGenerateColumns="False" Width="450px" 
                        Height="260px" GridLines="None" AllowMultiRowSelection="True" AllowPaging="True" 
                        PageSize="10" CssClass="CriteriaGrid"> 
                        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                            Font-Underline="False" Wrap="True" /> 
                        <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="{4} &amp;nbsp;Page {0} of {1}" /> 
                        <MasterTableView DataKeyNames="Value" Name="Master" ShowHeader="False" GridLines="None" HierarchyLoadMode="Client"> 
                            <RowIndicatorColumn> 
                                <HeaderStyle Width="20px"></HeaderStyle> 
                            </RowIndicatorColumn> 
                            <ExpandCollapseColumn Visible="True"> 
                                <HeaderStyle Width="20px"></HeaderStyle> 
                            </ExpandCollapseColumn> 
                            <Columns> 
                                <telerik:GridClientSelectColumn HeaderText="Include" UniqueName="Include"> 
                                    <HeaderStyle Width="20px" /> 
                                </telerik:GridClientSelectColumn> 
                                <telerik:GridBoundColumn DataField="Text" HeaderText="Text" UniqueName="Text"> 
                                    <HeaderStyle Width="100%" /> 
                                    <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                                        Font-Underline="False" Wrap="False" /> 
                                </telerik:GridBoundColumn> 
                            </Columns> 
                            <ItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False"></ItemStyle> 
                            <GroupHeaderItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False"></GroupHeaderItemStyle> 
                            <AlternatingItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False"></AlternatingItemStyle> 
                            <EditItemStyle Wrap="False" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
                                Font-Strikeout="False" Font-Underline="False"></EditItemStyle> 
                            <DetailTables> 
                                <telerik:GridTableView runat="server" Name="Detail" DataKeyNames="Value" ShowHeader="False"> 
                                    <Columns> 
                                        <telerik:GridClientSelectColumn HeaderText="Include" UniqueName="Include"> 
                                            <HeaderStyle Width="20px" /> 
                                        </telerik:GridClientSelectColumn> 
                                        <telerik:GridBoundColumn DataField="Text" HeaderText="Text" UniqueName="Text"> 
                                            <HeaderStyle Width="100%" /> 
                                            <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" 
                                                Font-Underline="False" Wrap="False" /> 
                                        </telerik:GridBoundColumn> 
                                    </Columns> 
                                    <RowIndicatorColumn> 
                                        <HeaderStyle Width="20px" /> 
                                    </RowIndicatorColumn> 
                                    <ExpandCollapseColumn> 
                                        <HeaderStyle Width="20px" /> 
                                    </ExpandCollapseColumn> 
                                </telerik:GridTableView> 
                            </DetailTables> 
                        </MasterTableView> 
                        <ClientSettings> 
                            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False"></Selecting> 
                            <ClientEvents OnRowSelected="SelectChildren" OnRowDeselected="SelectChildren" OnRowSelecting="CancelNonInputSelect" OnRowDeselecting="CancelNonInputSelect"> 
                            </ClientEvents> 
                            <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling> 
                        </ClientSettings> 
                        <FilterMenu EnableTheming="True"> 
                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                        </FilterMenu> 
                    </telerik:RadGrid> 

With the follwing JS events:
function CancelNonInputSelect(sender, args)    
            {    
                var e = args.get_domEvent();   
                //IE - srcElement, Others - target   
                var targetElement = e.srcElement || e.target;   
                 
                if (targetElement != null) { 
                    //is the clicked element an input checkbox? <input type="checkbox"...>   
                    if(targetElement.tagName.toLowerCase() != "input" && (!targetElement.type || targetElement.type.toLowerCase() != "checkbox"))  
                    {                       
                        //cancel the event   
                        args.set_cancel(true);   
                        return; 
                    }   
                } 
            }    
             
            function SelectChildren(sender, args) { 
                if(args.get_tableView().get_name()=='Master') { 
                    var di = args.get_tableView().get_dataItems()[args.get_itemIndexHierarchical()]; 
                    di.set_expanded(true); 
                     
                    var grid = $find("<%= grdList.ClientID %>"); 
                    var table = grid.get_detailTables()[args.get_itemIndexHierarchical()]; 
                                                            
                    for (i = 0; i < table.get_dataItems().length; i++) 
                    { 
                        if (di.get_selected() == true) 
                            table.selectItem(table.get_dataItems()[i].get_element()); 
                        else 
                            table.deselectItem(table.get_dataItems()[i].get_element()); 
                    } 
                } 
            } 

I have paging enabled, and since the grid doesn't maintain what was selected on a previous page (I think this would be an AWESOME feature to include in a future build), I have to capture all the selected items from each page so that I can reselect them again when the grid renders back to one of the pages.

I have the hierarchy load mode set to client and have subscribed to both the NeedDataSource and DetailTableDataBind events so that the grid is fully loaded when it comes to the screen.

The problem is when I'm trying to look at what is selected inside of my detail tables. I'm able to loop through the MasterTableView grid items see what is selected and what isn't and add them or remove them from my SelectedItems array. However, when I get down and start looping through the detail tables, they don't have any grid items, so I can't add them to my SelectedDetailItems array.
Private Sub grdList_PageIndexChanged(ByVal source As Object, ByVal e As Telerik.Web.UI.GridPageChangedEventArgs) Handles grdList.PageIndexChanged 
        For Each item As Telerik.Web.UI.GridItem In grdList.MasterTableView.Items 
            If item.Selected Then 
                If Not SelectedItems.Contains(grdList.MasterTableView.DataKeyValues(item.ItemIndex).Item("Value")) Then 
                    SelectedItems.Add(grdList.MasterTableView.DataKeyValues(item.ItemIndex).Item("Value")) 
                End If 
            Else 
                SelectedItems.Remove(grdList.MasterTableView.DataKeyValues(item.ItemIndex).Item("Value")) 
            End If 
        Next 
 
        For Each det As Telerik.Web.UI.GridTableView In grdList.MasterTableView.DetailTables 
            For Each item As Telerik.Web.UI.GridItem In det.Items 
                If item.Selected Then 
                    If Not SelectedDetailItems.Contains(det.DataKeyValues(item.ItemIndex).Item("Value")) Then 
                        SelectedDetailItems.Add(det.DataKeyValues(item.ItemIndex).Item("Value")) 
                    End If 
                Else 
                    SelectedDetailItems.Remove(det.DataKeyValues(item.ItemIndex).Item("Value")) 
                End If 
            Next 
        Next 
    End Sub 

I would love to be able to use the SelectedItems array on the RadGrid (which does have the selected items from the detail tables), but can't because it will only tell me what has been selected, but I need to know what isn't selected so I can remove them from my storage array. As you can see, if there was a way for the grid to maintain selections when the page index/sort changes and restore them when it renders those grid items, that would be GREAT and save me tons of time and additional code writing to handle something that really should be included.

Thanks,
Adam
Adam
Top achievements
Rank 1
 answered on 22 Aug 2008
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?