Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
179 views
Is there a way to set the directory that appears by default when you click "Select" on a RadAsyncUpload, or make it be the same as the last time a file was selected for upload?
Genady Sergeev
Telerik team
 answered on 26 May 2010
5 answers
114 views
I noticed an interesting phenomenon. When the page is rendered, and if I copy the chart image PNG URL to another browser on another machine, it works for a few minutes. My pages are being served over HTTPS so there is little risk someone can directly copy the URL.

I wanted to know if there is any chance this URL is guessable by third-parties, and what privacy risks there may be. I could be serving up potentially personal information in a chart and wanted to ensure there is no risk to user's data.
Ves
Telerik team
 answered on 26 May 2010
3 answers
124 views
HI all,

When I use the AllowedFileExtensions property of the RadUpload, it works fine in FF, Chrome, IE8 and Safari. However, it never validates in IE6. Please Help.

Usage:
 <telerik:RadUpload ID="fileUploadCv" runat="server" ControlObjectsVisibility="None"                             AllowedFileExtensions=".doc,.docx,.pdf,.rtf" BorderStyle="None">
</telerik:RadUpload>
<asp:CustomValidator ID="Customvalidator1" runat="server" Display="None" ClientValidationFunction="validateRadUpload1"
                                ValidationGroup="VgRegister" ErrorMessage="Invalid file type for cv"></asp:CustomValidator>


I am always getting the ErrorMessage defined in the CustomValidator.





Genady Sergeev
Telerik team
 answered on 26 May 2010
1 answer
81 views
I have a problem with the Image Manager showing the wrong image with recent versions of the library. It shows the same image for all items in the current page of the file list.

I have checked the URL of the image that the manager requests, and it's the same URL for all the images. I have single stepped through the ResolveDirectory method in the provider code, and it sends an array of FileItems that all have different URLs.

Has there been any changes in how the Image Manager uses the content provider?

There hasn't been any changes neither in the code that opens the Image Manager, nor in the content provider. The only related change is the version of the Telerik library. I made minor changes in an unrelated page (an http handler that doesn't use any Telerik components at all) and when I published the site the Image Manager stopped working correctly.

I have managed to patch the site for now with an older version of the library, hopefully that doesn't make something else act up...

Dobromir
Telerik team
 answered on 26 May 2010
1 answer
182 views
Hi,

I'e followed this demo to get a treeview-like radgrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/selfreferencing/defaultcs.aspx

But the problems start at editing already inserted items.
Only the root(top-parent) item can be edited. If I click on the edit pencil icon on an item that has a parrent, that item dissapears from the gird, but if I later click on a root item both items get opened for editing.
Editing mode is on PopUp with user control.

