Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
150 views
I am using Rad Editor on my xyz.aspx page inside Rad Panes. I am setting the Rad Editor height to 100% but its not having any effect. If I give height in pixel than its getting effect. But I can't use pixel as the user may change browser size, so its better to use percentage.

HELP!!!!!!
Rumen
Telerik team
 answered on 26 Jan 2012
5 answers
161 views
I am creating the OrgChart using the demos found and i have come to a style issue with the second and subsequent rows for a group.  When i set the DisableDefaultImage to true the subsequent rows are still showing the placeholder for the image.  Is there something wrong in my code?  Please review:

<telerik:RadOrgChart ID="radOrgChart" runat="server" GroupColumnCount="4" DisableDefaultImage="true" Skin="Sitefinity">
    <RenderedFields>
        <ItemFields>
            <telerik:OrgChartRenderedField DataField="FullName"/>
            <telerik:OrgChartRenderedField DataField="Title" />
            <telerik:OrgChartRenderedField DataField="ProfileLink" />
        </ItemFields>
    </RenderedFields>
</telerik:RadOrgChart>
//Table to define the nodes
DataTable nodeTable = new DataTable();
nodeTable.Columns.Add("ID");
nodeTable.Columns.Add("ManagerID");
 
//Table to hold the data for the items
DataTable itemsTable = new DataTable();
itemsTable.Columns.Add("NodeID");
itemsTable.Columns.Add("ID");
itemsTable.Columns.Add("FullName");
itemsTable.Columns.Add("Title");
itemsTable.Columns.Add("ProfileLink");
 
//Get Contacts Manager
var tmpCM = ContactMgr.GetContactByID(ContactToDisplay.ManagerID);
 
//Get Contacts Managers manager
var tmpCMM = ContactMgr.GetContactByID(tmpCM.ManagerID);
 
//Get Contacts Managers employees
var tmpCME = ContactMgr.GetEmployeesByManagerID(tmpCM.ID);
 
//Add the nodes to the nodesTable
nodeTable.Rows.Add(new string[] { "1", null});
nodeTable.Rows.Add(new string[] { "2", "1"});
nodeTable.Rows.Add(new string[] { "3", "2" });
 
//Add the details of the employees to the itemTable
itemsTable.Rows.Add(new string[] { "1", tmpCMM.ID.ToString(), "<b>" + tmpCMM.FullName + "</b>", tmpCMM.Title, "<a href='/contacts/detail.aspx?id=" + tmpCMM.ID + "'>View Details</a>" });
itemsTable.Rows.Add(new string[] { "2", tmpCM.ID.ToString(), "<b>" + tmpCM.FullName + "</b>", tmpCM.Title,  "<a href='/contacts/detail.aspx?id=" + tmpCM.ID + "'>View Details</a>" });
foreach (Directory_BO.Contact tmpC in tmpCME)
    itemsTable.Rows.Add(new string[] { "3", tmpC.ID.ToString(), "<b>" + tmpC.FullName + "</b>", tmpC.Title,  "<a href='/contacts/detail.aspx?id=" + tmpC.ID + "'>View Details</a>" });
 
//Setup the relationships within the OrgChart
radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "ID";
radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "ManagerID";
radOrgChart.GroupEnabledBinding.NodeBindingSettings.DataSource = nodeTable;
 
radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "NodeID";
radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "ID";
radOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataSource = itemsTable;
 
//Bind the OrgChart
radOrgChart.DataBind();
Chris Salas
Top achievements
Rank 1
 answered on 26 Jan 2012
1 answer
68 views
We are having a problem with Rad Editor in DotNetNuke 6. The media manager calls up a dialog box for selecting the file you want, but the file system is completely unpopulated--no files or file folders appear and all three columns of the manager are empty. Clicking the "refresh" button does nothing. Any idea what might be going on and how we could fix it?

Thanks

Colin Moser
The Corymb Group, LLC
Richard
Top achievements
Rank 1
 answered on 26 Jan 2012
2 answers
119 views
I've tried setting: ContentFilters="None" and it still happens.
I can reproduce this on your "First Look" demo too.

Just open Notepad or something and create a document with some spaces like this:

Line 1
Line 2

Line 4

Line 6

Line 8
Line 9


