Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
482 views
Looking at the examples at http://www.telerik.com/help/aspnet-ajax/grid-understanding-hierarchy.html and at http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html seems to imply that the DetailTables at the same level in a RadGrid hierarchy must all share that same layout. For example, for a 3-level hierarchy:

MasterTableView
+Item(0)
DetailTable0(copy0)
+Item(0)
DetailTable00(copy0)
+Item(0)
+Item(1)
+Item(2)
...
+Item(1)
DetailTable00(copy1)
+Item(0)
+Item(1)
+Item(2)
...

...
...

The DetailTables look like they need to be copies of each other, implying their items share the same layout (column names/number, etc).

Is there an easy way to allow the 3rd level of the hierarchy (the DetailTable00 items) to have different # of columns? The structure I want is like this:

Type1 - (Name, Comments)
Category1 - (Name, Comments)
Item1 - (Name, Yes, No, Comments)
Item2 - (Name, Yes, No, Comments)
...
Category2 - (Name, Comments)
Item1 - (Name, Low, Mid, High, Comments)
Item2 - (Name, Low, Mid, High, Comments)
...
...
Type2 - (Name, Comments)
Category1 - (Name, Comments)
Item1 - (Name, Date, Comments)
Item2 - (Name, Date, Comments)
...
...
...

Type and Category columns will be the same, but the items within each CategoryX could have a slightly different layout compared to another category (because there will be columns for a scale rating, and the scale type can vary depending on the category!). Each category's items would be homogeneous, of course; the variation would be between categories.

Can I accomplish something like this without too much complication?
Pavlina
Telerik team
 answered on 26 Sep 2011
5 answers
277 views
I'm using 2 listboxes and transferring items between the two.  I have an item template on the destination listbox with a label and a databound dropdownlist.  I move items to the destination LB, then choose a selection for each dropdown item.  If I then transfer another item from source LB to destination LB, the dropdown selections are all lost (selected index becomes 0 again).
The issue lies in the sort itself, because if I comment out the sort method, the dropdowns retain their selection after a transfer.
Here is the listbox item transferred event code I'm using.  If I comment out the first 4 lines of the method, the selections are retained.  The foreach statement is apparently required in order to make the items in the itemtemplate display properly.

protected void lbAdv_Rosters_Transferred(object sender, RadListBoxTransferredEventArgs e)
    {
        lbAdv_ChosenRosters.Sort = RadListBoxSort.Ascending;
        lbAdv_ChosenRosters.SortItems();
        lbAdv_Rosters.Sort = RadListBoxSort.Ascending;
        lbAdv_Rosters.SortItems();

        foreach (RadListBoxItem item in e.Items)
        {
            item.DataBind();
        }
    }

I'm using version 2010.3.1317.35.  Thanks in advance!
Scott
Top achievements
Rank 1
 answered on 26 Sep 2011
2 answers
90 views
Does anyone have an example of using a context menu that opens on button click within a RadGrid?  Currently the grid I have has 5 button columns with a new request to add 2 new commands, and they're starting to take up a large amount of grid real estate.  What I'd like to do is just have a button as the first column of the grid, and when clicked a context menu opens with the 7 available commands, and haven't been able to find an example of this being done.  Can someone point me in the right direction?

Thanks!
Matt DiPietro
Top achievements
Rank 1
 answered on 26 Sep 2011
1 answer
299 views
Hello,

I have a RadListBox that is will only allow multiple selection. I have Selectionmode="Single" set but that does not work. I have also tried some Javascript with no luck. Obviously this is a bug but what can I do hear to get the selection mode to single.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DataMigration.ascx.cs"
    Inherits="PDS.DataMigration1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<style type="text/css">
    .style8
    {
        color: #FFFFFF;
    }
</style>
<telerik:RadScriptBlock ID="ScriptBlock" runat="server">
<script type="text/javascript">
  
    function reMigrate()
    {
        var button = $find("<%= rb_Migrate.ClientID %>");
        button.click();
    }
</script>
</telerik:RadScriptBlock>
<div style="text-align: center; width: 100%">
    <div style="text-align: left">
        <div style="text-align: center; width: 700px; margin-top: 40px">
            <asp:Panel ID="Panel2" runat="server" Width="650px" Height="450px" BackColor="#62768A">
                <span class="style8">
                    <label>
                        Select Dealership</label></span>
                <br />
                <telerik:RadComboBox runat="server" ID="rcb_Dealerships" Width="280px" AutoPostBack="true"
                    EnableEmbeddedSkins="false" OnDataBinding="rcb_Dealerships_DataBinding" OnSelectedIndexChanged="rcb_Dealerships_SelectedIndexChanged">
                </telerik:RadComboBox>
                <br />
                <br />
                <span class="style8">
                    <label style="text-align: left">
                        Select Accounts</label></span>
                <br />
                <telerik:RadListBox ID="rlb_Accounts" runat="server" Width="600px" Height="300px" CheckBoxes="true" EnableEmbeddedSkins="false"
                BackColor="#E1EAF2" BorderColor="#E1EAF2" style="text-align: left" AutoPostBack="true" SelectionMode="Single" >
                </telerik:RadListBox>
                <br />
                <br />
                <telerik:RadButton ID="rb_Migrate" runat="server" Width="150px" Text="Migrate Accounts"
                    Skin="WebBlue" BackColor="#33393E" ForeColor="Black" OnClick="rb_Migrate_Click">
                </telerik:RadButton>
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" 
                    EnableEmbeddedSkins="false" EnableViewState="false" >
                    <%--<Windows>
                    <telerik:RadWindow runat="server" ID="ProductWin">
                    </telerik:RadWindow>
                    </Windows>--%>
                </telerik:RadWindowManager>
                <br />
                <cc1:RoundedCornersExtender ID="RoundedCornersExtender2" runat="server" TargetControlID="Panel2"
                    Radius="9">
                </cc1:RoundedCornersExtender>
            </asp:Panel>
        </div>
    </div>