And here is the page:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="pm_tasks.aspx.cs" Inherits="members_pm_tasks" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>  
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
    <script type="text/javascript"> 
        var combo; 
        function nodeClicking(sender, args) { 
            var combocomboBox = combo; 
 
            var node = args.get_node() 
 
            comboBox.set_text(node.get_text()); 
            comboBox.value = node.get_value(); 
 
            comboBox.trackChanges(); 
            comboBox.commitChanges(); 
 
            comboBox.hideDropDown(); 
        } 
 
        function StopPropagation(e) { 
            if (!e) { 
                e = window.event; 
            } 
 
            e.cancelBubble = true; 
        } 
 
        function OnClientDropDownOpenedHandler(sender, args) { 
            combo = sender; 
            var tree = sender.get_items().getItem(0).findControl("rtv_parent"); 
            var selectedNode = tree.get_selectedNode(); 
            if (selectedNode) { 
                selectedNode.scrollIntoView(); 
            } 
        }    
    </script> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadGrid1"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="chk_end"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="chk_end" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="ddl_project"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="ddl_project" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
     
    <table> 
        <tr> 
            <td> 
                IZBERI PROJEKT:&nbsp; 
            </td> 
            <td> 
                <asp:DropDownList ID="ddl_project" runat="server" DataTextField="title" DataValueField="id" DataSourceID="SqlProject" 
                    OnSelectedIndexChanged="project_SelectedIndexChanged" OnDataBound="project_DataBound" AutoPostBack="true" Filter="Contains" AllowCustomText="true"> 
                </asp:DropDownList> 
                <asp:SqlDataSource ID="SqlProject" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:myConnectionString %>" 
                    SelectCommand="SELECT [id], [title] FROM pm_projects"> 
                </asp:SqlDataSource> 
            </td> 
            <td> 
                &nbsp;<asp:CheckBox ID="chk_end" runat="server" OnCheckedChanged="chk_endChanged" Checked="true" AutoPostBack="true" /> 
            </td> 
            <td> 
                PRIKAŽI SAMO NEDOKONÄŒANE NALOGE 
            </td> 
        </tr> 
    </table> 
    <br /><br /> 
     
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlTask" OnColumnCreated="RadGrid1_ColumnCreated" 
        OnItemCreated="RadGrid1_ItemCreated" OnInsertCommand="taskInsertCommand"  
        OnItemDataBound="RadGrid1_ItemDataBound" GridLines="None" Skin="Default>" 
        <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" AllowSorting="true" 
            DataKeyNames="id" Width="100%" AutoGenerateColumns="False"  
            DataSourceID="SqlTask" GridLines="None" AllowPaging="True" EditMode="PopUp"> 
            <SelfHierarchySettings ParentKeyName="id_parent" KeyName="id" /> 
            <Columns> 
                <telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="ID"  
                    ReadOnly="True" SortExpression="id" UniqueName="id" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="title" DataType="System.String"  
                    HeaderText="NASLOV" SortExpression="title"  
                    UniqueName="title" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="start_date" DataType="System.DateTime" 
                    HeaderText="DATUM ZAÄŒETKA" SortExpression="start_date" UniqueName="start_date" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="task_creator" DataType="System.Guid"  
                    HeaderText="USTVARJALEC" SortExpression="task_creator"  
                    UniqueName="task_creator" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="task_assigned" DataType="System.Guid"  
                    HeaderText="IZVAJALEC" SortExpression="task_assigned"  
                    UniqueName="task_assigned" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="deadline" DataType="System.DateTime" 
                    HeaderText="ROK" SortExpression="deadline" UniqueName="deadline" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="percent_complete" DataType="System.Int32"  
                    HeaderText="KONÄŒANO V %" SortExpression="percent_complete"  
                    UniqueName="percent_complete" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="end_date" DataType="System.DateTime" 
                    HeaderText="DATUM KONCA" SortExpression="end_date" UniqueName="end_date" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="predecessors" HeaderText="PREDHODNIKI"  
                    SortExpression="predecessors" UniqueName="predecessors" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="id_parent" DataType="System.Int32"  
                    HeaderText="id_parent" SortExpression="id_parent" UniqueName="id_parent" Visible="true" HeaderStyle-Width="150px"> 
                </telerik:GridBoundColumn> 
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Preview" Text="Predogled" ImageUrl="~/members/images/magnifier.png" UniqueName="Preview"> 
                   <HeaderStyle Width="25px" />                  
               </telerik:GridButtonColumn>             
                <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelText="Preklici"  
                    InsertText="Dodaj" UpdateText="Shrani"> 
                    <HeaderStyle Width="32px" /> 
                </telerik:GridEditCommandColumn> 
               <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"  
                   ConfirmDialogType="RadWindow" ConfirmText="Ali si preprican da Å¾eliÅ¡ izbrisati vnos ?" 
                   Text="BriÅ¡i" UniqueName="column"> 
                   <HeaderStyle Width="32px" /> 
               </telerik:GridButtonColumn>                 
               <telerik:GridTemplateColumn AllowFiltering="false"> 
                   <ItemTemplate> 
                       <img src="images/calendar.gif" style="cursor:pointer;" alt="" onclick="return Wopen('<%# Eval("id") %>');" /> 
                   </ItemTemplate> 
                   <HeaderStyle Width="32px" /> 
               </telerik:GridTemplateColumn>   
            </Columns> 
            <EditFormSettings CaptionFormatString="UREJANJE NALOG" UserControlName="user_controls/insertTask.ascx"  
                EditFormType="WebUserControl" PopUpSettings-Width="600"> 
                <EditColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1"> 
                </EditColumn> 
                <PopUpSettings ScrollBars="None"></PopUpSettings> 
            </EditFormSettings> 
        </MasterTableView> 
        <ClientSettings AllowExpandCollapse="true" /> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="SqlTask" runat="server"  
        ConnectionString="<%$ ConnectionStrings:myConnectionString %>" 
        OnSelecting="SqlTask_Selecting" 
        SelectCommand="SELECT [id], [title], [start_date], [end_date], (select ime + ' ' + priimek from Calendar where guid_calendar = t.task_creator) as [task_creator], 
            (select ime + ' ' + priimek from Calendar where guid_calendar = t.task_assigned) as [task_assigned], [deadline], 
            [percent_complete], [predecessors], [id_parent] 
            FROM [pm_tasks] t 
            WHERE t.id_project = @id_project AND t.percent_complete &lt; @percent_max"> 
            <SelectParameters> 
                <asp:Parameter Name="id_project" DefaultValue="1" /> 
                <asp:Parameter Name="percent_max" DefaultValue="100" /> 
            </SelectParameters> 
    </asp:SqlDataSource> 