Then use "CTRL+A" to select, CTRL+C to copy and then paste that into the RadEditor.
All the line breaks get doubled.
Help!!!!
Sam
Top achievements
Rank 1
 answered on 26 Jan 2012
16 answers
234 views
Dear All,

I have 3 tabs in a tab strip and 3 multi page views. inside these multi page views are three tables i.e. code of three pages one by one.

First multipageview contains a form with a few text fields etc. When I use validation controls, like required field validation, on first tab's form it do not allow me to go to the next tab untill the validation is done on the form. I want it to go to next tab without validation. or in other words I want it to do validation only on the button clicked on respective tab, not when a tab is clicked.

Please help.
Toboy
Top achievements
Rank 1
 answered on 26 Jan 2012
1 answer
226 views
Hi guys.

I have been trying a lot of ways to fix this issue but it seems to be impossible.
I am developing a web app whit 3.5 framework ant telerik controls version 2009.3.1314.0. I have a Main page that uses a Master page and from javascript I open a radWindow that is set to modal. When the modal window is opening for the first time the loading circle icon appears but when I save the form in the modal window no icon appears.
This is an example of my code in main page:

<telerik:RadCodeBlock ID="RadCodeBlockBoleta" runat="server">
     <script type="text/javascript">
            function OpenDetail(cod1, cod2, action) {
  
                    var wnd = window.radopen('<%= ConfigurationManager.AppSettings["AppWeb"] %>Posicion/NewDetails.aspx?cti=' + cod1+ "&nb=" + cod2+ "&action=" + action, "DetailsPage");
                    wnd.set_modal(true);
                    wnd.set_autoSize(false);
                    wnd.setSize(1100, 380);
                    wnd.set_visibleStatusbar(false);
                    wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move);
                    wnd.center();
                    return false;
            }
    </script>
</telerik:RadCodeBlock>


Now, NewDetails.aspx is a RadWindow form that uses another Master Page (MasterModal.Master). The ASPX code from that MasterModal.Master is:
 
<html>
<body class="BodyModal" style="background-color: #ebf4f7; position:relative; " >
    <form id="form1" runat="server" >
    <asp:HiddenField runat="server" ID="opSalir" Value="" />
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <telerik:RadAjaxPanel ID="RadAjaxPanelMessage" runat="server" EnableEmbeddedScripts="true">
    </telerik:RadAjaxPanel>
    <div style="text-align: center; width: 100%">
        <div style="text-align: left; ">
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            </asp:ContentPlaceHolder>
        </div>
    </div>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
        <telerik:RadWindow ID="rwConfirm" runat="server" OnClientClose="OnClientClose" Title="Confirmación" ReloadOnShow="true"
                ShowContentDuringLoad="true" Modal="true" AutoSize="true" VisibleStatusbar="false"
                Behaviors="Close" VisibleTitlebar="true" KeepInScreenBounds="True" PreventClientCache="true"
                DestroyOnClose="true">
        </telerik:RadWindow>
               <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" 
            ReloadOnShow="true"  ShowContentDuringLoad="false" Modal="true"/>
           <telerik:RadWindow ID="RadFavoritoCampo" runat="server" OnClientClose="OnClientClose" Title="Campos" ReloadOnShow="true"
                ShowContentDuringLoad="false" Modal="true">
        </telerik:RadWindow>
        <telerik:RadWindow ID="RadEmpresa" runat="server" OnClientClose="OnClientClose" Title="Empresa" ReloadOnShow="true"
                ShowContentDuringLoad="false" Modal="true">
        </telerik:RadWindow>
  
         <telerik:RadWindow ID="RadTest" runat="server" OnClientClose="OnClientClose" Title="Test" ReloadOnShow="true"
                ShowContentDuringLoad="false" Modal="true">
        </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    </form>
</body>
</html>

And finally, the ASPX code in NewDetail.aspx is
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1"></telerik:RadAjaxManager>
<asp:Panel runat="server" ID="Panel1" >
  
<div>
   //SOME HTML with textboxes, labels, etc
    <asp:Button ID="BtnSave" runat="server" Text="Save" Width="100px" style="left:760px; top: 310px; position: absolute;"
                  CssClass="cssBoton" onclick="BtnSave_Click" />
               
     <input id="BtnExit" class="cssBoton" title="Exit" type="button" style="left:870px; top: 310px; position: absolute;width: 100px" value="Exit" onclick="return BtnExit_onclick()" />
