Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
146 views
Hello ,
Filter Visible False on Page Load.



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Location.aspx.cs" Inherits="TBS_HelpDesk.Views.Assets.Location"
    MasterPageFile="~/Views/Shared/MasterPage.Master" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadCodeBlock runat="server" ID="radCodeBlock">
        <script type="text/javascript">
            function onToolBarClientButtonClicking(sender, args) {
                var grid = $find("<%=RadGrid1.ClientID %>");
                debugger;
                var comandName = args.get_item().get_commandName();
                if (comandName == "Filter") {
                    if (grid.get_masterTableView().get_isFilterItemVisible()) {
                        grid.get_masterTableView().hideFilterItem();
                    }
                    else {
                        grid.get_masterTableView().showFilterItem();
                    }
                }
            }
            function getOuterHTML(obj) {
                if (typeof (obj.outerHTML) == "undefined") {
                    var divWrapper = document.createElement("div");
                    var copyOb = obj.cloneNode(true);
                    divWrapper.appendChild(copyOb);
                    return divWrapper.innerHTML
                }
                else
                    return obj.outerHTML;
            }
            function PrintRadGrid() {
                var previewWnd = window.open('about:blank', '', '', false);
                var sh = '<%= ClientScript.GetWebResourceUrl(RadGrid1.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",RadGrid1.Skin)) %>';
                var shBase = '<%= ClientScript.GetWebResourceUrl(RadGrid1.GetType(),"Telerik.Web.UI.Skins.Grid.css") %>';
                var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link>";
                styleStr += "<link href = '" + shBase + "' rel='stylesheet' type='text/css'></link></head>";
                var htmlcontent = styleStr + "<body>" + getOuterHTML($find('<%= RadGrid1.ClientID %>').get_element()) + "</body></html>";
                previewWnd.document.open();
                previewWnd.document.write(htmlcontent);
                previewWnd.document.close();
                previewWnd.print();
                previewWnd.close(); // working

            }
        </script>
    </telerik:RadCodeBlock>
    <div style="width: 760px; height: 600px;">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Office2007" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" GridLines="None" AutoCompleteType="Disabled" AllowFilteringByColumn="True"
            AllowPaging="True" AllowSorting="True" OnRowDataBound="RadGrid1_RowDataBound1"
            OnItemCommand="RadGrid1_ItemCommand">
            <ExportSettings>
                <Pdf PageHeight="297mm" PageWidth="210mm" />
            </ExportSettings>
            <MasterTableView ShowHeadersWhenNoRecords="true" AutoGenerateColumns="False" CommandItemDisplay="Top"
                EditMode="PopUp" EditFormSettings-PopUpSettings-Modal="true">
                <CommandItemTemplate>
                    <telerik:RadToolBar ID="RadToolBar1" runat="server" OnClientButtonClicking="onToolBarClientButtonClicking">
                        <Items>
                            <telerik:RadToolBarButton Text="Cancel editing" CommandName="CancelAll" ImageUrl="images/Cancel.gif"
                                Visible='<%# RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted %>'>
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton Text="Add new" CommandName="InitInsert" ImageUrl="../../images/AddRecord.gif"
                                Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'>
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton Text="Filter" CommandName="Filter" ImageUrl="../../images/Filter 3.gif">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton Text="Print" CommandName="Print" onclick="PrintRadGrid()">
                            </telerik:RadToolBarButton>
                            <telerik:RadToolBarButton Text="Refresh" CommandName="RebindGrid" ImageUrl="../../images/Refresh.gif">
                            </telerik:RadToolBarButton>
                        </Items>
                    </telerik:RadToolBar>
                </CommandItemTemplate>
                <PagerStyle BackColor="#D8EBFC" Mode="NextPrevNumericAndAdvanced" />
                <HeaderStyle CssClass="dataheadcolor" />
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="10px">
                        <HeaderStyle Width="10px"></HeaderStyle>
                    </telerik:GridEditCommandColumn>
                    <telerik:GridNumericColumn DataField="AddressID" HeaderText="Address ID" SortExpression="AddressID"
                        UniqueName="AddressID" FilterControlWidth="20px" HeaderStyle-Width="120px" ReadOnly="true">
                    </telerik:GridNumericColumn>
                    <telerik:GridBoundColumn DataField="Address_Location_Name" HeaderText="Address Name"
                        SortExpression="Address_Location_Name" UniqueName="Address_Location_Name" FilterControlWidth="40px"
                        HeaderStyle-Width="130px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address_Line1" HeaderText="Line1" SortExpression="Address_Line1"
                        UniqueName="Address_Line1" FilterControlWidth="40px" HeaderStyle-Width="80px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address_Line2" HeaderText="Line2" SortExpression="Address_Line2"
                        UniqueName="Address_Line2" FilterControlWidth="40px" HeaderStyle-Width="80px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address_City" HeaderText="City " SortExpression="Address_City"
                        UniqueName="Address_City" FilterControlWidth="40px" HeaderStyle-Width="90px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address_State" HeaderText="State" SortExpression="Address_State"
                        UniqueName="Address_State" FilterControlWidth="40px" HeaderStyle-Width="90px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address_Country" HeaderText="Country" SortExpression="Address_Country"
                        UniqueName="Address_Country" FilterControlWidth="40px" HeaderStyle-Width="90px">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address_Postal_Code" HeaderText="Postal Code"
                        SortExpression="Address_Postal_Code" UniqueName="Address_Postal_Code" FilterControlWidth="40px"
                        HeaderStyle-Width="90px">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" HeaderStyle-Width="10px">
                        <HeaderStyle Width="10px"></HeaderStyle>
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings ColumnNumber="3" CaptionFormatString="Create">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                    <FormTemplate>
                        <table cellspacing="2" cellpadding="1" width="100%" border="0">
                            <tr>
                                <td>
                                    <asp:Label runat="server" Text="AddressID" ID="label1"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox Width="200px" ID="AddressID" AutoCompleteType="Disabled" runat="server"
                                        Text='<%# Bind("AddressID") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Location Name
                                </td>
                                <td>
                                    <asp:TextBox Width="200px" ID="Address_Location_Name" AutoCompleteType="Disabled"
                                        runat="server" Text='<%# Bind("Address_Location_Name") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Line1
                                </td>
                                <td>
                                    <asp:TextBox Width="200px" ID="Address_Line1" AutoCompleteType="Disabled" runat="server"
                                        Text='<%# Bind("Address_Line1") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Line2
                                </td>
                                <td>
                                    <asp:TextBox Width="200px" ID="Address_Line2" AutoCompleteType="Disabled" runat="server"
                                        Text='<%# Bind("Address_Line2") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    City
                                </td>
                                <td>
                                    <asp:TextBox Width="200px" ID="Address_City" AutoCompleteType="Disabled" runat="server"
                                        Text='<%# Bind("Address_City") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    State
                                </td>
                                <td>
                                    <asp:TextBox Width="200px" ID="Address_State" AutoCompleteType="Disabled" runat="server"
                                        Text='<%# Bind("Address_State") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Country
                                </td>
                                <td>
                                    <asp:TextBox Width="200px" ID="Address_Country" AutoCompleteType="Disabled" runat="server"
                                        Text='<%# Bind("Address_Country") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Postal Code
                                </td>
                                <td>
                                    <asp:TextBox Width="200px" ID="Address_Postal_Code" AutoCompleteType="Disabled" runat="server"
                                        Text='<%# Bind("Address_Postal_Code") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="Button1" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                        CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                    </asp:Button>
                                    <asp:Button ID="Button2" runat="server" Text="Cancel" CausesValidation="false" CommandName="Cancel">
                                    </asp:Button>
                                </td>
                            </tr>
                        </table>
                    </FormTemplate>
                    <PopUpSettings Modal="True"></PopUpSettings>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