</asp:Content> 
 
 


And the code behind:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Telerik.Web.UI; 
using System.Reflection; 
using System.Data; 
using System.Data.SqlClient; 
using System.Configuration; 
using System.Web.Services; 
using System.Web.Security; 
using System.Collections; 
using System.Diagnostics; 
using System.Text; 
using System.IO; 
using System.Web.Profile; 
using System.Xml.Linq; 
 
public partial class members_pm_tasks : System.Web.UI.Page 
{ 
    private int ddl_index; 
    private DataClassesDataContext db = new DataClassesDataContext(); 
 
    protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if (e.Column is GridExpandColumn) 
        { 
            e.Column.Visible = false; 
        } 
        else if (e.Column is GridBoundColumn) 
        { 
            e.Column.HeaderStyle.Width = Unit.Pixel(150); 
        } 
    } 
 
    public void Page_Load(object sender, EventArgs e) 
    { 
        if (Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("3.5") != -1 || Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("4.0") != 1) 
        { 
            RadGrid1.MasterTableView.FilterExpression = @"it[""id_parent""] = Convert.DBNull"; 
        } 
        else 
        { 
            RadGrid1.MasterTableView.FilterExpression = "id_parent IS NULL"; 
        } 
 
        if (!IsPostBack) 
        { 
            try 
            { 
                ddl_index = System.Convert.ToInt32(Request.QueryString["ddl_index"]); 
                if (ddl_index != 0) 
                { 
                    ddl_project.SelectedValue = ddl_index.ToString(); 
                } 
            } 
            catch { ddl_index = 0; } 
        } 
    } 
 
    public void Page_PreRenderComplete(object sender, EventArgs e) 
    { 
        HideExpandColumnRecursive(RadGrid1.MasterTableView); 
    } 
 
    public void HideExpandColumnRecursive(GridTableView tableView) 
    { 
        GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView); 
        foreach (GridNestedViewItem nestedViewItem in nestedViewItems) 
        { 
            foreach (GridTableView nestedView in nestedViewItem.NestedTableViews) 
            { 
                nestedView.Style["border"] = "0"; 
 
                Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton"); 
                if (nestedView.Items.Count == 0) 
                { 
                    if (MyExpandCollapseButton != null) 
                    { 
                        MyExpandCollapseButton.Style["visibility"] = "hidden"; 
                    } 
                    nestedViewItem.Visible = false; 
                } 
                else 
                { 
                    if (MyExpandCollapseButton != null) 
                    { 
                        MyExpandCollapseButton.Style.Remove("visibility"); 
                    } 
                } 
 
                if (nestedView.HasDetailTables) 
                { 
                    HideExpandColumnRecursive(nestedView); 
                } 
            } 
        } 
    } 
 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        CreateExpandCollapseButton(e.Item, "id"); 
 
        if (e.Item is GridHeaderItem && e.Item.OwnerTableView != RadGrid1.MasterTableView) 
        { 
            e.Item.Style["display"] = "none"; 
        } 
 
        if (e.Item is GridNestedViewItem) 
        { 
            e.Item.Cells[0].Visible = false; 
        } 
    } 
 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        CreateExpandCollapseButton(e.Item, "id"); 
        RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; 
        RadGrid1.MasterTableView.CommandItemSettings.AddNewRecordText = "NOVO OPRAVILO"; 
        RadGrid1.MasterTableView.CommandItemSettings.RefreshText = "OSVEŽI"; 
    } 
 
    public void CreateExpandCollapseButton(GridItem item, string columnUniqueName) 
    { 
        if (item is GridDataItem) 
        { 
            if (item.FindControl("MyExpandCollapseButton") == null) 
            { 
                Button button = new Button(); 
                button.Click += new EventHandler(button_Click); 
                button.CommandName = "ExpandCollapse"; 
                button.CssClass = (item.Expanded) ? "rgCollapse" : "rgExpand"; 
                button.ID = "MyExpandCollapseButton"; 
 
                if (item.OwnerTableView.HierarchyLoadMode == GridChildLoadMode.Client) 
                { 
                    string script = String.Format(@"$find(""{0}"")._toggleExpand(this, event); return false;", item.Parent.Parent.ClientID); 
 
                    button.OnClientClick = script; 
                } 
 
                int level = item.ItemIndexHierarchical.Split(':').Length; 
                if (level > 1) 
                { 
                    button.Style["margin-left"] = level * 10 + "px"; 
                } 
 
                TableCell cell = ((GridDataItem)item)[columnUniqueName]; 
                cell.Controls.Add(button); 
                cell.Controls.Add(new LiteralControl("&nbsp;")); 
                cell.Controls.Add(new LiteralControl(((GridDataItem)item).GetDataKeyValue(columnUniqueName).ToString())); 
            } 
        } 
    } 
 
    void button_Click(object sender, EventArgs e) 
    { 
        ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand"; 
    } 
 
    protected void SqlTask_Selecting(object sender, SqlDataSourceSelectingEventArgs e) 
    { 
        if (ddl_project.SelectedValue != "") 
            e.Command.Parameters["@id_project"].Value = ddl_project.SelectedValue; 
        if (chk_end.Checked) 
            e.Command.Parameters["@percent_max"].Value = "100"; 
        else 
            e.Command.Parameters["@percent_max"].Value = "101"; 
    } 
 
    protected void project_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        RadGrid1.Rebind(); 
    } 
 
    protected void project_DataBound(object sender, EventArgs e) 
    { 
        RadGrid1.Rebind(); 
    } 
 
    protected void chk_endChanged(object sender, EventArgs e) 
    { 
        RadGrid1.Rebind(); 
    } 
 
    protected void taskInsertCommand(object source, GridCommandEventArgs e) 
    { 
        UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID); 
 
        pm_task task = new pm_task(); 
        updateTask(ref task, userControl); 
        db.pm_tasks.InsertOnSubmit(task); 
        db.SubmitChanges(); 
    } 
 
    private void updateTask(ref pm_task task, UserControl userControl) 
    { 
        task.id_project = System.Convert.ToInt32((userControl.FindControl("ddl_project") as DropDownList).SelectedValue); 
 
        if (!(userControl.FindControl("chk_noParent") as CheckBox).Checked) 
        { 
            RadComboBox rcb_parent = userControl.FindControl("rcb_parent") as RadComboBox; 
            RadTreeView rtv_parent; 
            foreach (RadComboBoxItem item in rcb_parent.Items) 
            { 
                rtv_parent = item.FindControl("rtv_parent") as RadTreeView; 
                task.id_parent = System.Convert.ToInt32(rtv_parent.SelectedValue); 
            } 
        } 
        else 
            task.id_parent = null; 
 
        task.task_creator = new Guid("8A936ACE-9A27-4008-84B8-367378518F49");//(Guid)Membership.GetUser().ProviderUserKey; 
        task.task_assigned = new Guid((userControl.FindControl("ddl_assigned") as DropDownList).SelectedValue); 
        task.title = (userControl.FindControl("txt_title") as TextBox).Text; 
        task.start_date = (DateTime)(userControl.FindControl("dtp_start") as RadDateTimePicker).SelectedDate; 
        task.deadline = (DateTime)(userControl.FindControl("dtp_deadline") as RadDateTimePicker).SelectedDate; 
        task.description = (userControl.FindControl("txt_description") as TextBox).Text; 
        task.predecessors = getPredecessors(userControl.FindControl("rcb_predecessors") as RadComboBox); 
    } 
 
    private string getPredecessors(RadComboBox rcb) 
    { 
        string predecessors = ""; 
        CheckBox cb; 
        foreach (RadComboBoxItem item in rcb.Items) 
        { 
            cb = item.FindControl("check") as CheckBox; 
            if (cb.Checked) 
                predecessors += item.Value + ";"; 
        } 
        return predecessors; 
    } 
} 
 
 
 