</div>
</asp:Panel>
  
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue">
</telerik:RadAjaxLoadingPanel>
  
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="BtnSave">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
</asp:Content>

this piece of code <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1"></telerik:RadAjaxManager> is causing a javascript error in this line : c.get_request()._get_eventHandlerList()._list.completed.reverse();
If I remove the RadAjaxManager tag everything works without showing the loading icon. With the RadAjaxManager code the javascript error occurs.

Any Ideas?

Thank you very much.
Iana Tsolova
Telerik team
 answered on 26 Jan 2012
2 answers
157 views
I have a web application how use telerik rad controls. Every pages how contains rad controls runs very slow. I don't understand Why. 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HistoricoEncomendas.aspx.cs" Inherits="Hnrypharma.UI.Encomendas.HistoricoEncomendas" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!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>
    <link href="../Styles/Styles.css" rel="Stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.7.min.js" type="text/javascript"></script> 
    <script src="../Scripts/jquery-ui.js" type="text/javascript"></script>
</head>
<body>
<script type="text/javascript">
    $(document).ready(function () {
        $(window).resize(function () {
            $('.EncomendasCentro').css({
                position: 'absolute',
                left: ($(window).width() - $('.EncomendasCentro').outerWidth()) / 2,
                top: ($(window).height() - $('.EncomendasCentro').outerHeight()) / 2
            });
        });


        // To initially run the function:
        $(window).resize();


    });
</script>
    <form id="form1" runat="server">
    <div class="EncomendasCentro">
    <div style="text-align:center; width:100%;">
        <asp:Label ID="Label1" runat="server" Text="Historico de movimentos de encomendas" CssClass="titulo"></asp:Label>
        </div>
        <table>
            <tr>
                
                <td>
                    <asp:Label ID="Label2" runat="server" Text="Pesquisar"></asp:Label>
                </td>
                <td>
                    <telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true" runat="server" Width="250px"
                            Height="200px" DataTextField="nome" DataValueField="ID"
                            EmptyMessage="Escreva o nome do Cliente..."
                            onitemdatabound="RadComboBox1_ItemDataBound1" >
                    </telerik:RadComboBox>
                    <telerik:RadComboBox ID="RadEditCod" AllowCustomText="true" runat="server" Width="80px"
                            Height="200px" DataTextField="Cod" DataValueField="ID"
                            EmptyMessage="Cod..." 
                            onitemdatabound="RadEditCod_ItemDataBound" DropDownWidth="400px" >
                    </telerik:RadComboBox>
                   <telerik:RadDateInput ID="RadDateInput1" runat="server" Width="200px" Culture="pt-PT">
                    </telerik:RadDateInput>
                </td>
                <td>
                <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                        RepeatDirection="Horizontal" AutoPostBack="True">
                <asp:ListItem Text="Produto" Value="1" Enabled="true" Selected=True></asp:ListItem>
                <asp:ListItem Text="CLiente" Value="2" Enabled="true"></asp:ListItem>
                <asp:ListItem Text="Data" Value="3" Enabled="true"></asp:ListItem>


                
                </asp:RadioButtonList>
                </td>
                <td>
                   <telerik:RadButton ID="btProcurar" runat="server" Width="139px" Height="26px" 
                            Text="Procurar" ForeColor="White" HoveredCssClass="goButtonClassHov" 
                        onclick="btProcurar_Click">
                        <Image ImageUrl="~/Images/botao_azul.jpg" IsBackgroundImage="true" />
                        </telerik:RadButton>
                </td>


            </tr>
        </table>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <!-- content start -->
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" Width="95%" ShowStatusBar="true"
            AutoGenerateColumns="False" PageSize="7" AllowSorting="True" AllowMultiRowSelection="False"
            AllowPaging="True" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
            OnNeedDataSource="RadGrid1_NeedDataSource" OnPreRender="RadGrid1_PreRender">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView Width="100%" DataKeyNames="cabecid" AllowMultiColumnSorting="True">
                <DetailTables>
                    <telerik:GridTableView  Name="Linhas" Width="100%">
                        <Columns>


                            <telerik:GridBoundColumn SortExpression="Cod" HeaderText="Cod" HeaderButtonType="TextButton"
                                DataField="Cod" UniqueName="Cod">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Cedime" HeaderText="Cedime" HeaderButtonType="TextButton"
                                DataField="Cedime" UniqueName="Cedime">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="descricao" HeaderText="descricao" HeaderButtonType="TextButton"
                                DataField="descricao" UniqueName="descricao">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="QT" HeaderText="QT" HeaderButtonType="TextButton"
                                DataField="QT" UniqueName="QT">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Bonus" HeaderText="Bonus" HeaderButtonType="TextButton"
                                DataField="Bonus" UniqueName="Bonus">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="D.Fin" HeaderText="D.Fin" HeaderButtonType="TextButton"
                                DataField="D.Fin" UniqueName="D.Fin">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Preco" HeaderText="Preço" HeaderButtonType="TextButton"
                                DataField="Preco" UniqueName="Preco">
                            </telerik:GridBoundColumn>


                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="cabecid" HeaderText="cabecid" HeaderButtonType="TextButton"
                        DataField="cabecid" Visible=false>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Codigo" HeaderText="Cod Enc" HeaderButtonType="TextButton"
                        DataField="Codigo">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Data" HeaderText="Data" HeaderButtonType="TextButton"
                        DataField="Data">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Cliente" HeaderText="Cliente" HeaderButtonType="TextButton"
                        DataField="Cliente">
                        </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Localidade" HeaderText="Localidade" HeaderButtonType="TextButton"
                        DataField="Localidade">
                        </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="Expedidor" HeaderText="Expedidor" HeaderButtonType="TextButton"
                        DataField="Expedidor">
                        </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <table width="100%">
            <tr>
                <td align="right">
                 <telerik:RadButton ID="RadVoltar" runat="server" Width="139px" Height="26px" 
                            Text="Voltar"
                        ForeColor="White" HoveredCssClass="goButtonClassHov" 
                        onclick="RadVoltar_Click">
                        <Image ImageUrl="~/Images/botao_azul.jpg" IsBackgroundImage="true" />
                    </telerik:RadButton>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>


