Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
106 views
I have a very plain drop down with only a few entries.  Before this morning, the list is populated and you could click on any entry and nothing happened...which was fine because there was no code.  Now I want it to do something when one of the list items is selcted (redirect to another page).  So I added OnSelectedItemChanged = "RadComboBox1_OnSelectedItemChanged" to the html definition of the combobox, then in the code behind I have a function to match that does a Select Case statement and redirects to the appropriate page based on which item the user selects.

Now that I've added this code I can't click on the ComboBox anymore.  It doesn't drop-down like it should.

HTML Page:
Choose Location: 
<telerik:RadComboBox ID="RadComboBox1" Runat="server" DropDownWidth="200px"
    EnableTextSelection="False" Height="50px" MaxHeight="200px" NoWrap="True"
    Width="200px" OnClientSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
    <Items>
        <telerik:RadComboBoxItem runat="server" Text="Atlanta" Value="ATL" />
        <telerik:RadComboBoxItem runat="server" Text="Cincinnati" Value="CIN" />
        <telerik:RadComboBoxItem runat="server" Text="Cleveland" Value="CLV" />
        <telerik:RadComboBoxItem runat="server" Text="Dayton" Value="DAY" />
        <telerik:RadComboBoxItem runat="server" Text="Kansas City" Value="KC" />
        <telerik:RadComboBoxItem runat="server" Text="Kansas" Value="KAN" />
        <telerik:RadComboBoxItem runat="server" Text="Memphis" Value="MEM" />
        <telerik:RadComboBoxItem runat="server" Text="Northeast Ohio" Value="NEO" />
        <telerik:RadComboBoxItem runat="server" Text="Oklahoma City" Value="OKC" />
        <telerik:RadComboBoxItem runat="server" Text="Philadelphia" Value="PHL" />
        <telerik:RadComboBoxItem runat="server" Text="St. Louis" Value="STL" />
    </Items>
</telerik:RadComboBox>



Code Behind .aspx page:
    Protected Sub RadComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
        Select Case e.Value
            Case "ATL"
 
            Case "CIN"
 
            Case "CLV"
                Response.Redirect("http://www.someurl.com/CLV.asp")
 
            Case "DAY"
 
            Case "KAN"
 
            Case "KC"
 
            Case "MEM"
 
            Case "NEO"
 
            Case "OKC"
 
            Case "PHL"
 
            Case "STL"
 
        End Select
    End Sub
End Class
dean.carrefour
Top achievements
Rank 1
 answered on 04 Aug 2011
1 answer
111 views
Hi,

I have a rad editor in one of my modal pop up pages.

I am unable to change the font name (style) of the selected text in the editor. It always defaults to "Verdana" style. I tried various things and i am unable to get this working. I did not find any related article on this in the forums as well. I am testing this in IE 7.

Please suggest me a possible solution.

Thanks and regards,
Damodar
Rumen
Telerik team
 answered on 04 Aug 2011
2 answers
153 views
This seems like it should be really easy and maybe I am just missing something obvious.

I have a simple line chart with 2 lines, its databound.
Y axis is numbers
X axis are dates , last 12 months

It just shows numbers for each date, ie; 1 ,2 , 3 , 4 ..... 11, 12

I want the X axis label to show as dates but I can't figure out how to do it. Using the Chart wizard on the data tab if I set X-Axis to my date column the wizard just disappears before I even click OK.  I have tried a few other ways and I get errors like: Unable to cast object of type 'System.DateTime' to type 'System.String'.

ideas?

thanks





Najid Hanif
Top achievements
Rank 2
 answered on 04 Aug 2011
4 answers
123 views
Hi,

Can you tell me why I can never get the Rad ajax manager to work properly? Everytime I've attempted to use this feature it only partially works. Everything seems to work fine except there is still a postbackto causing my browser to refresh. Is there somthing i'm down wrong?I was under the impression that using this feature will allow me to update a control without the postback, am I wrong? Here's the aspx , followed by the c#
<div id="StatusWrapper">
                <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
                    <ClientEvents OnResponseEnd="OnResponseEnd" OnRequestStart="OnRequestStart"></ClientEvents>
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="btnMakeActive">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="lblStatus" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="BtnSend">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="lblStatus" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <div id="Status">
                    Status:
                        <asp:Label ID="lblStatus" runat="server" Text="Active"></asp:Label>
                </div>
            </div>
protected void btnMakeActive_Click1(object sender, EventArgs e)
   {
       string currentStatus = Staff.GetStaffStatus(id);
       string status = string.Empty;
 
       if (currentStatus == "Active")
           status = "Inactive";
       if (currentStatus == "Inactive")
           status = "Active";
       Staff.UpdateStatus(id, status);
 
       lblStatus.Text = status;
   }