</asp:Content>


mohamed
Top achievements
Rank 1
 answered on 25 Apr 2011
2 answers
157 views
Hi,
I have implement full window of splitter control with update panel, it is working perfect in IE7 with update panel and without update panel.
But in firefox it is not working with Update panel,  it causes height problem, content is not viewable properly. When I remove update panel from page then it is working perfect. I have telerik version (2010.3.1109.20). Code is look like as below.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DefaultTesting.aspx.cs" Inherits="_DefaultTesting"
    EnableEventValidation="false" ValidateRequest="false" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
<html>
<head runat="server">
 <title>-:: ::-</title>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <style type="text/css">
        html, body, form
        {
            height: 100%;
            margin: 0px;
            padding: 0px;
            overflow: hidden;
        }
    </style>
</head>
<form id="form1" runat="server">
<div id="ParentDivElement" style="height: 100%;">
       <asp:ScriptManager runat="server" ID="RadScriptManager1">
        </asp:ScriptManager>
     <asp:UpdatePanel ID="updatePnl" runat="server">
            <ContentTemplate>
<telerik:RadSplitter ID="MainSplitter"  runat="server" Height="100%" Width="100%"
                    Orientation="Horizontal" Skin="Windows7" VisibleDuringInit="false" LiveResize="true">
                    <telerik:RadPane ID="TopPane" runat="server" Height="100" MinHeight="85" MaxHeight="150"
                        Scrolling="none">
                        <!-- Place the content of the pane here -->
                        header...........header...............header
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="RadsplitbarTop" runat="server" CollapseMode="Forward" Skin="Windows7" />
                    <telerik:RadPane ID="MainPane" runat="server" Scrolling="none" MinWidth="500">
                        <telerik:RadSplitter ID="NestedSplitter" runat="server" Skin="Windows7" ResizeWithParentPane="true" Height="100%" Width="100%">
                            <telerik:RadPane ID="LeftPane" runat="server" Width="200" MinWidth="150" MaxWidth="400">
                                <div style="float: left; margin-left: 10px;">
                                    <telerik:RadTreeView ID="tvNodes" runat="server" EnableDragAndDrop="True" ExpandAnimation-Type="OutExpo"
                                        ExpandAnimation-Duration="800" EnableDragAndDropBetweenNodes="true" CollapseAnimation-Type="OutElastic"
                                        CollapseAnimation-Duration="800">
                                        <ContextMenus>
                                            <telerik:RadTreeViewContextMenu ID="NodesTreeMenu" runat="server" CssClass="MenuGroup"
                                                Skin="Windows7">
                                                <CollapseAnimation Type="none" />
                                            </telerik:RadTreeViewContextMenu>
                                        </ContextMenus>
                                    </telerik:RadTreeView>
                                </div>
                            </telerik:RadPane>
                            <telerik:RadSplitBar ID="VerticalSplitBar" runat="server" CollapseMode="Forward" />
                            <telerik:RadPane ID="ContentPane" runat="server">
                                <div id="props">
                                    <div style="position: absolute; top: 300px; left: 750px; z-index: 999;">
                                        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updatePnl"
                                            DisplayAfter="1" DynamicLayout="true">
                                            <ProgressTemplate>
                                                <img border="0" alt="" src="Images/spinner2.gif" />
                                            </ProgressTemplate>
                                        </asp:UpdateProgress>
                                    </div>
                                    <div id="page-content">
                                        <asp:PlaceHolder ID="pnlSurvey" runat="server">
                                            <div>
                                                <asp:Button ID="btnSave" runat="server" OnClick="btnAddNode_Click" Text="Save" />
                                                &nbsp;
                                                <asp:Button ID="btnPublish" runat="server" OnClick="btnPublish_Click" Text="Publish" />
                                            </div>
                                            <div style="float: right">
                                                <p class="mt" id="testMT" runat="server">
                                                    <a href="javascript:" id="MenuEF" style="border: 0px; text-decoration: none;">
                                                        <img src="Images/settings.png" style="border: 0px; text-decoration: none" alt='Settings'></a>
                                                </p>
                                            </div>
                                            <div style="float: left">
                                               Content  Content  Content
                                            </div>
                                        </asp:PlaceHolder>
                                        <div>
                                            <asp:Button ID="btnBottomSave" runat="server" OnClick="btnAddNode_Click" Text="Save" />
                                            &nbsp;
                                            <asp:Button ID="btnBottomPublish" runat="server" OnClick="btnPublish_Click" Text="Publish" />
                                        </div>
                                        <br />                                     
                                    </div>
                                </div>
                            </telerik:RadPane>
                        </telerik:RadSplitter>
                    </telerik:RadPane>
                </telerik:RadSplitter>