Veli
Telerik team
 answered on 26 Jan 2012
1 answer
96 views
What is the easiest way to do the following in a RadGrid control (if there is an example online anywhere this would be perfect)?

I have 2 database tables, customer and country with the following fields:

Customer table
Customer Name
Country ID
Customer ID

Country Table
Country ID
Country Name

I would like a grid to display the following columns.

Customer Name, Country Name, <Edit Link>

When you edit (or add a new row), there should be a text box to enter the customer name, and a drop down box for countries listing all the country names.  I am using Entity Framework to connect to a SQL server database.

Kind Regards
Richard Jonas
Richard
Top achievements
Rank 1
 answered on 26 Jan 2012
2 answers
267 views
Hi there, I am using a fullscreen splitter with three panes, without splitbars. If I resize the browser window the splitter resizes just fine.
Now I need to change the height of the top pane according to the user clicking on a button, using javascript.
I use splitter.getStartPane().set_height to set the height, and it works, BUT then the splitter doesn't fill the screen anymore. So, if I change the height from 100 to 50 pixels, an empty 50 pixels tall area appears below the end pane.
I tried using splitter.repaint() and splitter.set_height($(window).height()) without success.
I also tried $(window).trigger("resize") just because resizing the window soon after setting the height does the trick, but it doesn't work via code.
Any idea?
Thanks
Dobromir
Telerik team
 answered on 26 Jan 2012
2 answers
99 views

I am facing a wierd issue. I am  currently working on a project which develop usercontrol----> webpart---->deploy to sharepoint. There is one page using  radgrid to display some information which has four filter columns, except the default buildin filter ,I also built my own filter fanction which implement the filter function by hitting the enter key.Everthing is fine when it runs in asp.net ,but when it was deployed to sharepoint site, the filter can work for the first two filters only.In the third filtering,the var grid=$find(gridid) return null. the code  snippet as following:

 

<script type="text/javascript">
  
  
  