Ron
Top achievements
Rank 1
 answered on 04 Aug 2011
8 answers
417 views
Hi,

I'm building an ASP.NET MVC application, and would like find an easy way to generate and show charts.

Is it possible to use Teleriks library of charts, e.g. RadControls, in an MVC application, and if so, how?

//Erik
Todd Anglin
Top achievements
Rank 2
 answered on 04 Aug 2011
0 answers
78 views
Good Morning Sir,

I have a Parent Grid. in its Item Template i have two more grid. One For Country and second for states.
i bind both grid on the ItemDatabaound of the parent gird. both grid bound successfully bound.
below is the HTML how i put the grid.

<telerik:RadGrid ID="HeaderGrid" runat="server"
        onitemdatabound="HeaderGrid_ItemDataBound" >                    
       <MasterTableView>    
       <ItemTemplate>          
        <asp:Label ID="lblCountryID" runat="server" Visible="true" Text='<%#Eval("CountryID")%> '></asp:Label>      
         <telerik:RadGrid ID="CountryGrid" runat="server">
         </telerik:RadGrid>    
         <telerik:RadGrid ID="StateGrid" runat="server">
         </telerik:RadGrid>
       </ItemTemplate>
       </MasterTableView>
</telerik:RadGrid>


on item databound both grid are bind successfully.
 protected void HeaderGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item ||
            e.Item.ItemType == GridItemType.AlternatingItem)
        {
            int CountryID = Convert.ToInt32(((Label)e.Item.FindControl("lblCountryID")).Text);
            RadGrid CountryGrid= (RadGrid)e.Item.FindControl("CountryGrid");
            con = new SqlConnection("data source=(local);initial catalog=iTracker_DB;persist security info=True;user id=iTrackerUser;password=77Bcc333");
            cmd = new SqlCommand("select * from Country where CountryID = '" + CountryID + "' ", con);
            con.Open();
            SqlDataReader dr = cmd.ExecuteReader();
            DataTable dt = new DataTable();
            dt.Load(dr);
            con.Close();
            CountryGrid.DataSource = dt;
            CountryGrid.DataBind();

            RadGrid StateGrid= (RadGrid)e.Item.FindControl("StateGrid");
            con = new SqlConnection("data source=(local);initial catalog=iTracker_DB;persist security info=True;user id=iTrackerUser;password=77Bcc333");
            cmd = new SqlCommand("select * from State where CountryID = '" + CountryID + "' ", con);
            con.Open();
            SqlDataReader dr1 = cmd.ExecuteReader();
            DataTable dt1 = new DataTable();
            dt1.Load(dr1);
            con.Close();
            StateGrid.DataSource = dt1;
            StateGrid.DataBind();
        }
    }

when i export with this code
 HeaderGrid.ExportSettings.ExportOnlyData = true;
  HeaderGrid.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
only Country data is exported.
how state data can be exported.


please reply soon.
bharat veer
Top achievements
Rank 1
 asked on 04 Aug 2011
2 answers
86 views
I am following the demo from this link http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx except I am working in a VS2010 visualWebPart project for Sharepoint2010.

Is there a way to have the same loadOnDemand functionality this demo provides but without the first item being expanded by default?
 protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadGrid1.MasterTableView.Items[0].Expanded = true;
                RadGrid1.MasterTableView.Items[0].ChildItem.FindControl("InnerContainer").Visible = true;
            }
        }

If I remove "RadGrid1.MasterTableView.Items[0].Expanded = true;", I get the below javascript error
Sys.ArgumentUndefinedException: Value cannot be undefined.
Parameter name: type

I have been messing with this for awhile now and can only get it to work with that first item expanded.
JonathanElsner
Top achievements
Rank 1
 answered on 04 Aug 2011
2 answers
122 views
Hi

I have run into interesting case - Grid shows Aug 2 in view mode and Feb 8 in edit mode.

here is the code that can let you reproduce issue. All 4 columns in the grid will show Aug 2 in view mode, but in Edit mode, only  d4 column will show  Aug 2, rest will display Feb 8.

on ASPX side:

