Telerik Forums
UI for ASP.NET AJAX Forum
12 answers
535 views
Dear Telerik,

On the MonthView of RadScheduler, I would like for the calendar to expand to fill the entire width of the user's browser window. If I leave the Width property empty, it works perfectly in IE, but in Firefox, all of the columns are super skinny, to the point where it is basically unreadable.

Am I doing something wrong to have it work in IE but not in Firefox? Of course, my preference is for it to have the same behavior in Firefox.

If that's not possible or will not be possible soon, do you have any quick suggestions on how to somehow get the width of the browser window and pass it back to the server to then set the width of the RadScheduler? If the user resized the window, the RadScheduler would not resize until the next postback, but that's at least a step in the right direction.

Thanks,

Don
Bill Battaglia
Top achievements
Rank 1
 answered on 22 Mar 2012
3 answers
119 views
Hi:
I have a 'Web Site' (not WAP).  I just went through the MS wizard for converting the site to 4.0.  One page is having an issue.  I am getting a message box from Microsoft Visual Studio saying:  Invalid argument
In Visual Studio it has highlighted the following in Telerik.Web.Ui.WebResource... [dynamic]:
this._displayElement.style.borderRightWidth=parseInt($telerik.getComputedStyle(this._displayElement,"borderRightWidth",""))+parseInt($telerik.getComputedStyle(this._textBoxElement,"borderRightWidth",""))+"px";

Phil
Phil
Top achievements
Rank 2
 answered on 22 Mar 2012
3 answers
177 views
Hi:
No question.  Just sharing some code.  This code is from a web-part that returns a 5 day weather forcast from Yahoo.  So depending on what type of web project you are using 'Web-Site or WAP.  I just suggest you use the MS create user control and then drop the following UI stuff in below the <@Control :
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  <style type="text/css">
    .wthrTitle     { font-family: Tahoma; font-size: 14px; width: 370px; color: White; background: blue; border-top: 1px solid navy; text-align: center; }
    .wthrContainer { width: 74px; text-align: center; border: 1px; float: left; }
    .wthrDayTitle  { font-family: Tahoma; font-size: 14px; width: 100%; color: White; background: blue; border-bottom: 1px solid navy; border-top: 1px solid navy; }
    .wthrForcast   { font-family: Tahoma; font-size: 12px; color: blue; }
    .wthrTemp      { font-family: Tahoma; font-size: 10px; color: blue; }
    .wthrClear     { clear: left; }
  </style>
<div class="wthrTitle"><asp:Label ID="descriptionLabel" runat="server" Text='' /></div>
<telerik:RadListView ID="weatherRadListView" runat="server">
    <ItemTemplate>
        <div class="wthrContainer">
            <div class="wthrDayTitle"><asp:Label ID="dayLabel" runat="server" Text='<%# Eval("DayName") %>' /></div><br />
            <asp:Image ID="forcastImage" runat="server" ImageUrl='<%# Eval("ImageUrl") %>' /><br />
            <asp:Label ID="forcastLabel" runat="server" Text='<%# Eval("Forcast") %>' CssClass="wthrForcast" /><br />
            <div class="wthrForcast"><asp:Label ID="highLabel" runat="server" Text='<%# Eval("High") %>' />° -
                <asp:Label ID="lowLabel" runat="server" Text='<%# Eval("Low") %>' />°</div><br />
        </div>
    </ItemTemplate>
</telerik:RadListView>
<br class="wthrClear" />
<asp:HiddenField ID="zipcodeHidden" runat="server" Value="49333" />

I have supplied both C# and VB.  Piece in the following code not trying to damage the code behind class name:
// By Phil Huhn 2012-01-08
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//
using System.Xml;
using System.Xml.Linq;
using System.Net;
//
 
