Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
110 views
Hi,  I have a RadGrid setup using the CardView Demo.  For each item/record I want to run some code and modify that item template contents based on the id field in that record during the OnItemDataBound.  I'm grabbing stuff from a related table based on this records id and changing some values in the itemtemplate.

Since its just a itemtemplate in the mastertableview how do I referance the itemtemplate when its not a column and there is no uniqueid's.  I have the single hidden column defined so I dont get the no records found issue. So im getting all of the records.

GridDataItem dataItem = e.Item as GridDataItem in my OnItemDataBound isnt null but how do I access the database records for this dataItem.  For now I just want the id field but id also like to know how to access any of the fields.

Thanks
-Keith
SonicImaging
Top achievements
Rank 1
 answered on 01 Mar 2009
8 answers
286 views
Hi,
I am using RadGrid control connected to an ObjectDataSource. I am using ItemTemplate and EditItemTemplate to show the items as in the demo of the ListView/DataList like RadGrid.
When i press the update after editing the item, the ObjectDataSource Update method is fired but the data passes is not bounded to the data in the Edit template even though it defined to be binded. i.e. all the parameters passed are nulls.

How can i edit/insert an item?

This is my code:

 <telerik:RadGrid ID="RadGrid2" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
        AllowAutomaticUpdates="True" DataSourceID="AgentsDatasource" GridLines="None" 
        ShowHeader="False" BorderStyle="None" GroupingEnabled="False" Skin="Outlook" 
        Width="400px"
        <HeaderContextMenu EnableTheming="True"
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </HeaderContextMenu> 
        <ItemStyle BorderStyle="None" /> 
        <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="None" DataKeyNames="UserId" 
            DataSourceID="AgentsDatasource" EditMode="InPlace"  BorderStyle="None"
            <ItemTemplate > 
                <asp:Label ID="Label1" runat="server" Text='<%#Bind("SwitchId") %>'></asp:Label> 
                &nbsp; 
                <asp:Label ID="Label2" runat="server" Text='<%#Bind("Extension") %>'></asp:Label> 
                &nbsp;&nbsp; 
                <asp:LinkButton ID="btnEdit" runat="server" CommandName="Edit" Text="Edit"
                </asp:LinkButton> 
            </ItemTemplate> 
            <EditItemTemplate> 
                <asp:TextBox ID="tbSwitch" runat="server" Text='<%#Bind("SwitchId")%>'></asp:TextBox>&nbsp; 
                <asp:TextBox ID="TextBox1" runat="server" Text='<%#Bind("Extension")%>'></asp:TextBox>&nbsp;&nbsp; 
                <asp:LinkButton ID="btnEdit" runat="server" CommandName="Update" Text="Update"
                </asp:LinkButton> 
            </EditItemTemplate> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                
                <telerik:GridBoundColumn DataField="SwitchId" HeaderText="SwitchId" UniqueName="SwitchId"
                </telerik:GridBoundColumn> 
                
                <telerik:GridBoundColumn DataField="Extension" HeaderText="Extension" UniqueName="Extension"
                </telerik:GridBoundColumn>                     
            </Columns> 
            <EditFormSettings> 
                <EditColumn UniqueName="EditCommandColumn1"
                </EditColumn> 
            </EditFormSettings> 
        </MasterTableView> 
        <ClientSettings> 
            <Selecting AllowRowSelect="False" EnableDragToSelectRows="True" /> 
        </ClientSettings> 
        <SelectedItemStyle BorderStyle="None" /> 
        <FilterMenu EnableTheming="True"
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </FilterMenu> 
    </telerik:RadGrid>  
    <asp:ObjectDataSource ID="AgentsDatasource" runat="server" SelectMethod="FillAgentsExtensions" 
        UpdateMethod="UpdateAgentsExtensions" TypeName="WebTester.WebTesterDataSource" 
        OldValuesParameterFormatString="original_{0}"
        <UpdateParameters> 
            <asp:Parameter Name="original_UserId" Type="Int32" /> 
            <asp:Parameter Name="SwitchId" Type="Int32" /> 
            <asp:Parameter Name="Extension" Type="String" /> 
        </UpdateParameters> 
    </asp:ObjectDataSource> 

