Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
167 views
Hello

How I can persist the RadGrid Aggregate State ?


Best Greetings

Cyril
Kostadin
Telerik team
 answered on 26 Aug 2013
6 answers
94 views
Hi,

Is it possible? A grid with dynamic structure of columns on 2nd level of the grid.

Example:

A grid with 2 rows ( RowA, RowB )

When I click on RowA , it opens another row (2nd level ) with columns X,Y,Z
and
When I click on RowB, it opens other structure with columns A,B,C

Thanks, 
Thiago Scaranto
Thiago
Top achievements
Rank 1
 answered on 26 Aug 2013
2 answers
634 views
Hi

I have been searching for hours, but haven't managed to find any relevant help.
I'm coding based on the following example "Grid - User Control Edit Form". My only issue is that my code is slightly more complicated as I'd like to make use of functional code on the user control.

In my example I have a RadGrid with a list of users. I want to be able to insert users from this user control edit form.  
There is a RadGrid on the edit form that will need to be populated based on user entry into certain text boxes. The user will click on a search button and the RadGrid will be populated with the relevant results. The user will then select the relevant record from the grid to populate some other textboxes on the same form.
My issue is that I can't get this grid to update. I've tested with simple label and it won't update either. The event does fire, I can step through it while debugging, but the update is not done.
My only assumption is that this is due to an ajax issue or setting that I'm missing.

My code is as follows (I am only going to post the relevant code).

aspx:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="true"></telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManagerManager" runat="server">
        <AjaxSettings>           
            <telerik:AjaxSetting AjaxControlID="CustomerGrid">
                <UpdatedControls><telerik:AjaxUpdatedControl ControlID="CustomerGrid" LoadingPanelID="RadAjaxLoadingPanel1" /></UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" Transparency="30" Skin="WebBlue"></telerik:RadAjaxLoadingPanel>
 
 
        <telerik:RadGrid ID="CustomerGrid" runat="server" Skin="WebBlue" PageSize="10" Width="100%"
            AllowPaging="true" AutoGenerateColumns="False" HorizontalAlign="Center"
            ShowStatusBar="True" OnItemCreated="RadGrid1_ItemCreated" AllowAutomaticInserts="true"
            CellSpacing="0" GridLines="None" AllowSorting="True" AllowFilteringByColumn="true"
            EnableLinqExpressions="false">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <GroupingSettings CaseSensitive="false" />
        <FilterMenu EnableImageSprites="False"></FilterMenu>
        <ClientSettings>
            <Selecting AllowRowSelect="true"/>
            <ClientEvents OnRowSelected="RowSelected" />
        </ClientSettings>
        <MasterTableView CanRetrieveAllData="true" CommandItemDisplay="Top" DataKeyNames="CustomerId,CustomerName,CustomerFullAddress" EditMode="PopUp">
        <CommandItemSettings AddNewRecordText="Add New Customer" />
        <EditFormSettings UserControlName="helpers/Customer_Form.ascx" EditFormType="WebUserControl" InsertCaption="Add New Customer" CaptionFormatString="Edit CustomerId: {0}" CaptionDataField="CustomerId">
            <PopUpSettings Modal="True" Width="750px"></PopUpSettings>
        </EditFormSettings>           
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="CustomerId" Display="false" HeaderText="NV" SortExpression="customerId" Visible="true" UniqueName="CompanyIdd"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CustomerLat" Display="false" HeaderText="NV" SortExpression="customerId" Visible="true" UniqueName="cusLatt"></telerik:GridBoundColumn>
                 <telerik:GridBoundColumn DataField="CustomerLon" Display="false" HeaderText="NV" SortExpression="customerId" Visible="true" UniqueName="cusLonn"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CustomerName" HeaderText="Name" SortExpression="customerName" UniqueName="customerNamee" ShowFilterIcon="false" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CustomerFullAddress" HeaderText="Address" SortExpression="adress" UniqueName="adresss" ShowFilterIcon="false" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
                <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="50px" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="center" HeaderText="History" UniqueName="vhistory">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="rbtnViewhistory" CommandName="ViewHistory" CommandArgument='<%# Eval("CustomerId") %>' ><asp:Image ID="deleteButton" runat="server" ImageUrl="images/icons/general/icon_general_view.png" AlternateText="Delete" /></asp:LinkButton>
                        </ItemTemplate>
                </telerik:GridTemplateColumn>
           </Columns>
        </MasterTableView>


