Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
222 views
Hi,

I have a grid with auto-generated columns.  The grid is filled during run time (via a SQL query). 

I try to use Edit Form for Update/Insert.  The grid renders correctly...the Edit Form opens correctly when I click either the Update link or the Add New Record link.

I use the RadGrid1_UpdateCommand to process the update event.  I try to extract the changed value from the textbox in the edit form, but the textbox.text returns the old value and not the new value.  Hence I cannot process the update.  Same is true with the insert.

I spent hours checking postings and demo materials and couldn't find the answer.  Very frustrating and time-consuming.  Just about ready to abandon this but thought I should give me one last shot and hopefully someone will be able to offer some advise.

Below are the code snippets.  Any comments or advise will be greatly appreciated.

Thanks.

Barry
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="EditDepartment.aspx.vb" Inherits="EditDepartment" title="Untitled Page" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">  
    &nbsp;  
      
     <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
         <AjaxSettings> 
             <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                 <UpdatedControls> 
                     <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                 </UpdatedControls> 
             </telerik:AjaxSetting> 
         </AjaxSettings> 
     </telerik:RadAjaxManager> 
          
    <asp:Panel ID="Panel2" runat="server" BorderColor="Silver" BorderStyle="solid" BorderWidth="1px" 
        Height="200px" Style="z-index: 101; left: 4px; position: relative; top: 0px" 
        Width="95%">  
        <telerik:RadTextBox ID="radTextBox2" runat="server" Style="z-index: 101; left: 1px;  
            position: absolute; top: 6px" Text="abc" Width="100px">  
        </telerik:RadTextBox> 
        <telerik:RadGrid ID="RadGrid1" runat="server"   
            GridLines="None" AutoGenerateColumns="True" AutoGenerateEditColumn = "true"   
            Skin="Office2007" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"   
            AllowAutomaticUpdates="true" ShowFooter="True" > 
           <MasterTableView CommandItemDisplay="Bottom">  
               <EditFormSettings> 
                   <EditColumn UniqueName="EditCommandColumn1">  
                   </EditColumn> 
               </EditFormSettings> 
            </MasterTableView> 
            <ClientSettings EnablePostBackOnRowClick="True">  
            </ClientSettings> 
        </telerik:RadGrid></asp:Panel> 
          
</asp:Content> 
 

 
    Protected Sub RadGrid1_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand  
 
        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)  
 
        Dim textbox As TextBox  
        textbox = CType(editedItem("description").Controls(0), TextBox)  
 
    End Sub 
Barry
Top achievements
Rank 1
 answered on 09 Sep 2009
10 answers
258 views
Hi,

I managed to do this: have a panel bar with a IEnumerable data source (List<Address>). I have a template defined for the panelitem and it populates just fine with the contents of each address objects in the template.

However, the panel bar items do not collapse/expand, they're fixed and all visible. I would like each item to be collapsable, so basically I would like each template to be inside another radpanelitem I figure. Any example/suggestion would be appreciated.

Thanks
Beth Krawczuk
Top achievements
Rank 1
 answered on 08 Sep 2009
2 answers
111 views
It possible to be add img tag with border="0" properties by default after add new picture in Radeditor?
Because when used we make this picture to picturelink  the browser it showing link border around picture.

Thanks Telerik Team.


Worawut Boontan
Product Manager
TBD
http://www.theiconweb.com


วรวุฒิ
Top achievements
Rank 2
 answered on 08 Sep 2009
4 answers
134 views
I have 2 radgrids and would like to expand a detailview row and populate the second grid from the id of the first grid's expanded row.

I have tried using the itemdatabound of the first grid to set the datasource of the second grid,
but the second grid never refreshes, just keeps the same data.

I have also tried calling the ajax methods from javascript, but the same problem exists.

The only way I was able to do it was from a button that was not connected to either grid.

PS I have turned viewstate off on the second grid.

Thanks,
Jed
Jedidiah Racine
Top achievements
Rank 1
 answered on 08 Sep 2009