namespace Telerik.UserControls
{
    public partial class YahooWeather : System.Web.UI.UserControl
    {
        //
        // ------------------------------------------------------------------------
        //   Properties
        //       ZipCode
        //
        #region "Properties"
        //
        /// <summary>
        /// External way to pass values to user control
        /// </summary>
        /// <value></value>
        /// <returns></returns>
        /// <remarks></remarks>
        public string ZipCode
        {
            get { return zipcodeHidden.Value; }
            set { zipcodeHidden.Value = value; }
        }
        //  
        #endregion
        //
        /// <summary>
        /// call during each postback
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks></remarks>
        protected void Page_Load(object sender, EventArgs e)
        {
            GetWeather(ZipCode);
        }
        //
        /// <summary>
        /// Get weather from yahoo
        /// </summary>
        /// <param name="zipCode"></param>
        /// <remarks></remarks>
        protected void GetWeather(string zipCode)
        {
            try
            {
                XDocument xmlData = XDocument.Load("http://xml.weather.yahoo.com/forecastrss/" + zipCode + "_f.xml");
                //
                List<WeatherItem> _list = new List<WeatherItem>();
                string _description = null;
                System.DateTime _date;
                //...<channel>
                foreach (XElement _row in xmlData.Root.Elements("channel"))
                {
                    foreach (XElement _field in _row.Elements())
                    {
                        //<title>Yahoo! Weather - Any Town</title>
                        //<link></link>
                        //<description>Yahoo! Weather for Any Town</description>
                        if ((_field.Name.ToString() == "description"))
                        {
                            // cherry pick the desired data at this level.
                            _description = _field.Value;
                            descriptionLabel.Text = _description;
                        }
                        //<language>en-us</language>
                        //<lastBuildDate>Sat, 07 Jan 2012 10:51 am EST</lastBuildDate>
                        if ((_field.Name.ToString() == "lastBuildDate"))
                        {
                            string _dateString = _field.Value.Substring(5);
                            _date = DateTime.Parse(_dateString.Substring(0, _dateString.Length - 4));
                            descriptionLabel.Text = _description + " at " + _date.ToShortTimeString();
                        }
                        //<ttl>60</ttl>
                        //<yweather:location city="Any Town" region="MI" country="US"/>
                        //<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
                        //<yweather:wind chill="35" direction="310" speed="14"/>
                        //<yweather:atmosphere humidity="65" visibility="10" pressure="29.89" rising="1"/>
                        //<yweather:astronomy sunrise="8:02 am" sunset="5:17 pm"/>
                        //<image>
                        //<item>
                        if (_field.Name.ToString() == "item")
                        {
                            foreach (XElement _itm in _field.Elements())
                            {
                                if (_itm.Name.LocalName == "forecast")
                                {
                                    WeatherItem _wi = new WeatherItem();
                                    _wi.YahooForcast(_itm);
                                    _list.Add(_wi);
                                }
                            }
                        }
                    }
                }
                if (_list.Count > 0)
                {
                    _list[0].DayName = "Today";
                }
                weatherRadListView.DataSource = _list;
                weatherRadListView.DataBind();
            }
            catch (Exception e)
            {
                int _i = 1;
            }
        }
 
        //
    }
}
public class WeatherItem
{
    public string DayName { get; set; }
    public System.DateTime Day { get; set; }
    public int Low { get; set; }
    public int High { get; set; }
    public string Forcast { get; set; }
    public string Code { get; set; }
    public string ImageUrl { get; set; }
    public string LocalImageUrl { get; set; }
    protected string LocalImagePath = "../Images/Weather/";
    //
    public WeatherItem()
    {
    }
    //
    public WeatherItem(string localImagePath)
    {
        LocalImagePath = localImagePath;
    }
    //
    //   <yweather:forecast day="Sun" date="8 Jan 2012"
    //       low="28" high="37" text="Partly Cloudy" code="30"/>
    //
    public void YahooForcast(XElement forcastItem)
    {
        DayName = forcastItem.Attribute("day").Value;
        Day = Convert.ToDateTime(forcastItem.Attribute("date").Value);
        Low = Convert.ToInt32(forcastItem.Attribute("low").Value);
        High = Convert.ToInt32(forcastItem.Attribute("high").Value);
        Forcast = forcastItem.Attribute("text").Value;
        Code = forcastItem.Attribute("code").Value;
        ImageUrl = "http://l.yimg.com/a/i/us/we/52/" + Code + ".gif";
        LocalImageUrl = LocalImagePath + Code + ".gif";
    }
}

And here is the same code in vb.net:
' By Phil Huhn 2012-01-08
Option Strict On
Option Explicit On
'
Imports System.Xml
Imports System.Net
'
Public Class YahooWeather
    Inherits System.Web.UI.UserControl
    '
    ' ------------------------------------------------------------------------
    '   Properties
    '       ZipCode
    '
