This is a migrated thread and some comments may be shown as answers.

Can't Add Columns at Design

7 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Kemp
Top achievements
Rank 1
David Kemp asked on 04 Nov 2008, 08:29 PM
Ok, so, what is happening right now, is for some reason when I try to add columns to the RadGrid in the designer, I can see them in the designer, but the source is not changing. So if I right-click on the control and hit refresh, the columns are gone. Its as though the designer is working but its not actually chaning the Source Code. The only way I can get it to work is to remove it and add a new RadGrid Control. Then it works for awhile, and stops working again.

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="leftPowerPAD.ascx.vb" Inherits="controls_leftPowerPAD" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<telerik:RadAjaxPanel ID="RAPPowPad" runat="server">  
 
<div id="areaPwrPadLists">  
    <table cellpadding="0" cellspacing="0">  
        <tr> 
            <td> 
                <asp:DropDownList ID="DropDownList1" runat="server" CssClass="dropListA">  
                    <asp:ListItem Selected="True" Value="0">-- Select List--</asp:ListItem> 
                </asp:DropDownList> 
            </td> 
            <td>&nbsp;</td> 
            <td valign="middle">  
                <asp:ImageButton ID="ImageButton13" runat="server"   
                ImageUrl="~/images/buttonPPGo.gif" /> 
            </td> 
        </tr> 
    </table> 
</div> 
 
<table border="0" cellpadding="0" cellspacing="0" class="tblPowerPad">  
    <tr> 
        <td class="cellPowerPadHead">JS Order #</td> 
        <td class="cellPowerPadHead">Qty</td> 
        <td>&nbsp;</td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox1" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox2" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton3" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox3" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox4" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton4" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox5" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox6" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton5" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox7" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox8" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton9" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox9" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox10" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton6" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox11" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox12" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton7" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox13" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox14" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton8" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox15" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox16" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton10" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox17" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox18" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton11" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
    <tr> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox19" CssClass="inputA" Width="155px" runat="server" /> 
        </td> 
        <td class="cellPowerPadInput">  
            <asp:TextBox ID="TextBox20" CssClass="inputA" Width="25px" runat="server" /> 
        </td> 
        <td> 
            <asp:ImageButton ID="ImageButton12" runat="server"   
            ImageUrl="~/images/buttonDelete.gif" T  
            oolTip="Delete This Item" /> 
        </td> 
    </tr> 
</table> 
    <telerik:RadGrid ID="RadGrid1" runat="server"   
        AllowMultiRowEdit="True" AutoGenerateDeleteColumn="True"   
        AutoGenerateEditColumn="True" DataSourceID="SqlDataSource1" GridLines="None"   
        Skin="Default2006" AutoGenerateColumns="False">  
        <MasterTableView DataSourceID="SqlDataSource1">  
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
        </MasterTableView> 
        <ClientSettings AllowColumnsReorder="True">  
        </ClientSettings> 
        <FilterMenu EnableTheming="True">  
            <CollapseAnimation Duration="200" Type="OutQuint" /> 
        </FilterMenu> 
    </telerik:RadGrid> 
<div> 
    <asp:HyperLink ID="HyperLink1" runat="server" CssClass="lnkClose"   
    Text="Clear All" NavigateUrl="#" /> 
      
</div> 
 
<div class="padButtons">  
    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/buttonPPAddList.gif" /> 
    &nbsp;  
    <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/buttonPPAddCart.gif" /> 
</div> 
    <asp:Panel ID="Panel1" runat="server">  
    </asp:Panel> 
</telerik:RadAjaxPanel> 

7 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 04 Nov 2008, 09:25 PM
Hey David,

Hmm, only problem I'm running into with debugging this is I don't see any columns defined at all in your grid, which means they're all going to be coming from the data source.  I think if you wanted to override this you would need to do something like...

<Columns> 
    <telerik:GridTemplateColumn HeaderText="Activity Type" UniqueName="posttype" SortExpression="posttype">  
    <ItemStyle Width="150px" /> 
    <ItemTemplate> 
    <asp:Label id="label678" runat="server" Text='<%# Eval("posttype") %>'></asp:Label><br /><br /> 
    </ItemTemplate> 
    </telerik:GridTemplateColumn> 
    <telerik:GridTemplateColumn HeaderText="Activities in Category" UniqueName="posttext" SortExpression="posttext">  
    <ItemStyle Width="450px" /> 
    <ItemTemplate> 
    <asp:Literal ID="label987" runat="server" Text='<%# Bind("posttext") %>' OnDataBinding="DecodeText" Mode="Transform"></asp:Literal>      
    </ItemTemplate> 
    </telerik:GridTemplateColumn> 
</Columns> 

So these grab the values from the datasource, but I can define how I want the columns to work.  I can even add a third in that isn't bound to the datasource but is used for some other nefarious purpose. :)

Would something like this work for you?  Also, out of curiosity, what version of the controls are you using?  I'm still demo'ing Q2 2008 latest SP, and this works fine for my columns.
0
David Kemp
Top achievements
Rank 1
answered on 04 Nov 2008, 10:00 PM
Yeah, I can add them in the source code manually like you are saying, but it will not let me add them in via the designer. It acts like its working fine, but the code itself doesn't actually reflect the changes. I can even see the columns in the design view, but if I refresh it, they disappear. Tried it on two different computers.
0
David Kemp
Top achievements
Rank 1
answered on 04 Nov 2008, 10:01 PM
I am using 2008.02.1001.35
0
Jeff
Top achievements
Rank 2
answered on 14 Nov 2008, 05:01 PM
I am having the same problem.  I've been trying to diagnose it and with me it seems that if I create a new RadGrid and work on it exclusively via the designer the changes I make seem to stick in the source, but if I manually change something in the source and then change something via the designer (in my case I typed into the source the <GroupingSettings CaseSensitive="false" />) and now when I change the properties (or even add columns) they show in the design widow but are not created in the source.  It almost seems like when you manually change something in the source the designer can no longer update the source.  I'm using Q3 2008 with Visual Studio 2008 Pro with 3.5 SP1.

Jeff
0
Jeff
Top achievements
Rank 2
answered on 14 Nov 2008, 05:04 PM
Sorry for quick reply, but I think I figured out more of the problem.
If I put the RadGrid on the page and edit in either design or source it is fine.  If I then put an AjaxPanel on the page and put the RadGrid in it, the designer changes no longer transfer to the source.  If I remove the AjaxPanel, it works again.
Not sure if this will help or not.

Jeff
0
Mark
Top achievements
Rank 1
answered on 24 Nov 2008, 07:28 PM
Ugh, I'm having this problem too, and it's driving me nuts. I make changes in the designer, and they're never reflected in the markup. It was working fine previously, and suddenly stopped working - restarting Visual Studio does not help.

I'm not using a RadAjaxPanel on my page.

I'm running VS2008 with the .NET 2.0 version of the controls. ASP.NET AJAX version is the latest at the time of this writing - Q3 2008.
0
Gavin Howlett-Foster
Top achievements
Rank 1
answered on 15 Dec 2008, 12:29 PM
I've been having this problem for a while and now a colleague is also experiencing it. I did report it via a support ticket when it first started happening but Telerik couldn't re-create it.

I have discovered that if you use the grid's smart tag to change the skin to anything else and then change it back to the one that you were originally using then the grids properties are updated in the source.

Hope tht helps.
Tags
Grid
Asked by
David Kemp
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
David Kemp
Top achievements
Rank 1
Jeff
Top achievements
Rank 2
Mark
Top achievements
Rank 1
Gavin Howlett-Foster
Top achievements
Rank 1
Share this question
or