Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
101 views
Hi,
I want to clear the autocompletebox entries from client side using a radbutton. can anyone help?

Thanks,
Ben.
Princy
Top achievements
Rank 2
 answered on 25 Feb 2013
1 answer
67 views
Hi Telerik,
I have RADgird with columns startDate, endDate,  statusLevel with editmode="popup".
If i select EDIT, i need to do the following validation
1. If startDate = null, then endDate & statusLevel must be non-editable
2. if endDate = not null, then startDate cannot be null & statusLevel = 100

please i need the help urgently

Thanks in advance
Alex


Shinu
Top achievements
Rank 2
 answered on 25 Feb 2013
1 answer
82 views
Hi, how can I show today's date in a different background color in RadDateTimePicker?

Thanks,
Rimma
Princy
Top achievements
Rank 2
 answered on 25 Feb 2013
2 answers
49 views
I want export ".doc" in event OnItemCommand of GridView but when i debug then it do not export.
Can you help me.
Code bihe:
if (e.CommandName == "ExportWord")
{
           string attachment = "attachment; filename=abc";
           HttpContext.Current.Response.Clear();
           HttpContext.Current.Response.AddHeader("content-disposition", attachment);
          // HttpContext.Current.Response.ContentType = "application/vnd.ms-excel"; //office 2003
           HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Unicode;
          HttpContext.Current.Response.ContentType = "application/ms-word";
         HttpContext.Current.Response.BinaryWrite(System.Text.Encoding.Unicode.GetPreamble());
           HttpContext.Current.Response.Write("abc");
            HttpContext.Current.Response.End();
}
Vo
Top achievements
Rank 1
 answered on 25 Feb 2013
4 answers
170 views
Hi, I need some help please.  My menus don't have icon, so I don't want the right-area of where icon is displayed to show up.  see my attachment, the blue area is what I am talking about, I don't want to show up.  Please tell me how to do that.  thank you.

Ripon
Top achievements
Rank 1
 answered on 23 Feb 2013
1 answer
56 views
Hello,

I have a RadWindow. The window contains a table with two rows: the first row (sigle column) contains a RadTabStrip and the second (two colums) contains a checkbox and a button. Each TabStrip contains a RadTreeView:

<table style="width:100%;">
    <tr style="height:100%;vertical-align:top;overflow:auto">
        <td colspan="2">
            <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" Width="100%" Height="100%">
                <Tabs>
                    <telerik:RadTab runat="server" Text="Tab1" Selected="True">
                    </telerik:RadTab>
                    <telerik:RadTab runat="server" Text="Tab2">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" Width="100%" SelectedIndex="0" Height="100%">
                <telerik:RadPageView ID="RadPageView1" runat="server" Height="100%" style="border: 1px solid grey">
                    <telerik:RadTreeView ID="RadTreeView1" runat="server"></telerik:RadTreeView>
                </telerik:RadPageView>
                <telerik:RadPageView ID="RadPageView2" runat="server" Height="100%" style="border: 1px solid grey">
                    <telerik:RadTreeView ID="RadTreeView2" runat="server"></telerik:RadTreeView>
                </telerik:RadPageView>
            </telerik:RadMultiPage>
        </td>
    </tr>
    <tr>
        <td style="font: normal 12px arial; text-align: left;">
            <asp:CheckBox ID="CheckBox1" runat="server" Text="Do something when checked." AutoPostBack="true" />
        </td>
        <td style="text-align: right">
            <telerik:RadButton ID="CancelButton" runat="server" Text="Cancel" OnClientClicked="windowClose" UseSubmitBehavior="false">
            </telerik:RadButton>
        </td>
    </tr>
</table>

I want the content of the first row to autoresize if the RadWindow is resized and the second row to remain the same.

I've tried setting the row height to 100% but with no result.
Emil
Top achievements
Rank 2
 answered on 23 Feb 2013
4 answers
286 views
Hello,

I have the AllowCustomEntry set to true and I have the following scenario:
If the new Entry is an Email (has an email format) then add it normally, if the new Entry is not an email then
Check if the New Entry Exists in the DataSource/ENtryCollection, if it Exists then Do Nothing, if it doesn't exist
then I need to set the Background Color of the new Entry to Red.

This is what I have so far:


<script type="text/javascript">
    function OnClientEntryAdded(sender, eventArgs) {

        var newEntry = eventArgs.get_entry().get_text();
        if (validateEmail(newEntry)) {
             // If New Custom Entry is an Emeail Do Nothing
        }
        else {
// ELSE
// If New Custom Entry is Not an Email and It Does Not Exist in the 
// DataSource/Items then I want the New Added Entry to have a RED
// Background Color so that it indicates that the Entry is incorrect.
            
// IF newEntry does NOT exist in the EntryCollection THEN
// Change the Background COlor of the New ENtry to Red
        }
    }
 
 
    function validateEmail(email) {
 
        var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
             
        return re.test(email);
    }