function doFilter(sender, eventArgs, gridId, uniqueName, curFunction) {
  
if (eventArgs.keyCode == 13) {
  
eventArgs.cancelBubble = true;
  
eventArgs.returnValue = false;
  
if (eventArgs.stopPropagation) {
  
eventArgs.stopPropagation();
  
eventArgs.preventDefault();
  
}
  
var masterTableView = $find(gridId).get_masterTableView();
  
var filterFun;
  
switch (curFunction) {
  
case 'Contains':
  
filterFun = Telerik.Web.UI.GridFilterFunction.Contains;
  
break;
  
case 'DoesNotContain':
  
filterFun = Telerik.Web.UI.GridFilterFunction.DoesNotContain;
  
break;
  
case 'StartsWith':
  
filterFun = Telerik.Web.UI.GridFilterFunction.StartsWith;
  
break;
  
case 'EndsWith':
  
filterFun = Telerik.Web.UI.GridFilterFunction.EndsWith;
  
break;
  
case 'EqualTo':
  
filterFun = Telerik.Web.UI.GridFilterFunction.EqualTo;
  
break;
  
case 'NotEqualTo':
  
filterFun = Telerik.Web.UI.GridFilterFunction.NotEqualTo;
  
break;
  
case 'GreaterThan':
  
filterFun = Telerik.Web.UI.GridFilterFunction.GreaterThan;
  
break;
  
case 'LessThan':
  
filterFun = Telerik.Web.UI.GridFilterFunction.LessThan;
  
break;
  
case 'GreaterThanOrEqualTo':
  
filterFun = Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo;
  
break;
  
case 'LessThanOrEqualTo':
  
filterFun = Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo;
  
break;
  
case 'Between':
  
filterFun = Telerik.Web.UI.GridFilterFunction.Between;
  
break;
  
case 'NotBetween':
  
filterFun = Telerik.Web.UI.GridFilterFunction.NotBetween;
  
break;
  
case 'IsEmpty':
  
filterFun = Telerik.Web.UI.GridFilterFunction.IsEmpty;
  
break;
  
case 'NotIsEmpty':
  
filterFun = Telerik.Web.UI.GridFilterFunction.NotIsEmpty;
  
break;
  
case 'IsNull':
  
filterFun = Telerik.Web.UI.GridFilterFunction.IsNull;
  
break;
  
case 'NotIsNull':
  
filterFun = Telerik.Web.UI.GridFilterFunction.NotIsNull;
  
break;
  
default:
  
filterFun = Telerik.Web.UI.GridFilterFunction.EqualTo;
  
}
  
if (sender.value == "")
  
filterFun = Telerik.Web.UI.GridFilterFunction.NoFilter;
  
if (masterTableView !=null)
  
masterTableView.filter(uniqueName, sender.value, filterFun);
  
return false;
  
}
  
}
  
  
  
</script>
  
  
  
  
<telerik:RadGrid ID="RGrid_LocateAsset" runat="server" AutoGenerateColumns="False"
  
GridLines="None" AllowFilteringByColumn="True" AllowSorting="True" Skin="Sunset"
  
AllowPaging="True" EnableViewState="true" OnNeedDataSource="RGridNeedDataSource">
  
<GroupingSettings CaseSensitive="False" />
  
<MasterTableView EnableColumnsViewState="true">
  
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
  
<HeaderStyle Width="20px"></HeaderStyle>
  
</RowIndicatorColumn>
  
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
  
<HeaderStyle Width="20px"></HeaderStyle>
  
</ExpandCollapseColumn>
  
<Columns>
  
<telerik:GridBoundColumn AllowFiltering="False" DataField="MakeModelName" FilterControlAltText="Filter column column"
  
HeaderText="Model" UniqueName="MakeModelName" HeaderStyle-Width="75px">
  
</telerik:GridBoundColumn>
  
<telerik:GridBoundColumn AllowFiltering="False" DataField="AssetInstanceSerial" FilterControlAltText="Filter column1 column"
  
HeaderText="Serial #" UniqueName="AssetInstanceSerial" HeaderStyle-Width="75px">
  
</telerik:GridBoundColumn>
  
<telerik:GridBoundColumn AllowFiltering="False" DataField="UDI" FilterControlAltText="Filter column2 column"
  
HeaderText="UDI" UniqueName="UDI">
  
</telerik:GridBoundColumn>
  
<telerik:GridBoundColumn AllowFiltering="False" DataField="RFIDTagNumber" FilterControlAltText="Filter column7 column"
  