#Region "Properties"
    '
    ''' <summary>
    ''' External way to pass values to user control
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Property ZipCode() As String
        Get
            Return zipcodeHidden.Value
        End Get
        Set(ByVal value As String)
            zipcodeHidden.Value = value
        End Set
    End Property
    '  
#End Region
    '
    ''' <summary>
    ''' call during each postback
    ''' </summary>
    ''' <param name="sender"></param>
    ''' <param name="e"></param>
    ''' <remarks></remarks>
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        GetWeather(ZipCode)
    End Sub
    '
    ''' <summary>
    ''' Get weather from yahoo
    ''' </summary>
    ''' <param name="zipCode"></param>
    ''' <remarks></remarks>
    Protected Sub GetWeather(zipCode As String)
        Try
            Dim xmlData As Linq.XDocument = _
                XDocument.Load("http://xml.weather.yahoo.com/forecastrss/" & zipCode & "_f.xml")
            '
            Dim _list As New List(Of WeatherItem)
            Dim _description As String = Nothing
            Dim _date As Date = Nothing
            For Each _row As XElement In xmlData.Root.Elements("channel") '...<channel>
                For Each _field As XElement In _row.Elements
                    '<title>Yahoo! Weather - Any Town</title>
                    '<link></link>
                    '<description>Yahoo! Weather for Any Town</description>
                    If (_field.Name.ToString() = "description") Then
                        ' cherry pick the desired data at this level.
                        _description = _field.Value
                        descriptionLabel.Text = _description
                    End If
                    '<language>en-us</language>
                    '<lastBuildDate>Sat, 07 Jan 2012 10:51 am EST</lastBuildDate>
                    If (_field.Name.ToString() = "lastBuildDate") Then
                        Dim _dateString As String = _field.Value.Substring(5)
                        _date = DateTime.Parse(_dateString.Substring(0, _dateString.Length - 4))
                        descriptionLabel.Text = _description & " at " & _date.ToShortTimeString
                    End If
                    '<ttl>60</ttl>
                    '<yweather:location city="Any Town" region="MI" country="US"/>
                    '<yweather:units temperature="F" distance="mi" pressure="in" speed="mph"/>
                    '<yweather:wind chill="35" direction="310" speed="14"/>
                    '<yweather:atmosphere humidity="65" visibility="10" pressure="29.89" rising="1"/>
                    '<yweather:astronomy sunrise="8:02 am" sunset="5:17 pm"/>
                    '<image>
                    '<item>
                    If _field.Name.ToString() = "item" Then
                        For Each _itm As XElement In _field.Elements
                            If _itm.Name.LocalName = "forecast" Then
                                Dim _wi As New WeatherItem()
                                _wi.YahooForcast(_itm)
                                _list.Add(_wi)
                            End If
                        Next
                    End If
                Next
            Next
            If _list.Count > 0 Then
                _list(0).DayName = "Today"
            End If
            weatherRadListView.DataSource = _list
            weatherRadListView.DataBind()
        Catch e As Exception
            Dim _i As Integer = 1
        End Try
    End Sub
    '
End Class
Public Class WeatherItem
    Public Property DayName() As String
    Public Property Day() As Date
    Public Property Low() As Integer
    Public Property High() As Integer
    Public Property Forcast() As String
    Public Property Code() As String
    Public Property ImageUrl() As String
    Public Property LocalImageUrl() As String
    Protected LocalImagePath As String = "../Images/Weather/"
    '
    Public Sub New()
    End Sub
    '
    Public Sub New(localImagePath As String)
        localImagePath = localImagePath
    End Sub
    '
    '   <yweather:forecast day="Sun" date="8 Jan 2012"
    '       low="28" high="37" text="Partly Cloudy" code="30"/>
    '
    Public Sub YahooForcast(forcastItem As XElement)
        DayName = forcastItem.Attribute("day").Value
        Day = CDate(forcastItem.Attribute("date").Value)
        Low = CInt(forcastItem.Attribute("low").Value)
        High = CInt(forcastItem.Attribute("high").Value)
        Forcast = forcastItem.Attribute("text").Value
        Code = forcastItem.Attribute("code").Value
        ImageUrl = "http://l.yimg.com/a/i/us/we/52/" & Code & ".gif"
        LocalImageUrl = LocalImagePath & Code & ".gif"
    End Sub
End Class

You can drag the control onto your regular form:

<%@ Register src="UserControls/YahooWeather.ascx" tagname="YahooWeather" tagprefix="uc1" %>
...
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<uc1:YahooWeather ID="YahooWeather1" runat="server" ZipCode="48103" />

You can set the us zip code via a property...

Have fun:
Phil
Phil
Top achievements
Rank 2
 answered on 22 Mar 2012
5 answers
144 views
Hi,

Not sure this is the best forum for this but I couldn't find a better one, so please move it if there is a better place for it.

Recently, we started converting our website to use RadInputManager instead of Microsoft Validators. All works great, and looks much nicer. However, about the same time, we started getting errors from MicrosoftAjax.js:

Sys.WebForms.PageRequestManagerServerErrorException: Unable to cast object of type 'System.String' to type 'System.Collections.IDictionary'

Refreshing the page does not get rid of the error, but navigating to a different page than back again does. This only seems to occur after a long period of inactivity, but it's very intermittent and I have been unable to reliably reproduce it. It happens both in our dev environment using the dev web server and debug MS library, and our test environment using IIS6 and the non-debug MS library.

I'm not sure this is related to Telerik, but it only started happening around the time we started converting to RadInputManager, leading me to believe there may be a connection. Note however that it is not only pages with a RadInputManager that produce the error.

Has anyone else seen this?

Thanks for any info,

Ross Crawford
Lucania
Top achievements
Rank 1
 answered on 22 Mar 2012
1 answer
99 views
Is there a way to have the RadTreeView control provide client side keyboard up/down arrow navigation of the items in the treeview list?
Ed
Top achievements
Rank 1
 answered on 21 Mar 2012
15 answers
1.6K+ views
 I was having problems w/getting the Prometheus controls to appear in the VS2008 toolbox (even after running the toolbox installer and manually trying to add them). I finally realized that the controls won't appear unless I set the targeting of the project to .NET 3.5. The docs seem to imply all of this should still work even if I'm targeting the 2.0 framework. I tried adding the assembly from the bin directory (instead of bin35) w/o much luck - the controls still wouldn't appear.

Is this supposed to work or is there something else I need to try?

Thanks,
Blog
-Paul
Jordan
Top achievements
Rank 1
 answered on 21 Mar 2012
2 answers
168 views
Hi All,

I am new to Telerik, please help me.
Rad filter doesn't work properly when I disable mastertableview's viewstate of the radgrid.But I need to create grid dynamically for diiferent profile in page so It is must to disable the mastertableview viewstate.

Please help me to resolve this issue. Thanks In advance!!
Eyup
Telerik team
 answered on 21 Mar 2012
1 answer
56 views
I'm using nested RadSplitters and RadPanes to create a 3 pane layout that fills the browser window. The problem occurs in IE9 when "Compatibility View" is turned on: RadTextBox elements do not scroll with the other content in the pane, but instead remain fixed in the browser window (as if they had a position of "fixed"). Here is a page that demonstrates the problem:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="RadControlsWebApp1.WebForm2" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <style type="text/css">
        html, body, form
        {
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI"
                Name="Telerik.Web.UI.Common.Core.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI"
                Name="Telerik.Web.UI.Common.jQuery.js">
            </asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI"
                Name="Telerik.Web.UI.Common.jQueryInclude.js">
            </asp:ScriptReference>
        </Scripts>
    </telerik:RadScriptManager>
    <div id="ParentDivElement" style="height: 100%;">
        <telerik:RadSplitter ID="MainSplitter" runat="server" Height="100%" Width="100%"
            Orientation="Horizontal" PanesBorderSize="0" BorderSize="0">
            <telerik:RadPane ID="TopPane" runat="server" Height="88"
                Scrolling="none" CssClass="topPane" BorderStyle="None">
                <h1>Top Menu Goes Here</h1>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="HorizontalSplitterBar" runat="server" CollapseMode="None"></telerik:RadSplitBar>               
            <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500">
                 <telerik:RadSplitter ID="NestedSplitter" runat="server" LiveResize="true"
                    BorderStyle="None" CssClass="showTopBorder">
                    <telerik:RadPane ID="LeftPane" runat="server" Width="300">
                        <p>Side menu goes here</p>           
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="None" />
                    <telerik:RadPane ID="ContentPane" runat="server" CssClass="valignPane">
                        <asp:Panel ID="Panel1" runat="server">                       
                        <div>
                            This is a RadTextBox: <telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox>
                        </div>
                        <div style="height:1200px">
                            This div is here to force the pane to have a scroll bar.
                        </div>
                        </asp:Panel>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </div>
    </form>
</body>
</html>
Jonah
Top achievements
Rank 1
 answered on 21 Mar 2012
3 answers
74 views
Much as I enjoy the hunt for what I'm missing I hope someone out there will take pity on me and help me along the learning curve ;)
I have a listview databound to a LINQ query and all works fine.  I need the user to be able to select an item, by clicking on it's icon and deleting it.  So, in my ASPX I have this:

<asp:ImageButton ID="categoryImageBtn" OnClick="categoryBtn_Click" CommandName="Select" Height="30" Width="50" runat="server" ImageUrl='<%# Eval("ImagePath") %>' />

And in my codebehind I have this:

 

protected void myProjectListView_ItemCommand(object sender, RadListViewCommandEventArgs e)

{
if (e.CommandName == RadListView.SelectCommandName)

{

Label2.Text = "Bingo";
}
}

Just to see if it's working and needless to say... no luck :(  I know the button works, as I wired up an onCLick event that fires fine.

 

I've tried various approaches in the tutorials with no luck. 

 

I'd be very very grateful if someone could take a moment to point me in the right direction!

 

Paul

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Paul
Top achievements
Rank 1
Iron
 answered on 21 Mar 2012
1 answer
50 views
Trying to get the last detailgrid to work, everything loads fine up until I pick on the last grid (myModelGrid) to load and it does not find the parant key for the datagrid above.  Even if i put in a hardcoded key it still loads nothing, even if something is there, at this point I am rather confused, made sure all keys are supposed to be what they are and are spelled and capped correctly.  what it gives me is the following error
Incorrectt syntax near AND, which is part of the following, it does not get the parentkey.  Can grid not go 4 levels down without doing something different, the funnly thing is I can add DB items to that level, but just not see them.

If e.DetailTableView.Name = "myModelGrid" Then
          sql = "Select intModelId, intMakeId, strModel from Drat_Model where intMakeId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intMakeId") & " AND bitArchive IS NULL ORder by strModel"
          e.DetailTableView.DataSource = getData(sql)
      End If

<telerik:RadGrid ID="myRadGrid" runat="server" Width="100%" BorderWidth="1px" CellPadding="4" Skin="Web20">
                                <MasterTableView AutoGenerateColumns="false" DataKeyNames="intCategoryId" HierarchyDefaultExpanded="false" Font-Size="10" Font-Names="Veranda,arial,sans-serif" 
                                    HeaderStyle-HorizontalAlign="Center" Name="MasterGrid" ExpandCollapseColumn-ButtonType="ImageButton" HierarchyLoadMode="Client" AllowPaging="True" PageSize="20" 
                                    PagerStyle-Mode="NumericPages" ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                    <ItemStyle HorizontalAlign="Center" /><AlternatingItemStyle BackColor="#B0C4DE"  HorizontalAlign="Center" /><HeaderStyle ForeColor="White" Font-Bold="true"  />
                                    <DetailTables>
                                        <telerik:GridTableView Name="myManufacGrid" runat="server" DataKeyNames="intManufacturerId" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10"
                                            AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                            ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                            <ParentTableRelation>
                                                <telerik:GridRelationFields DetailKeyField="intCategoryId" MasterKeyField="intCategoryId" />
                                            </ParentTableRelation>
                                            <HeaderStyle Font-Bold="true" HorizontalAlign="Center" CssClass="MostInnerHeaderStyle" />
                                            <ItemStyle CssClass="MostInnerItemStyle" HorizontalAlign="Center" />
                                            <AlternatingItemStyle CssClass="MostInnerAlernatingItemStyle" HorizontalAlign="Center" />
                                            <DetailTables>
                                            <telerik:GridTableView DataKeyNames="intMakeID" Name="myMakeGrid" Width="100%" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10"
                                                AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                                ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                                    <ParentTableRelation>
                                                        <telerik:GridRelationFields DetailKeyField="intManufacturerId" MasterKeyField="intManufacturerId" />
                                                    </ParentTableRelation>
                                                    <HeaderStyle Font-Bold="true" HorizontalAlign="Center" CssClass="InnerSubHeaderStyle" /><ItemStyle CssClass="InnerSubItemStyle" HorizontalAlign="Center"  />
                                                    <AlternatingItemStyle CssClass="InnerSubAlernatingItemStyle" HorizontalAlign="Center" />
                                                    <DetailTables>
                                                         <telerik:GridTableView DataKeyNames="intModelId" Name="myModelGrid" Width="100%" TableLayout="Fixed" BorderWidth="1px" CellPadding="6" Font-Size="10"
                                                            AutoGenerateColumns="False" HeaderStyle-HorizontalAlign="Center" BorderColor="#404040" Font-Names="Veranda,arial,sans-serif" GridLines="Both" ExpandCollapseColumn-ButtonType="ImageButton"
                                                            ExpandCollapseColumn-CollapseImageUrl="~/Images/30.png" ExpandCollapseColumn-ExpandImageUrl="~/Images/29.png">
                                                                <ParentTableRelation>
                                                                    <telerik:GridRelationFields DetailKeyField="intMakeId" MasterKeyField="intMakeId" />
                                                                </ParentTableRelation>
                                                                <HeaderStyle Font-Bold="true" HorizontalAlign="Center" CssClass="InnerSubHeaderStyle" /><ItemStyle CssClass="InnerSubItemStyle" HorizontalAlign="Center"  />
                                                                <AlternatingItemStyle CssClass="InnerSubAlernatingItemStyle" HorizontalAlign="Center" />
                                                                    <Columns>
                                                                         <telerik:GridBoundColumn HeaderText="MODEL" DataField="strModel" />
                                                                         <telerik:GridTemplateColumn HeaderText="Edit">
                                                                            <ItemTemplate>
                                                                                    <asp:ImageButton runat="server" ID="imgModelEdit"  CommandArgument='<%# bind("intModelId") %>' CommandName="ModelEdit" ImageUrl="~/Images/edit_icon.png" />
                                                                            </ItemTemplate>
                                                                        </telerik:GridTemplateColumn>
                                                                        <telerik:GridTemplateColumn HeaderText="Archive">
                                                                            <ItemTemplate>
                                                                                    <asp:ImageButton runat="server" ID="imgModelArchive"  CommandArgument='<%# bind("intModelId") %>' CommandName="ModelArchive" ImageUrl="~/Images/edit_icon.png" 
                                                                                    OnClientClick="return confirm('Are you sure you want to archive this Model, This will Archive everything Underneath as well.');" />
                                                                            </ItemTemplate>
                                                                        </telerik:GridTemplateColumn>
                                                                    </Columns>
                                                         </telerik:GridTableView>
                                                    </DetailTables>
                                                        <Columns>
                                                             <telerik:GridBoundColumn HeaderText="MAKE" DataField="strmake" />
                                                             <telerik:GridTemplateColumn HeaderText="ADD MODEL">
                                                                <ItemTemplate>
                                                                        <asp:ImageButton runat="server" ID="imgAddPosition"  CommandArgument='<%# bind("intMakeID") %>' CommandName="AddModel" ImageUrl="~/Images/29.png" />
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                             <telerik:GridTemplateColumn HeaderText="Edit">
                                                                <ItemTemplate>
                                                                        <asp:ImageButton runat="server" ID="imgMakeEdit"  CommandArgument='<%# bind("intMakeID") %>' CommandName="MakeEdit" ImageUrl="~/Images/edit_icon.png" />
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridTemplateColumn HeaderText="Archive">
                                                                <ItemTemplate>
                                                                        <asp:ImageButton runat="server" ID="imgMakeArchive"  CommandArgument='<%# bind("intMakeID") %>' CommandName="MakeArchive" ImageUrl="~/Images/edit_icon.png" 
                                                                        OnClientClick="return confirm('Are you sure you want to archive this Make, This will Archive everything Underneath as well.');" />
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                        </Columns>
                                            </telerik:GridTableView>
                                        </DetailTables>
                                            <Columns>
                                                <telerik:GridBoundColumn HeaderText="MANUFACTURERS" DataField="strManufacturer"></telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn HeaderText="ADD MAKE">
                                                    <ItemTemplate>
                                                            <asp:ImageButton runat="server" ID="imgAddPosition"  CommandArgument='<%# bind("intManufacturerId") %>' CommandName="AddMake" ImageUrl="~/Images/29.png" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn HeaderText="Edit">
                                                    <ItemTemplate>
                                                            <asp:ImageButton runat="server" ID="imgManEdit"  CommandArgument='<%# bind("intManufacturerId") %>' CommandName="ManEdit" ImageUrl="~/Images/edit_icon.png" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                                <telerik:GridTemplateColumn HeaderText="Archive">
                                                    <ItemTemplate>
                                                            <asp:ImageButton runat="server" ID="imgManArchive"  CommandArgument='<%# bind("intManufacturerId") %>' CommandName="ManArchive" ImageUrl="~/Images/edit_icon.png" 
                                                            OnClientClick="return confirm('Are you sure you want to archive this Manufacturer, This will Archive everything Underneath as well.');" />
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                    <Columns>
                                    <telerik:GridBoundColumn HeaderText="Category" DataField="strCategory" />
                                    <telerik:GridTemplateColumn HeaderText="Add Manufacturer">
                                        <ItemTemplate>
                                                <asp:ImageButton runat="server" ID="imgAdd"  CommandArgument='<%# bind("intCategoryId") %>' CommandName="AddMan" ImageUrl="~/Images/29.png" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Edit">
                                        <ItemTemplate>
                                                <asp:ImageButton runat="server" ID="imgCatEdit"  CommandArgument='<%# bind("intCategoryId") %>' CommandName="CatEdit" ImageUrl="~/Images/edit_icon.png" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Archive">
                                        <ItemTemplate>
                                                <asp:ImageButton runat="server" ID="imgCatArchive"  CommandArgument='<%# bind("intCategoryId") %>' CommandName="CatArchive" ImageUrl="~/Images/edit_icon.png" 
                                                OnClientClick="return confirm('Are you sure you want to archive this Category, This will Archive everything Underneath as well.');" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                               </MasterTableView>
                              </telerik:RadGrid>



Protected Sub myRadGrid_DetailTableDataBind(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles myRadGrid.DetailTableDataBind
       If e.DetailTableView.Name = "myManufacGrid" Then
           sql = "Select intManufacturerId, intCategoryId, strManufacturer from Drat_Manufacturer where intcategoryId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intCategoryId") & " AND bitArchive IS NULL " _
               & "Order by strManufacturer"
           e.DetailTableView.DataSource = getData(sql)
       End If
       If e.DetailTableView.Name = "myMakeGrid" Then
           sql = "Select intMakeID, intManufacturerID, strMake from Drat_Make where intManufacturerID = " & e.DetailTableView.ParentItem.GetDataKeyValue("intManufacturerId") & " AND bitArchive IS NULL ORder by strMake"
           e.DetailTableView.DataSource = getData(sql)
       End If
       If e.DetailTableView.Name = "myModelGrid" Then
           sql = "Select intModelId, intMakeId, strModel from Drat_Model where intMakeId = " & e.DetailTableView.ParentItem.GetDataKeyValue("intMakeId") & " AND bitArchive IS NULL ORder by strModel"
           e.DetailTableView.DataSource = getData(sql)
       End If
   End Sub


Protected Sub myRadGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles myRadGrid.NeedDataSource
       Dim Cat As Integer = ddlCategory.SelectedValue
       Dim sqlWhere As String
       If Cat > 0 Then
           sqlWhere = "and intCategoryId = " & Cat & " Order by strCategory"
       Else
           sqlWhere = "Order by strCategory"
       End If
       sql = "Select intcategoryID, strCategory from Drat_Category where bitArchive IS NULL " & sqlWhere
       myRadGrid.DataSource = getData(sql)
   End Sub
Kevin
Top achievements
Rank 1
 answered on 21 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?