</ContentTemplate>
        </asp:UpdatePanel>
    </div>
</form>
</body>
</html>


Kindly Help me out from this issue.

Thanks in Advance.
Sadiq Modan
Rumen
Telerik team
 answered on 25 Apr 2011
1 answer
183 views
Hi All,

 I am Using the below JS to Coverting SmallCase to UpperCase for textbox... Can u pls guide me
how to do the same thing for RadCombobox on KeyPressing...


function cUpper(cObj) {
            cObj.value = cObj.value.toUpperCase();
        }
  
aspx:
 <asp:TextBox ID="TextBox1" runat="server" OnKeyup="return cUpper(this)"></asp:TextBox>
 
<telerik:RadComboBox runat="server" EmptyMessage="Choose Port Cd." EnableLoadOnDemand="True"
           HighlightTemplatedItems="True" DropDownWidth="500px" Skin="Telerik" Height="150px"
            Width="150px" ID="Rc_prtcd" AutoPostBack="True" ShowMoreResultsBox="true"
              EnableVirtualScrolling="true">
                     <HeaderTemplate>
                                <table cellpadding="0" cellspacing="0" style="width: 100%">
                                    <tr>
                                        <td style="width: 100px;">
                                         Port Code
                                        </td>
                                        <td style="width: 200px;">
                                            Port Name
                                        </td>
                                         <td style="width: 200px;">
                                           Country Name
                                        </td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table cellpadding="0" cellspacing="0" style="width: 100%">
                                    <tr>
                                        <td style="width: 100px;">
                                            <%# DataBinder.Eval(Container, "Text")%>
                                        </td>
                                        <td style="width: 200px;">
                                            <%#DataBinder.Eval(Container, "Attributes['Port_Name']")%>
                                        </td>
                                        <td style="width: 200px;">
                                            <%#DataBinder.Eval(Container, "Attributes['Country_Name']")%>
                                        </td>
                                    </tr>
                                    <hr />
                                </table>
                            </ItemTemplate>
                            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                        </telerik:RadComboBox>
 