Thanks!

Ruth.


Ruth Dahan
Top achievements
Rank 1
 answered on 01 Mar 2009
0 answers
314 views
I want to build a samples website that has a single index (home) page that lists and runs (locally) all the telerik sample solutions I have modified. The idea is I want to be able to list all my samples on one page with a description so I can text search for some keyword to find a specific sample.  Then I want to be able to run that sample solution right from the description by linking to the sample's Default.aspx.

My problem is each sample contains its own copy of the 17MB "Telerik.Web.UI.dll".  So if I build my site with 10 samples (for example) I will end up with 10 copies of the dll or 170MB. I realize I could build all the samples into a single website, but I want each one to be a stand alone solution (expect for the centrally located bin folder).

How can I modify a sample solution to call one instance of the dll from some bin folder that is shared by all the samples?

Thanks!
- Robert
Robert Gray
Top achievements
Rank 1
 asked on 01 Mar 2009
1 answer
118 views
I have a Slide.Show in my app and I need to put a RadWindow over top of it.  The problem is that the iframe shows as expected but the RadWindow skin is behind the Slide.Show.  Is there a way to set the z-index of the window so that it covers the Silverlight Slide.Show app?

Thanks in advance
Chase Florell
Top achievements
Rank 1
 answered on 28 Feb 2009
0 answers
127 views
Hi, I have an asp.net application and wish to convert the asp menu to a rad menu and need some help with the code behind.  Here is the current asp menu code behind.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Vevo;
using Vevo.DataAccessCache;
using Vevo.DataAccessLib;

public partial class Components_CategoryNavMenuList : Vevo.Language.BaseLanguageUserControl
{
    private int _nodeDepth = 0;
    private int _maxNode = 0;
    
    private string CategoryID
    {
        get
        {
            string id = Request.QueryString["CategoryID"];
            if (String.IsNullOrEmpty( id ))
                return "0";
            else
                return id;
        }
    }


    private string CategoryName
    {
        get
        {
            if (Request.QueryString["CategoryName"] == null)
                return String.Empty;
            else
                return Request.QueryString["CategoryName"];
        }
    }

    private void PopulateControls()
    {
        DataTable table = CategoryAccessCache.Instance.GetByParentID(
            CultureUtilities.StoreCultureID, "0", "SortOrder", FlagFilter.ShowTrue );

        uxCategoryNavListMenu.Items.Clear();
        foreach (DataRow row in table.Rows)
        {
            uxCategoryNavListMenu.Items.Add( NewItem( row ) );
            _nodeDepth = 0;
        }

        foreach (MenuItem mi in uxCategoryNavListMenu.Items)
        {
            CategoryItem( mi, CategoryID, CategoryName );
        }
    }

    private void CategoryItem( MenuItem menuItem, string categoryID, string categoryName )
    {
        if (menuItem.Value == categoryID || menuItem.Text == categoryName)
        {
            if (menuItem.Value == CategoryID || menuItem.Text == CategoryName)
                menuItem.Selected = true;
            //if (menuItem.Parent != null)
            //    menuItem.Parent.Selected = true;
            return;
        }
        else
        {
            foreach (MenuItem mi in menuItem.ChildItems)
            {
                if (mi.Value == categoryID || mi.Text == categoryName)
                {
                    if (mi.Value == CategoryID || mi.Text == CategoryName)
                        mi.Selected = true;
                    CategoryItem( menuItem, mi.Parent.Value, mi.Parent.Text );
                    return;
                }
                CategoryItem( mi, categoryID, categoryName );
            }
        }
    }

    private void PopulateCategories( MenuItem item, string parentCategoryID )
    {
        DataTable table = CategoryAccessCache.Instance.GetByParentID( CultureUtilities.StoreCultureID, parentCategoryID, "SortOrder", FlagFilter.ShowTrue );

        foreach (DataRow row in table.Rows)
        {
            item.ChildItems.Add( NewItem( row ) );
        }
    }