</div>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue">
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Panel2">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Panel2" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="GridPanel">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="GridPanel" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
James
Top achievements
Rank 1
 answered on 26 Sep 2011
2 answers
198 views
I must be doing something wrong because I am having a really hard time trying to get the value of a check box in edit mode. I want the check box to be disabled if the value is true. With my code as it is now, it is always false. What am I doing wrong?

protected void RadGrid1_Test(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
    {
        GridEditFormItem edititem = (GridEditFormItem)e.Item;
 
        CheckBox movedtobs_chk = edititem["MovedToBS"].Controls[0] as CheckBox;
        Boolean flag = movedtobs_chk.Checked;
 
        //my issue is this flag is always false even when the checkbox is checked.
        if (flag == true)
        {
            movedtobs_chk.Enabled = false;
        }
 
 
    }
}


Najid Hanif
Top achievements
Rank 2
 answered on 26 Sep 2011
2 answers
303 views
How can I disable Constrain Proportions button, Swap button, and Aspect Radio dropdown from the crop image pop up? I have seen this link but that didnt help me about disabling those...

http://www.telerik.com/community/forums/aspnet-ajax/image-editor/crop-dialog-using-static-width-height.aspx

Mark
Top achievements
Rank 1
 answered on 26 Sep 2011
5 answers
272 views
Hi , I am new with that technology. I am facing one problem when i am going to work with that editor.

What i need actually is given below:
1. Need to add a Button on Editor Header Which name should be "Insert layer"
2. When We Click this Button a fixed size Div will be added to the Editor Text Area.
3. And We should able to drag/drop the div in any where of the Text area of Editor.

Could you please give any idea and sample code or any link to do functionality as i have explained.

Thanks,
Rashim
Dobromir
Telerik team
 answered on 26 Sep 2011
4 answers
326 views
Hi,

I need to trigger file selection dialog based on some concrete event, afaik, currently I can trigger it if it's rendered as input, but same trick, obviously, doesn't work when control is rendered as <object> (multiple file selection case). Question is do you have, if not then consider as feature request, abilitiy to trigger file selection dialog from JS. In my current project I have flash object and we communicate through JS, I feel like something similar could be useful.

Thank you!
Genady Sergeev
Telerik team
 answered on 26 Sep 2011
1 answer
122 views
Hi,

I was looking for a way to disable the 'case sensitive' in column filters. Please help.

thanks,
Minh Bui
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Sep 2011
1 answer
190 views
INSERTCOMMAND in a RadGrid inside a Raddock is not firing!

I have a RadGrid inside a RadDock. I am doing some updating/inserting built in the RadGrid.

The RadGrid's ItemCommand fires ok when clicking to INIT insert.

However the ItemCommand, UpdateCommand / InsertCommand ARE NOT FIRING when clicking to perform Insert.
They fire OK if I just put the grid on the page (without the raddock), it works fine, but they won't fire if the grid is inside the raddock.

I need to know why this is happening.

Thanks,
Simone

 

 Source:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="WebForm4.aspx.cs" Inherits="SMTPro.WebForm4" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadDockLayout runat="server" EnableViewState="false" ID="RadDockLayout1"
        StoreLayoutInViewState="false">
        <telerik:RadDock ID="rdRepAds" runat="server" Title="Ads" Width="600px" EnableAnimation="true"
            Skin="Office2010Silver" EnableRoundedCorners="true" Resizable="true" AutoPostBack="true">
            <ContentTemplate>
                <telerik:RadGrid ID="grdRepAds" runat="server" CellSpacing="0" GridLines="None" PageSize="20"
                    EnableViewState="true" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True"
                    OnItemCommand="grdRepAds_ItemCommand" OnItemDataBound="grdRepAds_ItemDataBound"
                    OnInsertCommand="grdRepAds_InsertCommand">
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" />
                    </ClientSettings>
                    <MasterTableView DataKeyNames="ID" CommandItemDisplay="Bottom" AutoGenerateColumns="False"
                        FilterExpression="Active = true">
                        <CommandItemTemplate>
                            <asp:LinkButton ID="btnInitInsert" runat="server" CommandName="InitInsert"><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />Add new&nbsp;&nbsp;&nbsp;&nbsp;</asp:LinkButton>
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridBoundColumn DataField="RepID" FilterControlWidth="130" HeaderText="RepID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="AdID" FilterControlWidth="130" HeaderText="AdID">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    </HeaderContextMenu>
                </telerik:RadGrid>
            </ContentTemplate>
        </telerik:RadDock>
    </telerik:RadDockLayout>
</asp:Content>


 

 =============

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                using (var db = new mockupEntities())
                {
                    int repID;
                    repID = 7784;
                    var query = from sr in db.RepAds
                                where sr.RepID == repID
                                select sr;

                    grdRepAds.DataSource = query.ToList();
                    Session["dsRepAdsByRepID"] = query.ToList();
                }
            }
            else
            {
                grdRepAds.DataSource = Session["dsRepAdsByRepID"];
            }
        }

        protected void grdRepAds_ItemCommand(object sender, GridCommandEventArgs e)
        {
        }

        protected void grdRepAds_ItemDataBound(object sender, GridItemEventArgs e)
        {
        }

        protected void grdRepAds_InsertCommand(object sender, GridCommandEventArgs e)
        {
            //does not fire!!!!!!!!!
        }

 

Simone
Top achievements
Rank 1
 answered on 26 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?