1 answer
108 views
Im working on a bar chart where I would like the legend square positioned below the chart and the legend items rendered horizontally. Is this possible and how would I do?
Schlurk
Top achievements
Rank 2
 answered on 08 Sep 2009
1 answer
274 views
Hi Telrik Team

is it Possible to Convert RadGrid Data to XML? i think there is no inbuild method to Export Into XML in rad grid.
please guide me to achieve this.

thanks

Regards
Kathir
Schlurk
Top achievements
Rank 2
 answered on 08 Sep 2009
3 answers
249 views
Happy Labor Day All,

I have RADControls for ASP.net Ajax (October 2008 build) and I'm just now dusting off this toolchest.  I have a site using ASP.net 3.5 on a shared web hosting account that employs Master Pages - one for the public portion of the site, and one for the private portion of the site.

Question:  I'm familiar with RadScriptManager from previous releases (ASP.net pre-Ajax), but not as familiar with RadAjaxManager.  Is RadAjaxManager the replacement for RadScriptManager?  That is, can I use just RadAjaxManager on my master page and not RadScriptManager?  Or, are they two different items serving different purposes? 

Thanks much for your help and insight.  Your assistance is appreciated!
Will
Top achievements
Rank 1
 answered on 08 Sep 2009
14 answers
1.0K+ views

This is an intermittent problem.  Sometimes the captcha image renders as a grey box showing no letters/numbers.  This is only occurring on our load balanced site.

Our Setup:

  • Two Window 2k3 Servers
  • Both servers are storing session within the ASPState database
  • Users bounce between server A and server B per every page request

Behaviors:

  • If I hit the two web servers directly, repeatedly requesting the captcha page - no error occurs
  • When I hit the two web servers using the load balancers, the captcha renders a solid grey box - say 40% of the requests.
  • It does not appear to matter which server the load balancer directs my request, as both web servers will sometimes not render the captcha correctly.
  • When the image does show, I have been unsuccessful thus far as to pass the validation test.


Any help/suggestions are appreciated.  Thanks
Tim

Joe
Top achievements
Rank 2
 answered on 08 Sep 2009
2 answers
146 views
Hello,

I need some help to finalize my radgrid implementation, being unable after hours of try to have desired fonctionalities.
Here are my hyposthesis:
- the grid is displayed in a pagewiew from a tabstrip/multipage having a 100% width,
- I have 30 k to 200K rows to display,
- each row contains a variable number of columns, depending of initial sql request: 3 to 30, each column must have a different display width, some need only 30px but some other 300px,
- user should be able to adapt column width clientside,
- Columns are autogenerated from datatable but I use Radgrid_ColumnCreated to fix each initial row display parameter, header width and wrap for header and content, some columns are DateTime some integer, Guid or string,
- row size should not be extended to more than one line, so for some columns, I use content wrap false,
- I use paging and need vertical scrolling because using a 200 row page size necessitate scrolling in a 20 row display window
- I have suppressed MaterTable viewstate to limit page size (displaying a radChart in the other Tab)
- I use the RadGrid needdatasource handler to generate an adapted table to the requet,

Here is my grid declaration
    <Telerik:RadPageView ID="PageView2" runat="server">  
        <div id='Zone2' style="float:left; position: relative; min-height:400px; min-width:980px; width:100%;">  
            <div id='ExportDiv' runat="server" style="float:left; width: 100%;" > 
                <asp:ImageButton ID="BtnExport2Excel" SkinID='Export2Excel' AlternateText="" runat="server" style="float:left;" /> 
                <asp:ImageButton ID="BtnExport2Word" SkinID='Export2Word' AlternateText="" runat="server" style="float:left;" /> 
            </div> 
            <Telerik:RadGrid ID="RadGrid1" runat="server" PageSize='20' AllowPaging="True"  AllowSorting="True" GridLines="None" ShowStatusBar='true' > 
                <MasterTableView TableLayout='Fixed' > 
                    <Columns> 
                    <Telerik:GridClientSelectColumn UniqueName='SelectColumn'  HeaderStyle-Width="30px"/>  
                   </Columns> 
                </MasterTableView> 
                <ClientSettings > 
                    <Selecting AllowRowSelect="True" /> 
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" /> 
                    <Resizing ResizeGridOnColumnResize="true" AllowColumnResize="True" ClipCellContentOnResize="true" /> 
                </ClientSettings> 
                <PagerStyle Mode"NextPrevAndNumeric" /> 
            </Telerik:RadGrid> 
        </div> 
    </Telerik:RadPageView> 
 