Any help with this?

Best regards,
Thomas





BaiH
Top achievements
Rank 1
 answered on 26 May 2010
5 answers
192 views
Hi,

I believe I've followed the getting started correctly, but once I've selected a file to upload and click on the Submit button, I get

Internet Explorer cannot display the webpage

shown and the upload has not happened.

I expect I've missed a stage or something, but cannot work out what it is.

Any suggestions welcomed.

David Penny
Genady Sergeev
Telerik team
 answered on 26 May 2010
2 answers
169 views
I am encountering a null reference exception when I set ExportOnlyData="true" and try to export to any format.  If I set ExportOnlyData="false", everything works fine.

Here are the exception details:
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadAjaxControl.OnPagePreRenderComplete(Object sender, EventArgs e) +116
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +11039453
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3671

Here is my markup:
<telerik:RadGrid ID="grdResults" Visible="true" runat="server" Skin="WebBlue" AutoGenerateColumns="false" 
    PageSize="20" AllowPaging="true" AllowSorting="true" OnItemCommand="grdResults_ItemCommand" 
    OnNeedDataSource="grdResults_NeedDataSource"> 
    <ExportSettings FileName="EmployeeSearchResults" ExportOnlyData="true"> 
    </ExportSettings> 
    <PagerStyle Mode="NumericPages" HorizontalAlign="Center" VerticalAlign="Top" AlwaysVisible="true" 
        Position="Bottom"></PagerStyle> 
    <MasterTableView DataKeyNames="UserId" CommandItemDisplay="Top"> 
    <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false"  ShowExportToCsvButton="true" ShowExportToExcelButton="true" ShowExportToPdfButton="true" ShowExportToWordButton="true" /> 
        <Columns> 
            <telerik:GridTemplateColumn> 
                <ItemTemplate> 
                    <telerik:RadAjaxPanel runat="server"> 
                        <asp:CheckBox ID="chk" runat="server" Checked='<%# Eval("Selected") %>' AutoPostBack="true" OnCheckedChanged="chk_CheckedChanged" /> 
                        <asp:HiddenField ID="hdn" runat="server" Value=<%# Eval("UserId") %> /> 
                    </telerik:RadAjaxPanel> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridBoundColumn SortExpression="EmployeeId" DataField="EmployeeId" HeaderText="Employee ID"> 
            </telerik:GridBoundColumn> 
            <telerik:GridButtonColumn ButtonType="LinkButton" DataTextField="UserName" HeaderText="Name" 
                SortExpression="UserName" CommandName="UserProfile"> 
            </telerik:GridButtonColumn> 
            <telerik:GridBoundColumn SortExpression="Title" DataField="Title" HeaderText="Title"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn SortExpression="CompanyName" DataField="CompanyName" HeaderText="Org / Org Unit"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn SortExpression="ManagerName" DataField="ManagerName" HeaderText="Manager"> 
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn SortExpression="EmailAddress" DataField="EmailAddress" HeaderText="Email Address"> 
            </telerik:GridBoundColumn> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 


