Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
171 views
What is the expected behavior of the RadGrid.MasterTableView.Columns.Insert and RadGrid.MasterTableView.Columns.AddAt methods?

It seems to be replacing the column at the index position I specify, instead of inserting the column and shifting everything else in the collection across.

GridColumn employeeRateCol = RadGridSummary.MasterTableView.Columns.FindByUniqueName("EmployeeRate");
GridDropDownColumn rateType = new GridDropDownColumn();
int index = RadGridSummary.MasterTableView.Columns.IndexOf(employeeRateCol);
RadGridSummary.MasterTableView.Columns.Insert(index, rateType);


If i use the Add method, everything works as expected, but I don't want this dynmaically created column to appear as the last column

I am using the .NET 4 version of the Q1 2010 release
Mira
Telerik team
 answered on 22 Jul 2010
1 answer
114 views
I am simply trying to read the selected value of an item that is selected in RadComboBox but I am unable to do so.  The SelectedValue value is always empty.  This is a pretty simple usage case so I don't understand why this should be difficult.  Does anyone know what is going on?

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim cmd As New SqlCommand
    Dim con As New SqlConnection
    Dim da As New SqlDataAdapter
    Dim ds As New DataSet
 If (Not Page.IsPostBack) Then
    cmd.Connection = con
    con.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
 
    con.Open()
    cmd.CommandText = "select top 100 CustomerID, isnull(Title, '') as Title, FirstName, LastName, FirstName + LastName as FullName from saleslt.customer"
 
    da.SelectCommand = cmd
    da.Fill(ds)
 
    RadComboBox1.DataValueField = "CustomerID"
    RadComboBox1.DataTextField = "FullName"
 
    RadComboBox1.DataSource = ds
    RadComboBox1.DataBind()
end if
End Sub
 