The user control ascx:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Customer_Form.ascx.cs" Inherits="helpers_Customer_Form" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 <table width="100%" cellpadding="5px">
        <tr>
            <td style="width:110px;"><asp:Label ID="lblCustomerName" runat="server" Text=" Customer Name"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbCustomerName" runat="server" Text=""></telerik:RadTextBox></td>
        </tr>
        <tr>
            <td><asp:Label ID="lblFirstname" runat="server" Text=" Firstname"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbFirstname" runat="server" Text=""></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblLastname" runat="server" Text=" Surname"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbLastname" runat="server" Text=""></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblAddress1" runat="server" Text=" Address1"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbAddress1" runat="server"></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblAddress2" runat="server" Text=" Address2"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbAddress2" runat="server" Text="" ></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblAddress3" runat="server" Text=" Address3"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbAddress3" runat="server" Text=""></telerik:RadTextBox></td>
        </tr><tr>
            <td valign="top"><asp:Label ID="lblPostalCode" runat="server" Text=" Postal Code"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbPostalCode" runat="server" Text="" MaxLength="4" Width="40px" ></telerik:RadTextBox>
                <telerik:RadButton ID="btnG1" runat="server" onclick="btnG1_Click" Text="Get Results" Width="110px" AutoPostBack="true" />
                <br />
                <telerik:RadGrid ID="GridGeoResults" runat="server" Skin="WebBlue" PageSize="20" AllowPaging="True" AutoGenerateColumns="False"
                    ShowStatusBar="True" CellSpacing="0" GridLines="None" AllowSorting="True" AllowFilteringByColumn="False"
                    OnItemDataBound="GridGeoResults_ItemDataBound" AllowMultiRowSelection="false" >
                    <PagerStyle Mode="NextPrevAndNumeric" />
                    <ClientSettings><Selecting AllowRowSelect="true" /></ClientSettings>
                    <MasterTableView AllowAutomaticInserts="false" AutoGenerateColumns="False" Width="100%">
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="" HeaderStyle-Width="20px"   >
                              <ItemTemplate>
                                  <asp:RadioButton ID="selectRadioButton" runat="server" OnCheckedChanged="selectRadioButton_CheckedChanged" AutoPostBack="true" />
                              </ItemTemplate>
                             </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="Address" ItemStyle-Wrap="false" HeaderText="Address" SortExpression="Address" UniqueName="Address"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Result1" ItemStyle-Wrap="false" HeaderText="Result1" SortExpression="Result1" UniqueName="Result1"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Result2" ItemStyle-Wrap="false" HeaderText="Result2" SortExpression="Result2" UniqueName="Result2"></telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="50px" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="center" HeaderText="">
                                <ItemTemplate>
                                    <asp:LinkButton runat="server" ID="viewMapLinkButton"><asp:Image ID="viewButton" runat="server" ImageUrl="../images/icons/mapping/numbers/green.png" Width="15px" Height="15px" AlternateText="View on Map" ToolTip="View on Map" /></asp:LinkButton>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                 
            </td>
        </tr><tr>
            <td><asp:Label ID="lblResult1" runat="server" Text=" Result1"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbResult1" runat="server"></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblResult1" runat="server" Text=" Result2"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbResult2" runat="server"></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblTel1" runat="server" Text=" Tel1"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbTel1" runat="server" Text=""></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblTel2" runat="server" Text=" Tel2"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbTel2" runat="server" Text=""></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblFax1" runat="server" Text=" Fax1"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbFax1" runat="server"></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblFax2" runat="server" Text=" Fax2"></asp:Label></td><td>
            <telerik:RadTextBox ID="tbFax2" runat="server"></telerik:RadTextBox></td>
            </tr><tr>
            <td><asp:Label ID="lblEmail1" runat="server" Text=" Email1"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbEmail1" runat="server"></telerik:RadTextBox></td>
        </tr><tr>
            <td><asp:Label ID="lblEmail2" runat="server" Text=" Email2"></asp:Label></td>
            <td><telerik:RadTextBox ID="tbEmail2" runat="server"></telerik:RadTextBox></td>
        </tr><tr>
            <td colspan="2">
                <telerik:RadButton ID="rbtnInsertCustomer" runat="server" Text="Add" CommandName="InsertCustomer" Width="110px"></telerik:RadButton>
                <telerik:RadButton ID="rbtnCancelCustomerInsert" runat="server" Text="Cancel" CommandName="CancelCustomerInsert" Width="110px"></telerik:RadButton>
                <br /><asp:Label ID="lblError1" runat="server" Visible="false" CssClass="errorLabel" />         
            </td>
        </tr>
    </table>

ascx.cs
public partial class helpers_Customer_Form : System.Web.UI.UserControl
{
    User loggedInUser;
    private object _dataItem = null;
 
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.AjaxSettings.AddAjaxSetting(btnGeocode1, btnGeocode1);
        manager.AjaxSettings.AddAjaxSetting(btnGeocode1, GridGeoResults);
        manager.AjaxSettings.AddAjaxSetting(btnGeocode1, lblError1);
 