Thanks
Salvio
Shinu
Top achievements
Rank 2
 answered on 25 Apr 2011
2 answers
131 views
how to give heading on radgrid in top of the grid.
i show my form name in the radgrid
mohamed
Top achievements
Rank 1
 answered on 25 Apr 2011
1 answer
101 views
Hi,

I'm using a radcombobox within a edititemtemplate and I would like to get the selected item on the client side but no matter which technique I use I always recieve "Object expected error" or "Microsoft JScript runtime error: radcombobox1 is undefined". I'm new
to rad controls I've spent all day on this , I must be doing something wrong. Can you help?

Thanks,
Shinu
Top achievements
Rank 2
 answered on 25 Apr 2011
3 answers
157 views
Hi Expert,

             I want to get radDialog confirm result. I don't know how can i get it. I follow the site example, but before return result my button command is already fired it. i want to repalce below code with radDialog Confirm. Kindly, please advice to me.

<asp:ImageButton ID="_imgbtnNew" OnCommand="_imgbtnNew_Command" runat="server" ImageUrl="~/site_images/new.png"
ImageAlign="AbsMiddle" Height="15px" OnClientClick="javascript:return confirm('Are you sure?');" ></asp:ImageButton>


Best Regards,
ALEX
Top achievements
Rank 1
 answered on 25 Apr 2011