and in codebehind in Page_Load
            RadGrid1.AllowCustomPaging                                      =   true;  
                RadGrid1.ShowGroupPanel                                     =   false;  
                RadGrid1.AllowFilteringByColumn                             =   false;   
                RadGrid1.ClientSettings.AllowDragToGroup                    =   false;  
                RadGrid1.ClientSettings.Scrolling.EnableVirtualScrollPaging =   false;  
 
+ in OnInit RadGrid1.MasterTableView.EnableViewState = false;

With all this I am unable to reach the desired effect:

1) The column size I fix in Column_Created are not all respected, for exemple I use this code for a GridDateTime column named stractivitytime

        void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)  
        {  
            if ( !(e.Column is GridEditableColumn) )  
                return;  
            string colName                  =   e.Column.HeaderText; //default  
                          
            if ( e.Column is GridBoundColumn )  
            {  
                colName                     =   ((GridBoundColumn)e.Column).DataField.ToLower();  
                // clipping on values ??? , avoid typecode because we need to transform it on ItemGridDataBound  
                //if ( ( colName != MNSTR.strtypecode ) || ( colName != MNSTR.strcrmuserid) ||  ( colName != MNSTR.strcrmitemid) )  
                //    ((GridBoundColumn)e.Column).DataFormatString = "<nobr>{0}</nobr>";     
            }  
            else if (e.Column is GridCheckBoxColumn)  
                colName = ((GridCheckBoxColumn)e.Column).DataField.ToLower();  
            else if (e.Column is GridTemplateColumn)  
                colName = ((GridTemplateColumn)e.Column).DataField.ToLower();  
            else if (e.Column is GridDropDownColumn)  
                colName = ((GridDropDownColumn)e.Column).DataField.ToLower();  
              
            string newName                      =   string.Empty;  
            bool display                        =   true;  
            switch (colName)  
            {  
                case MNSTR.strid:  
                    newName                     =   LocalizeHelper.Localize(MNSTR.id, "Id");  
                    display                     =   Settings[MNSTR.id].ToBool();  
                    e.Column.HeaderStyle.Width  =   new Unit("50px");  
                    break;  
                case MNSTR.stractivitytime:  
                    newName                     =   LocalizeHelper.Localize(MNSTR.activitytime, "Activity Time");  
                    e.Column.HeaderStyle.Width  =   new Unit("200px");  
                    e.Column.ItemStyle.Wrap     =   false;  
                    display                     =   true;  
                    break;  
etc. 
with this code I get a 30px column size for stractivitytime column for witch I need a 200px size.
Some text column get their desired width, I found no rules for this size attribution.
I tested in IE8 and FireFix 3.x

2) resizing of columns doesn't work: when I move the column header right side I obtain a dimension box giving a size, but when I release it, the column size is quite not changed ( I increase it to 300px and get a 32px result on mouse release ?????)
I tried to play with parameters in Column.Header.Style or Column.ItemStyle  like wrap and width with no results.


Is it possible to have the desired effects:
- paging
- scrolling vertically and horizontally
- fixing each start column width/wrapping and allowing users to change width



Thanks for help.

CS

Schlurk
Top achievements
Rank 2
 answered on 08 Sep 2009
2 answers
136 views
Hello,

Is it possible for the scheduler control to operate in somekind of resource mode where the Resources
are on the vertical axis and hours are on the horizontal axis.

Thanks in advance,

Jaap Groenendaal
HaiTek
Top achievements
Rank 1
 answered on 08 Sep 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?