Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
168 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
184 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
156 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
200 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
153 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
227 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
3 answers
373 views
Hi,

I am working on Radstrip controls. When i complie the code I am getting error like " Could not load file or assembly 'RadTabStrip.Net2' or one of its dependencies." Can anyone help me how to fix this error.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Radstrip2.aspx.cs" Inherits="Radstrip2" %> 
 
<%@ Register Assembly="RadTabStrip.Net2" Namespace="Telerik.WebControls" TagPrefix="radTS" %> 
 
<!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 runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager> 
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Height="154px"  
        SelectedIndex="0" Width="1280px"
    </telerik:RadTabStrip> 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"  
        Height="321px" Width="700px" BorderStyle="Solid" OnPageViewItemCreated="RadMultiPage1_PageViewItemCreated1"
            <telerik:RadPageView ID="RadPageView1" runat="server" Height="279px" Width="690px"
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click1" Text="Add Tab" /> 
            </telerik:RadPageView> 
    </telerik:RadMultiPage> 
    </form> 
</body> 
</html> 

Yana
Telerik team
 answered on 26 May 2010
4 answers
1.1K+ views

Hello all,
               I have a common scenario, but i could not implement in a cleaner way.
 
I have web page which contains a treeview and 2 grid.On clicking each node in tree view shows two grids on right hand side of the treeview populated with values related to the clicked node in treeview. Now on right clicking the node in tree view and selecting a context menu item will open a new rad window for me.

In the rad window the user will make update/insert/delete operations against database. The user can close this rad window in two ways - one is clicking the 'close' button in rad window
-second is clicking the 'X' button on top right corner of rad window.

what i need to do is 'onclientclose' of radwindow, i need to read the arguments that are passed from radwindow and depending on those passed arguments, i have to refresh the treeview as well as the two grids on the parent page. I'm able to achieve this when user clicks 'close' button on radwindow, but when user clicks the 'X' i cannot get the arguments passed back from rad window to parent page. Could anybody please help me in this case?

when user clicks close button on rad window, this is how i'm closing rad window and passing back arguments

 

 

var oArg = new Object();

 

oArg.ReloadGrids = true;

 

oArg.ReloadTreeView= false;
RadWindow.close(oArg);

and on client close this is how i read arguments passed from rad window

 

function

 

 RadWindow_OnClientClose(oRadWind, args) {

 

 

//get the transfered arguments

 

 

var arg = args.get_argument();

 

}


Please let me know if you guys need some more info..

 

cheers!

pravin.

Fiko
Telerik team
 answered on 26 May 2010
3 answers
374 views

Hi,

                We arein process of evaluating new Telerik Grid for our application. While we couldsee great performance improvement using the client side data binding (JSONapproach). Still we are not able to get the inline edit & Add functionalitylike that we have in the Server side bound version. Just curious to know isthere something that we could get the inline edit & add in the client version.

http://www.sigmawidgets.com/products/sigma_grid2/demos/example_column_editor.html

                I gotthis link and the control displayed in the page is very impressive, though I amnot looking for the cell level edit. I am looking for a row inline edit that isfast as this control version.

                Anyoneplease guide me on, is there any out of the box feature /  work around that will get me similarfunctionality.

Thanks

Iana Tsolova
Telerik team
 answered on 26 May 2010
2 answers
577 views
Hi,

I have the following Column:
protected static void CreateAndAddRadGridAuditViewCommandColumn(RadGrid grid)  
{  
    GridButtonColumn auditColumn = new GridButtonColumn()  
    {  
        UniqueName = "AuditView",  
        ButtonType = GridButtonColumnType.LinkButton,  
        Text = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" // just make background image from css class visible (using CSS sprites)  
    }; 
    column.HeaderStyle.CssClass = "rgHeader " + "cms-column-auditview";  
    column.ItemStyle.CssClass = newCssClass; 
    grid.Columns.Add(auditColumn); 
}  


The corresponding CSS class is:
.cms-column-auditview a { 
    text-decorationnone !important; 
    backgroundurl(/Cms/Resources/Images/iconset.png) 0px -2032px no-repeat
}

Now I want to add a mouseover hint to those images using a "Title" attribute on the link that is rendered.
I need to use CSS sprites for performance reasons. How can I achieve this?

Regards,

   Sebastian


Sebastian
Top achievements
Rank 2
 answered on 26 May 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?