        loggedInUser = (User)HttpContext.Current.Session["loggedInUser"];  
    }
 
    #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
        InitializeComponent();
        base.OnInit(e);
    }
 
    /// <summary>
    ///          Required method for Designer support - do not modify
    ///          the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
        // this.DataBinding += new System.EventHandler(this.helpers_Customer_Form_DataBinding);           
         
    }
 
    #endregion
 
    public object DataItem
    {
        get
        {
            return this._dataItem;
        }
        set
        {
            this._dataItem = value;
        }
    }
 
 
    protected void btnG1_Click(object sender, EventArgs e)
    {
    /* THIS CODE IS EXECUTING WITH NO ISSUES - BUT UPDATES AREN'T BEING SHOWN */
 
        this.lblError1.Text = "Test";
        this.lblError1.Visible = true;
 
        this.GridGResults.DataSource = GetMyInfoHere(null, tbAddress1.Text);
        this.GridGResults.DataBind();
    }
 
 
    protected void GridGResults_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            DataRowView drv = (DataRowView)e.Item.DataItem;
            // add functionality here
        }
    }
 
    protected void selectRadioButton_CheckedChanged(object sender, EventArgs e)
    {
        GridDataItem gridItem = (sender as RadioButton).Parent.Parent as GridDataItem;
 
        this.tbResult1.Text = gridItem.Cells[4].Text;
        this.tbResult2.Text = gridItem.Cells[5].Text;
        this.GridGResults.Visible = false;       
    }
}

In the above code the problem is in the ascx.cs file in the "protected void btnGeocode1_Click(object sender, EventArgs e)" function. It is being called and I can step through it while debugging, but the label is not shown and the grid's data is not updated. 

I've tried numerous options with the ajax settings - these include setting it up like above, using the ajaxproxy, adding an ajax manager to the actual user control. I've taken the AutoPostBack off and put it on.

Nothing is working.

Any help would be greatly appreciated.
Tracy-Lee
Top achievements
Rank 1
 answered on 26 Aug 2013
1 answer
112 views
Hi,

I am trying to translate the headers of "from" & "to" in my radgrid range filtering to hebrew. but what, i am having troubles doing so.

screenshots is attached.

Another thing, I am trying to translate all my grid controls ( what is the best way to link the resx file to the grid? I tried changing the culture property to he. Culture="he".

Please help.

Thank you
Tal
Princy
Top achievements
Rank 2
 answered on 26 Aug 2013
1 answer
193 views
Hi have a rad menu that is set in the master page and has all the url/links added there.


I am trying to change two of the radMenuitems navigation links from my aspx page code behind
D) replace the link with a javascript click event.
E) when you click then fire a vb.net void click event

thanks
Protected Sub Page_Load(sender As Object, e As EventArgs)
 
 
  Dim rmenu As RadMenu = DirectCast(Master.FindControl("mymenu"), RadMenu)
  Dim D As RadMenuItem = DirectCast(rmenu.FindControl("dogs"), RadMenuItem)
  Dim E As RadMenuItem = DirectCast(rmenu.FindControl("cats"), RadMenuItem)
 
  
  D.NavigateUrl = nothing
  E.NavigateUrl = nothing
 
  
  D.click = "alert('you clicked on dogs')"
  E.click = Button1_Click
 
End Sub
 
 
Protected Sub Button1_Click(sender As Object, e As EventArgs)
    'do this for cats only
End Sub


Shinu
Top achievements
Rank 2
 answered on 26 Aug 2013
1 answer
64 views
Hello,

I have a custom Advanced Form that I made using the template. I pretty much copy pasted from the sample code but when I run it I get this error: Could not load type 'RadSchedulerAdvancedFormAdvancedForm'

The AdvancedForm.ascx page seems to inherit it. It worked fine when I was developing just not when I deployed it to the server.

I thought it might have been a typo but it does the same thing for 'RadSchedulerAdvancedForm'
Plamen
Telerik team
 answered on 26 Aug 2013
1 answer
87 views
Hi,
How to do the corners of the rad menu?
or
Any good and simple css for the rad menu?

Thanks
Princy
Top achievements
Rank 2
 answered on 26 Aug 2013
13 answers
262 views
I have a RadGrid and be put under a RadAjaxLoadingPanel and RadAjaxManager. When click a button to trigger a AJAX post back, my code will have a exception, then I register a RadScriptManager_AsyncPostBackError event to pass the error message to client as following javascript code:

 Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function(sender, args)
       {
            var error = args.get_error();
            if (error != undefined && error.httpStatusCode == '500')
            {
                args.set_errorHandled(true);
                var message = error.message.replace(error.name + ":","");
alert(message);
            }
       });

My concern is that the loading icon in RadGrid is still running at the left-bottom corner as attached image. I don't know why and how to let it not running.
Eyup
Telerik team
 answered on 26 Aug 2013
21 answers
3.2K+ views
Hi,

I have a radgrid using editmode inplace.  It has the Add new record button and a GridEditcommandcolumn for insert/cancel/edit/update/delete. My end users do not want to click on save for each row. They would like the record to be saved to the database when they click on the Add new record button again and also add another blank row. Can this be done?

Thanks, Jana
Kostadin
Telerik team
 answered on 26 Aug 2013
1 answer
90 views
Hi,

I built a new Skin using VSB based on 'Hay' telerik skin. When i try to change the ComboBox base color, at fine-tune it continues showing the old color on Hovered and Focused style.

Probably it is not automatic changing the base color image from radFormSprite* files.

Is there any solution for it?

Tks,
Rafael
Antonio Stoilkov
Telerik team
 answered on 26 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?