Protected Sub RadComboBox1_SelectedIndexChanged(ByVal o As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
    Dim s As String
 
    s = e.Value
    s = RadComboBox1.SelectedValue
 
End Sub

<telerik:RadComboBox ID="RadComboBox1" runat="server" Width="420"
    AllowCustomText="True" MaxHeight="300px" Filter="Contains" AutoPostBack="True">
    <HeaderTemplate>
        <ul>
            <li class="col1">Title</li>
            <li class="col2">First Name</li>
            <li class="col3">Last Name</li>
        </ul>
    </HeaderTemplate>
    <ItemTemplate>
        <ul>
            <li class="col1"><%#DataBinder.Eval(Container.DataItem, "Title").ToString()%></li>
            <li class="col2"><%#DataBinder.Eval(Container.DataItem, "FirstName").ToString()%></li>
            <li class="col3"><%#DataBinder.Eval(Container.DataItem, "LastName").ToString()%></li>
        </ul>
    </ItemTemplate>
</telerik:RadComboBox>
Kalina
Telerik team
 answered on 22 Jul 2010
1 answer
104 views
My website users are report that they lose data when they forget to Save and such, and so I want to auto-save the data every minute using Ajax.

I have an excel-like grid that I want to auto-save using Ajax.  Would you recommend the AjaxPanel or AjaxManager?  And how can I hook up the timer to call Ajax?  
Thanks!
Mira
Telerik team
 answered on 22 Jul 2010
3 answers
226 views
Hi all,

I have two tables in an SQL database. One contains Customer details and the other contains Contact names. There is a one to many relationship between Customers and Contacts. I have a Radgrid for the Customers table and I'm using a pop-up EditForm for insert/update. On the EditForm there is a RadCombo to select a contact. I only want to populate this combo with the Contact Names for the selected Customer.

Below is my code. Currently it' not populating the Combo Box at all. What am I doing wrong?

Many thanks in advance,

Neil

<%@ Page Title="" Language="VB" MasterPageFile="~/Pages/SiteMaster.master" AutoEventWireup="false" CodeFile="TestCustomers.aspx.vb" Inherits="Pages_Bookings_Customers" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phTopContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phMainContent" Runat="Server">
  
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" 
        DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        MinDisplayTime="100" Skin="Sunset"
    </telerik:RadAjaxLoadingPanel>    
      
    <div style="float: none; clear: both">
  
        <telerik:RadGrid ID="RadGrid1"
            runat="server"
            DataSourceID="dsCustomers"
            AllowAutomaticInserts="True" 
            AllowAutomaticUpdates="True" 
            AllowFilteringByColumn="True" 
            AllowPaging="True" 
            AllowSorting="True" 
            GridLines="None"
            Width="500px"
            Height="700px" 
            PageSize="20" 
            ShowStatusBar="True" 
            Skin="Sunset"
            EnableAJAXLoadingTemplate="True"
            EnableAJAX="True">
  
            <MasterTableView 
                DataKeyNames="CustomerID" 
                DataSourceID="dsCustomers"
                AutoGenerateColumns="False" 
                CommandItemDisplay="Top" 
                EditMode="PopUp">
                      
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
  
            <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
              
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" 
                        UniqueName="EditCommandColumn" 
                        HeaderStyle-Width="40px">
                    </telerik:GridEditCommandColumn>
                      
                    <telerik:GridBoundColumn DataField="CustomerID" 
                        DataType="System.Int32" 
                        HeaderText="CustomerID" 
                        ReadOnly="True" 
                        SortExpression="CustomerID" 
                        UniqueName="CustomerID" 
                        Visible="true">
                    </telerik:GridBoundColumn>
                      
                    <telerik:GridBoundColumn DataField="CustName" 
                        HeaderText="Customer Name" 
                        SortExpression="CustName" 
                        UniqueName="CustName" 
                        Visible="True">
                    </telerik:GridBoundColumn>
                     
                </Columns>
  
            <EditFormSettings 
                EditFormType="Template"              
                CaptionFormatString='Edit Customer: {0}' 
                CaptionDataField="CustName" 
                InsertCaption="Add New Customer" 
                PopUpSettings-Width="400px">
                <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                <FormTemplate>
                    <table id="outer_table">
                        <tr>
                              
                            <td  NOWRAP>
                                <asp:Label ID="Label1" runat="server" Text="Customer Name:" AssociatedControlID="tbCustName" />
                            </td>
                            <td>    
                                <telerik:RadTextBox ID="tbCustName" 
                                    runat="server" 
                                    width="250px"
                                    Text='<%# Bind( "CustName" ) %>'>
                                </telerik:RadTextBox>
                            </td>    
                       </tr>
   
                               <tr>
                                    <td nowrap style="vertical-align: top">    
                                        <asp:Label ID="Label17" runat="server" Text="Default Booking Contact:" AssociatedControlID="cbBookingContact" />
                                    </td>
                                    <td
                                        <telerik:RadComboBox ID="cbBookingContact"                                             
                                            Runat="server" 
                                            Skin="Sunset"                                            
                                            DataSourceID="dsBookingContact" 
                                            DataTextField="ContactName" 
                                            DataValueField="ContactID"
                                            SelectedValue='<%# Bind("DefaultBookingContactID") %>' 
                                            Width="255" 
                                            MarkFirstMatch="True" 
                                            Filter="Contains" 
                                            AppendDataBoundItems="True" 
                                            Text="Select a contact">
                                            <Items>
                                                <telerik:RadComboBoxItem  Value="" Text=""/>
                                            </Items>
                                              
                                        </telerik:RadComboBox>
                                    </td>
                               </tr>
                               <tr>
                                    <td align="left" colspan="2">
                                        <asp:Button ID="btnUpdate" 
                                            Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
                                            runat="server" 
                                            CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>' />
                                           
                                        <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                                CommandName="Cancel"></asp:Button></td>
                               </tr>
                            </table
  
   
          
                     
                </FormTemplate>
  
            </EditFormSettings>
            </MasterTableView>
              
            <GroupingSettings CaseSensitive="False" />
              
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
        </telerik:RadGrid>
          
        <asp:SqlDataSource ID="dsCustomers" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT Customers.CustomerID, Customers.CustName, Customers.DefaultBookingContactID FROM Customers LEFT OUTER JOIN AccountStatus ON Customers.AccountStatusID = AccountStatus.AccountStatusID ORDER BY Customers.CustCode" 
            InsertCommand="INSERT INTO [Customers] ([CustName], [DefaultBookingContactID]) VALUES (@CustName, @CustCode,  @DefaultBookingContactID)" 
            UpdateCommand="UPDATE [Customers] SET [CustName] = @CustName, [DefaultBookingContactID] = @DefaultBookingContactID WHERE [CustomerID] = @CustomerID">
  
            <UpdateParameters>
                <asp:Parameter Name="CustName" Type="String" />
                <asp:Parameter Name="DefaultBookingContactID" Type="Int32" />
                <asp:Parameter Name="CustomerID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="CustName" Type="String" />
                <asp:Parameter Name="DefaultBookingContactID" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
          
  
         <asp:SqlDataSource ID="dsBookingContact" runat="server" 
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
            SelectCommand="SELECT ContactID, ContactName, CustomerID FROM Contacts WHERE (CustomerID = @CustomerID) ORDER BY ContactName">
             <SelectParameters>
                 <asp:ControlParameter ControlID="RadGrid1" Name="CustomerID" 
                     PropertyName="SelectedValue" />
             </SelectParameters>
        </asp:SqlDataSource>    
  
    </div>
</asp:Content>
Pavlina
Telerik team
 answered on 22 Jul 2010
3 answers
188 views
Hi,

I have a RadGrid with 2 column (customer_number, and customer_name). When I click on the Add New Record, I would like to build 2 combox (google like), 1 for customer_number and 1 for customer_name, both has 2 columns customer_number and customer_name and  when we select a value from either box, I would like to update the other box with its corresponding value.  These comboxes are pulling data from MS Access while this RadGrid is from SQL.

Thanks



Daniel
Telerik team
 answered on 22 Jul 2010
3 answers
95 views
I have the version 2010.2.720 and I am still having problems with it not uploading all of the files.  The admin thread says there is a version 2010.2.721 but that doesn't show up on the new internal builds.  I also tried using the handler but the uploads still fail.
Chris
Top achievements
Rank 1
 answered on 22 Jul 2010
5 answers
170 views
I want have a combobox that allows free text and a date picker icon only (no extra text box)

I can populate the combobox myself if I get a postback with the date selection.
Can I make the text box in a datepipcker hidden?
Thomas
Top achievements
Rank 1
 answered on 22 Jul 2010
1 answer
63 views
I am using RadGrid inside a RadMultiPage with 2 pages inside.
On each RadPageView I have a RadGrid inside. on RadPageView1, radGrid1 is rendering properly and this PageView is default.
When I click on RadTabpStrip for Second RadPageView , the RadGrid is rendering properly but continuously flickering / resizing.
but it is not posting back and no loading panel is displayed.

The same page is hosted on different machine is working fine.
 
The difference in between two machines is nothing. same IIS, same ASP.net runtime binding, same IIS settings ...
I see the view Source of pages that rendered in IE from both machines these are differences
  • from page that didnot flicker
... WebResource.axd?d=5HPxgnGtzes8WoxQ6S8BNQ2&amp;t=634116954612965247 ...
... /ScriptResource.axd?d=Eyv-e9dZioIZivVSIFJbHHN7w0LqO85Y0LWEb-3RXt1DZu3iD0XkEMg8bjNKxxzP0feZZOXbG-KeiZh21zwtkxfBNaXSHhicEw_KYWmiH_o1&amp;t=58e0df9d ...
...
like these ScriptResource.axd?d kind of differences only

  • from page that flicker
... /WebResource.axd?d=5HPxgnGtzes8WoxQ6S8BNQ2&amp;t=634117900279042350 ...
... /ScriptResource.axd?d=Eyv-e9dZioIZivVSIFJbHHN7w0LqO85Y0LWEb-3RXt1DZu3iD0XkEMg8bjNKxxzPqWsK5IDTFG5EkTIMjnOtF7vgb17u6LAELlCfTgRVNLQ1&amp;t=ffffffffe5251f5f"  ...

In both machines I have Telerik.Web.UI.dll, version 2009.02.0826.20 is in GAC. no other Telerik.Web.UI.dll is not in GAC.

any help ???
Pavlina
Telerik team
 answered on 22 Jul 2010
3 answers
263 views

hi

i have a grid in a nested view template with  a GridDateTimeColumn in it , but on insert/edit mode the datepicker does not show , it simply seems to go to the top of the screen when the picker button is clicked ,
the column is created as follows :-

        private GridDateTimeColumn CreateDateGridColumn(XmlAttribute xAtt, XmlNode xControl, RadAjaxPanel PlaceHolder1)  
        {  
            System.Web.UI.Control Test = Builder.FindControl(PlaceHolder1.Controls, xAtt.Name + "Editor");  
            if (Test.ID == null)  
            {  
                GridDateTimeColumnEditor DTE = new GridDateTimeColumnEditor();  
                DTE.ID = xAtt.Name + "Editor";  
 
                PlaceHolder1.Controls.Add(DTE);  
            }  
 
            GridDateTimeColumn DT = new GridDateTimeColumn();  
            DT.UniqueName = xAtt.Name;  
            DT.HeaderText = xControl.Attributes["Caption"].Value;  
            DT.PickerType = GridDateTimeColumnPickerType.DatePicker;  
            DT.DataFormatString = "{0:MM/dd/yyyy}";  
            DT.ColumnEditorID = xAtt.Name + "Editor";  
            DT.DataField = xAtt.Name;  
            DT.SortExpression = xAtt.Name;  
            DT.ItemStyle.Width = Unit.Pixel(120);  
            DT.FilterControlWidth = Unit.Pixel(50);  
            DT.DataType = System.DateTime;  
 
            DT.EmptyDataText = " ";  
            return DT;  
        } 

the grid is created in the Page_init function, i am also using the latest version of the telerik controls.

can anyone suggest a reason why the picker would not be popping up ?

Peter.
Peter Maslin
Top achievements
Rank 1
 answered on 22 Jul 2010
6 answers
201 views
Hello ,

I need to display Images saved in database (Binary format) in radrotator . Is their a easy way to Achieve this or some demo which can help  ?
 Any help will be Appreciated .

Thanks
Vipin Ajmera
Pero
Telerik team
 answered on 22 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?