2 answers
151 views
I have a grid with detail table, I would like user to allow multiple parent rows, but only single row from detail table. Is that possible? I see that AllowMultiRowSelect is at Grid level, not table view level. So when I enable that, it allows selection of multiple rows on both parent and child rows.

At the same time, I want to allow user to select detail table row only if parent row is NOT slected and allow to select parent row only if child row is NOT selected. Is there a way to achieve this task?

thanks,
Sameers
Sameers
Top achievements
Rank 1
 answered on 24 Apr 2011
3 answers
138 views
My problem has a long description, hopefully the subject made enough sense. :) I have a datepicker control in the itemtemplate of the combobox, when the popup calendar goes away, the Combobox drop down gets a scroll bar. This only happens in chrome.

The RadComboBox is created as
<telerik:RadComboBox ID="cboDateRange" runat="server" width="175px"
    DropDownWidth="325px" CloseDropDownOnBlur="False" Font-Bold="True" 
    AllowCustomText="false">
    <ItemTemplate>
        <asp:Label ID="lblDateRange" runat="server" Text="Date Range" Font-Bold="true"></asp:Label><br />
        <div id="divStartDateSelected" class="divFloatLeft">
            <telerik:RadDatePicker ID="dateStartDate" runat="server" Width="90px" >
                <DateInput SelectionOnFocus="SelectAll">
                </DateInput>
                <Calendar ShowRowHeaders="false"></Calendar>
            </telerik:RadDatePicker>
        </div>
        <div class="divFloatLeft">
             <asp:Label ID="lblDateRangeDash" runat="server" Text="-"></asp:Label>  
        </div>
        <div id="divEndDateSelected" class="divFloatLeft">
            <telerik:RadDatePicker ID="dateEndDate" runat="server" Width="90px">
                <DateInput SelectionOnFocus="SelectAll">
                </DateInput>
                <Calendar ShowRowHeaders="false"></Calendar>
            </telerik:RadDatePicker>
        </div>
    </ItemTemplate>
    <Items>
        <telerik:RadComboBoxItem Text="" Selected="True" />
    </Items>
</telerik:RadComboBox>

I haven't had time to create a minimal project to dig into it more, but thought I'd post to see if there was any quick fixes or known problems. I'm running the latest release of Telerik and Chrome is 5.0.375.125.

Thanks
Thad
Top achievements
Rank 2
 answered on 23 Apr 2011
22 answers
410 views
I don't get the value in radgrid itemcomman how i pass in the need data soucrce
please replay as soon as possible




<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewModels.aspx.cs" Inherits="TBS_HelpDesk.Views.Assets.NewModels"
    MasterPageFile="~/Views/Shared/MasterPage.Master" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid runat="server" ID="RadGrid1" CellPadding="0" GridLines="None" AutoGenerateColumns="False"
        AllowPaging="True" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand">
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn DataField="Manuf_ID" DataType="System.Int32" HeaderText="Manuf ID"
                    SortExpression="Manuf_ID" UniqueName="Manuf_ID" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Manuf_Name" HeaderText="Manuf Name" SortExpression="Manuf_Name"
                    UniqueName="Manuf_Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Manuf_Description" HeaderText="Manuf Description"
                    SortExpression="Manuf_Description" UniqueName="Manuf_Description">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings EnablePostBackOnRowClick="true">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
    </telerik:RadGrid>
    <telerik:RadGrid runat="server" ID="RadGrid2" CellPadding="0" GridLines="None" AutoGenerateColumns="False"
        AllowPaging="True" Skin="WebBlue" OnItemCommand="RadGrid1_ItemCommand" OnNeedDataSource="RadGrid2_NeedDataSource">
        <MasterTableView CommandItemDisplay="Top" EditFormSettings-PopUpSettings-Modal="true"
            EditMode="PopUp">
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                <telerik:GridNumericColumn DataField="Model_ID" HeaderText="Model Id" SortExpression="Model_ID"
                    UniqueName="Model_ID" Visible="false" ReadOnly="true">
                </telerik:GridNumericColumn>
                <telerik:GridBoundColumn DataField="Model_Name" HeaderText="Model Name" SortExpression="Model_Name"
                    UniqueName="Model_Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Model_Description" DataType="System.Boolean"
                    HeaderText="Model Description" SortExpression="Model_Description" UniqueName="Model_Description">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" UniqueName="DeleteColumn"
                    CommandArgument="Child" ConfirmDialogType="RadWindow" ConfirmText="Are You Sure Want To Delete This Record?"
                    ConfirmTitle="Delete Confirm" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>