HeaderText="RFID Tag#" UniqueName="RfidTagNumber" HeaderStyle-Width="75px">
  
</telerik:GridBoundColumn>
  
<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn3 column"
  
DataField="AssetStatus" CurrentFilterFunction="EqualTo" HeaderText="Status" UniqueName="statusname">
  
<ItemTemplate>
  
<div id="GridColumn">
  
<%# (string.IsNullOrEmpty(Eval("AssetStatus").ToString()) ? "Asset Status not available" : Eval("AssetStatus"))%>
  
</div>
  
</ItemTemplate>
  
</telerik:GridTemplateColumn>
  
<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn2 column"
  
DataField="floorname" CurrentFilterFunction="EqualTo" HeaderText="Floor" UniqueName="FloorName">
  
<ItemTemplate>
  
<div id="GridColumn">
  
<%# (string.IsNullOrEmpty(Eval("FloorName").ToString()) ? "Location not available" : Eval("FloorName"))%>
  
</div>
  
</ItemTemplate>
  
</telerik:GridTemplateColumn>
  
<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="Unit"
  
DataField="UnitName" CurrentFilterFunction="EqualTo" UniqueName="UnitName">
  
<ItemTemplate>
  
<div id="GridColumn">
  
<%# (string.IsNullOrEmpty(Eval("UnitName").ToString()) ? "Location not available" : String.Format(@"<a href='" + FloorPlanURL + "?TagID={0}&HospitalSite={1}&selectedAssetKeys={3}' >{2}</a>", Eval("RFIDTagNumber").ToString(), Eval("HospitalGlnId").ToString(), Eval("UnitName").ToString(), AssetIDS))%>
  
  
</div>
  
</ItemTemplate>
  
</telerik:GridTemplateColumn>
  
<telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn1 column"
  
DataField="RoomName" CurrentFilterFunction="EqualTo" HeaderText="Room" UniqueName="RoomName">
  
<ItemTemplate>
  
<div id="GridColumn">
  
<%# (string.IsNullOrEmpty(Eval("RoomName").ToString()) ? "Location not available" : Eval("RoomName"))%>
  
</div>
  
</ItemTemplate>
  
</telerik:GridTemplateColumn>
  
</Columns>
  
<EditFormSettings>
  
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
  
</EditColumn>
  
</EditFormSettings>
  
</MasterTableView>
  
<FilterMenu EnableImageSprites="False">
  
</FilterMenu>
  
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
  
</HeaderContextMenu>
  
</telerik:RadGrid>
  
  
//code behide
  
  
protected void RGridNeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
  
{
  
  
GetURLParamete();
  
  
string currentHospitalGLNID = GetPersistedObject(PersistentObjectType.HospitalGLNID).ToString();
  
EntityCollection<AssetLocationViewEntity> assetLocationView= LocateAssetPresenter.GetAllAssetLocation(currentHospitalGLNID, assetIDs, filterName, filterValue);
  
RGrid_LocateAsset.DataSource = assetLocationView;
  
RGrid_LocateAsset.ItemCreated += new GridItemEventHandler(RGrid_LocateAsset_ItemCreated);
  
  
}
  
  
protected void RGrid_LocateAsset_ItemCreated(object sender, GridItemEventArgs e)
  
{
  
if (e.Item is GridFilteringItem)
  
{
  
GridFilteringItem fltItem = e.Item as GridFilteringItem;
  
foreach (GridColumn column in RGrid_LocateAsset.Columns)
  
{
  
//Filter out non-data or non-filter columns
  
  
if (column.ColumnType == "GridTemplateColumn")
  
{
  
GridTemplateColumn bndcol = (GridTemplateColumn)column;
  
if (bndcol.AllowFiltering == true)
  
{
  
  
TextBox txtbox = fltItem[column.UniqueName].Controls[0] as TextBox;
  
var currentFilter = column.CurrentFilterFunction;
  
if (txtbox != null)
  
txtbox.Attributes.Add("onkeydown", String.Format("doFilter(this, event, \"{0}\", \"{1}\", \"{2}\");", RGrid_LocateAsset.ClientID, column.UniqueName, currentFilter));
  
}
  
}
  
}
  
}
  
}

 

 

Marin
Telerik team
 answered on 26 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?