I am using advanced databinding for my datasource, but I have noticed that the NeedsDataSource event never fires when I try to export only data:

        protected void grdResults_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        { 
            EmployeeSearchCriteriaDTO criteria = SessionManager.SM.EmployeeSearchCriteria; 
 
            if (criteria != null) 
            { 
                IList<EmployeeSearchResultDTO> temp = EmployeeSearchManager.Query2(criteria); 
 
                if (SessionManager.SM.ComparisonUserIDs != null) 
                { 
                    foreach (int id in SessionManager.SM.ComparisonUserIDs) 
                    { 
                        EmployeeSearchResultDTO user = temp.FirstOrDefault(r => r.UserId == id); 
                        if (user != null) 
                            user.Selected = true; 
                    } 
                } 
                grdResults.DataSource = temp; 
            } 
        } 

Any ideas?












Brent
Top achievements
Rank 1
 answered on 26 May 2010
3 answers
204 views
Hi,

I am evaluating the ASP.NET Ajax controls and can't seem to find a button control (checkbox either), am I missing something?
Where the question comes from is the fact that I am looking into the Skins manager which is very easy to use with RadXXX controls (no code required) but not so easy with .net controls (not even sure it's possible)
Any advice/input welcome
Sebastian
Telerik team
 answered on 26 May 2010
1 answer
157 views
Hello, I have read through a number of discussions and I can't figure out how to remove this puffy border around my image. I want it to be transparent and match the background. They code I am using is:

 
                                   <telerik:RadMenu ID="NavigationMenu"  runat="server" Visible="True" BorderStyle="None" BorderWidth="0px" BackColor="Transparent" BorderColor="Transparent"  > 
                                        <Items> 
                                            <telerik:RadMenuItem runat="server" ImageUrl="../Images/library_icon.png"  ForeColor="Blue" Font-Bold="true"   BorderStyle="None" BackColor="Transparent" BorderColor="Transparent"   > 
                                             <Items> 
                                                <telerik:RadMenuItem Text="Offers Library" NavigateUrl="../"></telerik:RadMenuItem> 
                                                <telerik:RadMenuItem Text="Earning Summary" NavigateUrl="../"></telerik:RadMenuItem> 
                                               
                                             </Items> 
                                              
                                            </telerik:RadMenuItem> 
                                        </Items> 
                                     </telerik:RadMenu> 
Yana
Telerik team
 answered on 26 May 2010
5 answers
241 views
Hi,
   I am using RadTabStrip and in that I have multiple tabs. I am also using RadAjaxManager.
   In one of the tabs I have a grid which is enclosed in RadAjaxPanel.   On clicking the Add link of the grid a user control pops-up and will insert a record successfully.

   The problem I am facing currently is with the validations
    Currently I am enclosing the ValidationSummary in a DIV and the DIV is hidden by default,
    OnClientClick event is fired when User clicks on Add button to check if there are any validations errors and if yes gets the innerHTML of the div and displays it using radalert.
    But my Page_ClientValidate("vgVendor") always returns true and I also observed that on clicking the Add button first time the Div.innerHTML does not have the error message but 2nd time it has the error message in it. Page_ClientValidate("vgVendor") always returns true.

Can you please help me on this.

Thanks in advance
Pradeep.
Iana Tsolova
Telerik team
 answered on 26 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?