</script>


I also need to know how to use the remove() entry function within that event.




Eric
Top achievements
Rank 1
 answered on 22 Feb 2013
1 answer
321 views
I have the following custom sort handler in a radgrid.

For most columns, this is fine.  But on occasion my datafield name is different than my object field name.

ie.  a column with the following works
col.DataField = "Id";
col.UniqueName = "Id";
col.SortExpression = "Id";

but this column fails with error:

No property or field 'OnDate' exists in type 'EvidenceEntryGridItem


col.DataField = "DateEntered";
col.UniqueName = "DateEntered";
col.SortExpression = "OnDate";

This happens after the NeedDataSourceHandler finishes, so I am successfully getting results, and getting them into the grid.  It's something internal to the grid that is failing.

protected void OnSortCommand(object sender, GridSortCommandEventArgs e)
{
    SortDirection direction = (e.NewSortOrder == GridSortOrder.Descending)
                                  ? SortDirection.Descending
                                  : SortDirection.Ascending;
    Sort = new SortBy(e.SortExpression, direction);
     
    GridSortExpression newSortExpression = new GridSortExpression();
    newSortExpression.FieldName = e.SortExpression;
    newSortExpression.SortOrder = e.NewSortOrder;
 
    MasterTableView.SortExpressions.Clear();
    MasterTableView.SortExpressions.Add(newSortExpression);
 
    e.Canceled = true;
 
    this.PageInfo = new GridPageInfo(1, this.PageSize);
    this.Rebind();
}

NeedDataSource is pretty straight forward (it is in VB)

Protected Sub ResultsGrid_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles ResultsGrid.NeedDataSource
            Dim results As EvidenceEntryGridItemResultsEnvelope = AppDomain.Instance.DI.Get(Of IEvidenceEntryGridItemRepository)().GetForUserByUniqueId(_searchValue, UserId, ResultsGrid.PageInfo, ResultsGrid.Sort, ResultsGrid.Filter)
 
            ResultsGrid.VirtualItemCount = results.TotalCount
            ResultsGrid.DataSource = results.Records
 
        End Sub


Am I missing something in my sort handler?
Matthew
Top achievements
Rank 1
 answered on 22 Feb 2013
1 answer
104 views
Hi there,

My RadGrid filter function is not working with Simple data binding OnNeedDataSource, Any help is greatly appreciated. Here is my code (database is Northwind):

aspx file:
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" CellSpacing="0"
            GridLines="None" Width="800px" AllowFilteringByColumn="true" EnableLinqExpressions="false" AutoGenerateColumns="false"
             OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender" ShowFooter="True">
            <MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True"
            ShowFooter="True" TableLayout="Auto">
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="Ship Name" SortExpression="ShipName" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbl_name" runat="server" Text='<%#Eval("ShipName")%>' Visible="true"/>
                        </ItemTemplate>
                   </telerik:GridTemplateColumn>
                   <telerik:GridTemplateColumn HeaderText="Ship Country" SortExpression="ShipCountry" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbl_country" runat="server" Text='<%#Eval("ShipCountry")%>' Visible="true"/>
                        </ItemTemplate>
                   </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </form>
</body>

cs file
  
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        LoadData();
    }
  
    private void LoadData()
    {
        RadGrid1.DataSource = GetDataTable("SELECT OrderID, OrderDate, Freight, ShipName, ShipCountry FROM Orders");
    }
  
    public DataTable GetDataTable(string query)
    {
        String ConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(ConnString);
        SqlDataAdapter adapter = new SqlDataAdapter();
        adapter.SelectCommand = new SqlCommand(query, conn);
  
        DataTable myDataTable = new DataTable();
  
        conn.Open();
        try
        {
            adapter.Fill(myDataTable);
        }
        finally
        {
            conn.Close();
        }
  
        return myDataTable;
    }
  
  
  
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        //RadGrid1.Columns[0].CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
        //RadGrid1.Columns[1].CurrentFilterFunction = Telerik.Web.UI.GridKnownFunction.Contains;
    }
Meng
Top achievements
Rank 1
 answered on 22 Feb 2013
1 answer
66 views
Hi,

I have a table implemented using radgrid and I have some linkbuttons (add, edit delete) on the top, all these buttons are functional,
however, I wonder if it is possible to make edit and delete not clickable or disabled or invisible if none of the row is selected?



Cheng
Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?