    private MenuItem NewItem( DataRow row )
    {
        MenuItem newItem = new MenuItem();
        newItem.Text = row["Name"].ToString();
        newItem.Value = row["CategoryID"].ToString();

        if (CategoryAccessCache.Instance.IsCategoryIDNotLeaf( row["CategoryID"].ToString() ))
        {
            newItem.NavigateUrl = UrlManager.GetCategoryUrl( row["CategoryID"].ToString(), row["UrlName"].ToString() );

            _nodeDepth++;
            if (_nodeDepth < MaxNode) //Max Tree depth
                PopulateCategories( newItem, row["CategoryID"].ToString() );
            _nodeDepth--;
        }
        else
        {
            newItem.NavigateUrl = UrlManager.GetCategoryUrl( row["CategoryID"].ToString(), row["UrlName"].ToString() );
        }
        return newItem;
    }


    protected void Page_Load( object sender, EventArgs e )
    {
        if (!IsPostBack)
        {
            PopulateControls();
        }
    }

    
    public int MaxNode
    {
        get
        {
            return _maxNode;
        }
        set
        {
            _maxNode = value;
        }
    }

    public void Refresh()
    {
        PopulateControls();
    }
}

chris
Top achievements
Rank 1
 asked on 28 Feb 2009
3 answers
248 views
Hello,
On my web page, I am having two Rad Combo boxes and a asp TextBox. On selecting the item from the first Radcombo box I am loading the data in the second Radcombo box. This is implemented as shown in the demos here:
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

Now, my requirement is that on selecting an item from the second rad combo, I want the asp textbox to be populated with the value from the database. And this needs to be implemented without the page doing postback(i.e. using AJAX).

How should I implement this change. Please suggest.

Regards,
Rajiv
Rajiv
Top achievements
Rank 1
 answered on 28 Feb 2009
0 answers
119 views
Hi there,

I have used tabstrip on my page to list some categories. In my application, 20-25 categories are usually present. I have tried smooth scrolling as well as per tab scrolling feature of tabstrip but both are two slow. Is there anyway that I can make it more efficient by scrolling tabs say by a fixed number? I mean to say that clicking scroll button once scroll say 5 tabs in one go. Please help.
Tahami
Top achievements
Rank 1
 asked on 28 Feb 2009
4 answers
172 views
Hi all, i'm currently using RadControls for ASP.NET AJAX Q3 2008 version 2008.3.1314.35

When i navigate the calendar on firefox and refresh the page, the navigation seemed to be cached from my previous position. For example if i already navigate to October 2009, refresh the page (back to February 2009), and click next, i get November 2009 instead of March 2009.

And the second problem I have is that I cannot change the NavigationNextImage to custom image in Q3 version using the property box, but i can change it from css class like this:

    .RadCalendar1 .rcTitlebar .rcFastPrev
    {
        background-position:3px -48px;
    }

Can anyone tell me why this happen on firefox and how to change the image without using the css class?

Best regards,
Khonato

aozora
Top achievements
Rank 2
 answered on 28 Feb 2009
1 answer
98 views
What does it mean when I've got a simple page having RadScriptManager, RadAjaxManager and load panel, plug RadGrid,  but when I click to configure AjaxManger it only shows a single node, Controls, and does not show the grid or any other control that can originate ajax calls?

Thanks
Mark
Mark
Top achievements
Rank 1
 answered on 28 Feb 2009
5 answers
179 views
Hi there,
I believe this is an error, however I may be mistaken.

I am using a FormDecorator on a master-page to decorate an asp:Login on my child page.

Inside my Web.Config I have set:
<authorization>
     <deny users="?"/>
     <allow users="*"/>
</authorization>

... to prevent access to my application, per following Microsoft's advice here.

I am fairly new to ASP.NET Membership so perhaps I have improperly configured it?
Jon
Top achievements
Rank 1
 answered on 27 Feb 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?