<telerik:RadGrid ID="rgGrid1" runat="server" AutoGenerateColumns="false">
    <MasterTableView EditMode="EditForms">
        <Columns>
            <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
            <telerik:GridDateTimeColumn
                UniqueName="d1"
                PickerType="DateTimePicker"
                DataField="d1"
                HeaderText="d1"
                DataType="System.DateTime"
                EditDataFormatString="MMM dd HH:mm"
                DataFormatString="{0:MMM dd HH:mm}"
                >
            </telerik:GridDateTimeColumn>  
            <telerik:GridDateTimeColumn
                UniqueName="d2"
                DataField="d2"
                HeaderText="d2"
                DataType="System.DateTime"
                EditDataFormatString="MMM dd HH:mm"
                DataFormatString="{0:MMM dd HH:mm}"
                >
            </telerik:GridDateTimeColumn>  
            <telerik:GridDateTimeColumn
                UniqueName="d3"
                DataField="d3"
                HeaderText="d3"
                DataType="System.DateTime"
                ColumnEditorID="ed"
                EditDataFormatString="MMM dd HH:mm"
                DataFormatString="{0:MMM dd HH:mm}"
                >
            </telerik:GridDateTimeColumn>  
 
            <telerik:GridTemplateColumn
                UniqueName="d4"
                HeaderText="d4"
                DataType="System.DateTime"
                ItemStyle-HorizontalAlign="Center"
                HeaderStyle-Width="120px"
                >
                <ItemTemplate>
                    <asp:Label runat="server" ID="lblLastTicket"
                        Text='<%# Eval("d4", "{0:MMM dd HH:mm}") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadDateTimePicker runat="server" ID="txtLastTicket"
                    DbSelectedDate='<%#Bind("d4", "{0:MMM dd HH:mm}") %>'
                    Width="150px"
                    DateInput-ReadOnly="true"
                    DateInput-DateFormat="MMM dd HH:mm"></telerik:RadDateTimePicker>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>           
 
 
        </Columns>
         
    </MasterTableView>
</telerik:RadGrid>
<telerik:GridDateTimeColumnEditor ID="ed" runat="server" ></telerik:GridDateTimeColumnEditor>

on server side:

DateTime dt2 = DateTime.Parse("2011-08-02");

DataTable dttest =
new DataTable();
dttest.Columns.Add(new DataColumn("d1", typeof(DateTime)));
dttest.Columns.Add(new DataColumn("d2", typeof(DateTime)));
dttest.Columns.Add(new DataColumn("d3", typeof(DateTime)));
dttest.Columns.Add(new DataColumn("d4", typeof(DateTime)));
 
DataRow dr = dttest.NewRow();
dr["d1"] = dt2;
dr["d2"] = dt2;
dr["d3"] = dt2;
dr["d4"] = dt2;
dttest.Rows.Add(dr);
rgGrid1.DataSource = dttest;
if (!IsPostBack)
    rgGrid1.DataBind();



Can you explain what is wrong with 1st 3 columns and is there a fix?

Thanks,

Dmitry
Dmitry
Top achievements
Rank 1
 answered on 04 Aug 2011
5 answers
210 views
I have a functional RadGrid with an RadUpload control in the editTemplate. I am also using a RadAjaxManager in which the Grid references itself. For some reason, the LoadingPanel doesn't display (even though I have set the panel in the RadAjaxManager). The loading panel worked fine until I added in the upload control and javascript conditionalPostback code. I've even tried adding a button and label to print some text and although it ajaxifies it still doesn't display the loader (and it's not because of the image).

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gridupload.aspx.cs" Inherits="admin_gridupload" %> 
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head id="Head1" runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
            <telerik:radscriptblock id="RadScriptBlock1" runat="server"
                <script type="text/javascript"
                    //On insert and update buttons click temporarily disables ajax to perform upload actions                     
                    function conditionalPostback(e, sender) { 
                        var theRegexp = new RegExp("\.UpdateButton$|\.PerformInsertButton$", "ig"); 
                         
                        if (sender.EventTarget.match(theRegexp)) { 
                            var upload = $find(window['UploadId']); 
 
                            //AJAX is disabled only if file is selected for upload 
                            if (upload.getFileInputs()[0].value != "") { 
                                sender.EnableAjax = false
                            } 
                        } 
                    }     
                </script> 
            </telerik:radscriptblock> 
             
            <telerik:RadAjaxManager ID="AjaxManager1" runat="server"
            <ClientEvents OnRequestStart="conditionalPostback"/> 
            <AjaxSettings>         
                <telerik:AjaxSetting AjaxControlID="RadGrid1"
                    <UpdatedControls > 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting>           
            </AjaxSettings>          
            </telerik:RadAjaxManager> 
    <div> 
     
             
            <telerik:RadProgressManager ID="RadProgressManager1" Runat="server" /> 
    <telerik:RadProgressArea ID="RadProgressArea1" Runat="server"
    </telerik:RadProgressArea> 
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="odsVideo"  
            GridLines="None" AutoGenerateColumns="False"  
            oninsertcommand="RadGrid1_InsertCommand"