using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;
using Telerik.Web.UI;
using System.Data.SqlClient;
using System.Configuration;


namespace TBS_HelpDesk.Views.Assets
{
    public partial class NewModels : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            //    LoadManufacturers();
            //}            
        }

        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            DataTable dtTable = new DataTable();
            string conn = ConfigurationManager.ConnectionStrings["TBSHelpDeskLiveDB_ConnectionString"].ToString();
            SqlDataAdapter sqladp = new SqlDataAdapter();
            SqlConnection sqlconn = new SqlConnection(conn);
            sqlconn.Open();

            try
            {
                string selectQuery = "SELECT Manuf_ID,Manuf_Name,Manuf_Description FROM [AssetManufacturers] order by Manuf_ID asc";
                sqladp.SelectCommand = new SqlCommand(selectQuery, sqlconn);
                sqladp.Fill(dtTable);
                RadGrid1.DataSource = dtTable;

            }
            finally
            {
                sqlconn.Close();
            }
        }

        protected void RadGrid2_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            SqlConnection connection = new SqlConnection(
         ConfigurationManager.ConnectionStrings["TBSHelpDeskLiveDB_ConnectionString"].ConnectionString);

            SqlDataAdapter adapter = new SqlDataAdapter("SELECT Model_ID,Model_Name,Model_Description FROM " +
                " AssetModels WHERE Model_Manuf_ID =  ", connection);
            DataTable dt = new DataTable();
            adapter.Fill(dt);
            RadGrid2.DataSource = dt;
        }


        protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "RowClick")
            {
                GridDataItem item = (GridDataItem)e.Item;
                string Manuf_ID = item["Manuf_ID"].Text;
                LoadModels(Manuf_ID);
            }
        }
        protected void LoadModels(string Manuf_ID)
        {
            SqlConnection connection = new SqlConnection(
      ConfigurationManager.ConnectionStrings["TBSHelpDeskLiveDB_ConnectionString"].ConnectionString);

            SqlDataAdapter adapter = new SqlDataAdapter("SELECT Model_ID,Model_Name,Model_Description FROM " +
                " AssetModels WHERE Model_Manuf_ID=@Manuf_ID ORDER By Model_Manuf_ID,Model_ID", connection);
            adapter.SelectCommand.Parameters.AddWithValue("@Manuf_ID", Manuf_ID);
            DataTable dt = new DataTable();
            adapter.Fill(dt);
            RadGrid2.DataSource = dt;
            RadGrid2.DataBind();
        }
    }
}
mohamed
Top achievements
Rank 1
 answered on 23 Apr 2011
1 answer
57 views
I have a radgrid that i am trying to customize using properties like backcolor.
I changed the backcolor of my header to be red (#E31B23) in both the mastertableview and the main grid properties; on the design view in visual studio the color is changed, but once i try to see the change in the browser the color is not there.

Same thing when i change the skin of the grid: in visual studio i see the change of skin, but once i go live in a browser, nothing is changed. Please help. 
Pavlina
Telerik team
 answered on 22 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?