<MasterTableView  
    CommandItemDisplay="Top"  
    DataKeyNames="VideoID"  
    EditMode="EditForms" 
    DataSourceID="odsVideo"
    <EditItemTemplate> 
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
    </EditItemTemplate> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridEditCommandColumn> 
        </telerik:GridEditCommandColumn> 
        <telerik:GridBoundColumn DataField="VideoID" DataType="System.Int32"  
            HeaderText="VideoID" ReadOnly="True" SortExpression="VideoID"  
            UniqueName="VideoID"
        </telerik:GridBoundColumn> 
        <telerik:GridTemplateColumn DataField="Title" HeaderText="Title"  
            SortExpression="Title" UniqueName="Title"
            <EditItemTemplate> 
                <asp:TextBox ID="txtTitle" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox> 
            </EditItemTemplate> 
            <ItemTemplate> 
                <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>'></asp:Label> 
            </ItemTemplate> 
        </telerik:GridTemplateColumn> 
        <telerik:GridTemplateColumn DataField="FileName" DataType="System.Guid"  
            HeaderText="FileName" SortExpression="FileName" UniqueName="FileName"
            <EditItemTemplate> 
                <telerik:RadUpload ID="RadUpload1" Runat="server"
                </telerik:RadUpload>  
            </EditItemTemplate> 
            <ItemTemplate> 
                <asp:Label ID="FileNameLabel" runat="server" Text='<%# Eval("FileName") %>'></asp:Label> 
            </ItemTemplate> 
        </telerik:GridTemplateColumn> 
        <telerik:GridBoundColumn DataField="Minutes" DataType="System.Int32"  
            HeaderText="Minutes" SortExpression="Minutes" UniqueName="Minutes"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Seconds" DataType="System.Int32"  
            HeaderText="Seconds" SortExpression="Seconds" UniqueName="Seconds"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="DateAdded" DataType="System.DateTime"  
            HeaderText="DateAdded" SortExpression="DateAdded" UniqueName="DateAdded"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="SeriesID" DataType="System.Int32"  
            HeaderText="SeriesID" SortExpression="SeriesID" UniqueName="SeriesID"  
            Visible="False"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Ranking" DataType="System.Int32"  
            HeaderText="Ranking" SortExpression="Ranking" UniqueName="Ranking"  
            Visible="False"
        </telerik:GridBoundColumn> 
        <telerik:GridCheckBoxColumn DataField="IsActive" DataType="System.Boolean"  
            HeaderText="IsActive" SortExpression="IsActive" UniqueName="IsActive"
        </telerik:GridCheckBoxColumn> 
    </Columns> 
 
<EditFormSettings> 
<EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
</EditFormSettings> 
</MasterTableView> 
</telerik:RadGrid>         
 
    </div> 
    <asp:ObjectDataSource ID="odsVideo" runat="server"  
        DataObjectTypeName="MySample.BusinessObjects.Video"  
        DeleteMethod="Delete" InsertMethod="Insert"  
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetItems"  
        TypeName="MySample.BusinessLogic.VideoManager"  
        UpdateMethod="Update"
        <DeleteParameters> 
            <asp:Parameter Name="videoID" Type="Int32" /> 
        </DeleteParameters> 
    </asp:ObjectDataSource> 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"
    </telerik:RadScriptManager> 
             
    <br /> 
    <br />         
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="16px" 
    Transparency="50" Width="16px"
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
        style="border: 0px;" /> 
</telerik:RadAjaxLoadingPanel> 
    </form> 
</body> 
</html> 


Pavlina
Telerik team
 answered on 04 Aug 2011
3 answers
172 views
Hi  'Rumen'

I am creating a CMS of my company where I want to use radeditor
i split page into 2 frames top frame contain the toolbar of editor and second frame contain editor that look like div
this scenario work on all browser except SAFARI
You give me this code past 2 month but i check this code in SAFARI now and it does not work
I have SAFARI 5.0.5 (7533.21.1)
below link is the project link

https://skydrive.live.com/?cid=96dc14ef9668ae5a&sc=documents&id=96DC14EF9668AE5A%21108#

Kindly Check the complete code and solve the problem

Thanks
Looking forward Your reply

Regards: Abdul Haseeb

I am set to lunch the project it is delying because Editor not work in SAFARI
please reply soon
Rumen
Telerik team
 answered on 04 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?