Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
366 views
I have a grid with a GridDropDownColumn.  EditMode is "InPlace".  On Insert I want to access the GridDropDownColumn...no problem there..but when the Grid is in Edit mode I want to disable the dropdown.  How do I go about doing this?
Thanks,
Larry
Ravi Kumar Kamboj
Top achievements
Rank 1
 answered on 11 Nov 2010
3 answers
100 views
Hi,

I've found this sample for filtering with a single button click (http://www.telerik.com/community/code-library/aspnet-ajax/grid/single-filter-button-for-all-columns-in-radgrid.aspx) It use the FilterExpression of MasterTableView. Is it possible to achieve the same thing without the FilterExpression by using the default filter functionality? I have a grid with different types of columns. Some are of type GridBiund some of type GridDateTime and some of type GridNumeric. In condition of column type I'd like to set the CurrentFilterFuction to Contains or EqualTo. I would like to do something like this: If column is of type GridBoundColumn then set Contains, if it is a DateTime column then set EqualTo. And a base requirement is to persist the entries in the filter boxes.

Thanks
Martin
Telerik team
 answered on 11 Nov 2010
1 answer
175 views
HI there
I would like to get result from server side managed code from radwindow and based on that display message on parent .aspx form.
you have demo example but its for client side.

please advise
Shinu
Top achievements
Rank 2
 answered on 11 Nov 2010
1 answer
183 views
Hi,

Is it possible to deselect nodes when a user clicks outside the RadTreeView?

Thanks,
- J
Shinu
Top achievements
Rank 2
 answered on 11 Nov 2010
10 answers
421 views
I am have a few issues trying to get a tabstrip to work with a local IFrame on the page.  According to the documentation, if you want to use a Templated Tab then you must perform a databind on the control.  However, what I have noticed is that after I perform a databind, my tab no longer loads the contents according to the Target and NavigationUrl I've specified.  I've also tried using a Hyperlink in my template as well and I could not seem to get this to work. 

I'm sure I'm missing something but I can't figure it out.

Here is the code for the page and code behind...
------------------------- Page ----------------

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
   
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
   
    </div>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server">
        <Tabs>
           
        </Tabs>
        <TabTemplate>
        <table>
        <tr>
            <td>
                <asp:HyperLink ID="HyperLink1" Target="IFrm1" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "Url") %>' Text='<%# DataBinder.Eval(Container.DataItem, "Text") %>' runat="server">HyperLink</asp:HyperLink>
               
            <td>
                <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="pushpin.gif"/></td>
        </tr>
        </table>       

 </TabTemplate>

    </telerik:RadTabStrip>
    <iframe name="IFrm1" style="width: 1017px; height: 595px"></iframe>
    </form>
</body>
</html>


------------------ Code Behind  ------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadTabStrip1.DataTextField = "Text";
            RadTabStrip1.DataNavigateUrlField = "Url";
            RadTabStrip1.DataFieldID = "ID";
            RadTabStrip1.DataFieldParentID = "ParentID";
            RadTabStrip1.DataSource = GenerateSiteData();
            RadTabStrip1.DataBind();

        }
    }

    private ArrayList GenerateSiteData()
    {
        ArrayList siteData = new ArrayList();
        //siteData.Add(new SiteDataItem(1, null, "All Sites", ""));
        //siteData.Add(new SiteDataItem(2, 1, "Search Engines", ""));
        //siteData.Add(new SiteDataItem(3, 1, "News Sites", ""));
        siteData.Add(new SiteDataItem(4, 2, "Yahoo", "http://www.yahoo.com"));
        siteData.Add(new SiteDataItem(5, 2, "MSN", "http://www.msn.com"));
        siteData.Add(new SiteDataItem(6, 2, "Google", "http://www.google.com"));
        siteData.Add(new SiteDataItem(7, 3, "CNN", "http://www.cnn.com"));
        siteData.Add(new SiteDataItem(8, 3, "BBC", "http://www.bbc.co.uk"));
        siteData.Add(new SiteDataItem(9, 3, "FOX", "http://www.foxnews.com"));
        return siteData;
    }

}

public class SiteDataItem
{
    private string _text;
    private string _url;
    private int _id;
    private int _parentId;
    public string Text
    {
        get { return _text; }
        set { _text = value; }
    }
    public string Url
    {
        get { return _url; }
        set { _url = value; }
    }
    public int ID
    {
        get { return _id; }
        set { _id = value; }
    }
    public int ParentID
    {
        get { return _parentId; }
        set { _parentId = value; }
    }
    public SiteDataItem(int id, int parentId, string text, string url)
    {
        _id = id;
        _parentId = parentId;
        _text = text;
        _url = url;
    }
    public static List<SiteDataItem> GetSiteData()
    {
        List<SiteDataItem> siteData = new List<SiteDataItem>();
        siteData.Add(new SiteDataItem(1, 0, "All Sites", ""));
        siteData.Add(new SiteDataItem(2, 1, "Search Engines", ""));
        siteData.Add(new SiteDataItem(3, 1, "News Sites", ""));
        siteData.Add(new SiteDataItem(4, 2, "Yahoo", "http://www.yahoo.com"));
        siteData.Add(new SiteDataItem(5, 2, "MSN", "http://www.msn.com"));
        siteData.Add(new SiteDataItem(6, 2, "Google", "http://www.google.com"));
        siteData.Add(new SiteDataItem(7, 3, "CNN", "http://www.cnn.com"));
        siteData.Add(new SiteDataItem(8, 3, "BBC", "http://www.bbc.co.uk"));
        siteData.Add(new SiteDataItem(9, 3, "FOX", "http://www.foxnews.com"));
        return siteData;
    }
}

 

vivek
Top achievements
Rank 1
 answered on 11 Nov 2010
2 answers
189 views
is it possible to have a confirmation popup on a particular menu item click?
I need to perform some server side coding when this particular menu item is clicked, and i need user to confirm this before proceeding to my logic.
thanks in advance
sf
Top achievements
Rank 1
 answered on 11 Nov 2010
3 answers
234 views
Hi there, I'm having a problem with rad tab and window.
One window opens another window in it and the issue is the inner window doesn't show on the taskbar.

/* This is the source */
 
function GetRadWindow() {
 var oWindow = null;
 if (window.radWindow)
   oWindow = window.radWindow;
 else if (window.frameElement.radWindow)
   oWindow = window.frameElement.radWindow;
 return oWindow;
}
 
/* opening new window*/
  var urlvalue = 'www.google.com?id='21312';
  oBrowserWnd = GetRadWindow().BrowserWindow;
  var oManager = GetRadWindow().get_windowManager();
  var otabStrip = GetRadWindow().correspondingTabStrip;
  oManager.open(urlvalue, null);
  oManager.maximizeAll();
 
/* adding tab. this not working correctly I think*/
otabStrip.trackChanges();
var tab = new Telerik.Web.UI.RadTab();
tab.set_text('a');
oWnd.correspondingTab = tab;
otabStrip.get_tabs().add(tab);
otabStrip.repaint();
tab.correspondingWnd = oWnd;
tab.set_imageUrl(item.get_imageUrl());
otabStrip.commitChanges();
tab.select();


Shinee
Top achievements
Rank 1
 answered on 11 Nov 2010
2 answers
118 views

Hi,

RadGrid has a dynamic float column. Some of its values are getting converted incorrectly to datetime (e.g.: 11.9 to 11/09/2010). May I know if there's a way to prevent this without having to go by column name?

Here's the definition of radgrid in the page:
 

  <telerik:RadGrid ID="grdReportData" runat="server" PageSize="20" AllowSorting="True"

                    AllowPaging="True" AutoGenerateColumns="True" CssClass="grid" ClientSettings-Resizing-AllowColumnResize="true"

                    ClientSettings-Resizing-ResizeGridOnColumnResize="true" ShowFooter="true">

                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
 
                    <MasterTableView Width="100%" TableLayout="Fixed">
                            <NoRecordsTemplate>
                             No records exist for the given criteria.

                            </NoRecordsTemplate>  

                    </MasterTableView>
                </telerik:RadGrid>

Any help is appreciated.
Regards,
Mohan.

 

 

 

 

 

 

 

 

 

Mohan Gali
Top achievements
Rank 1
 answered on 10 Nov 2010
1 answer
191 views
Hello,

I have a grid that I am exporting to ExcelML, when I export to standard Excel, all the columns export, but when I choose ML, only one column is exported, the Date Added Column. 

<telerik:RadGrid ID="gridConditions" runat="server" EnableTheming="False" Skin="WebBlue"
                        AllowPaging="True" AllowSorting="True" GridLines="Both" AutoGenerateColumns="False"
                        OnNeedDataSource="gridConditions_NeedDataSource" PageSize="15" OnItemDataBound="gridConditions_ItemDataBound"
                        ShowGroupPanel="false" AllowFilteringByColumn="false" OnCancelCommand="gridConditions_CancelCommand"
                        OnEditCommand="gridConditions_EditCommand" OnExcelMLExportRowCreated="gridConditions_ExcelMLExportRowCreated"
                        OnExcelMLExportStylesCreated="gridConditions_ExcelMLExportStylesCreated" OnItemCommand="gridConditions_ItemCommand">
                        <PagerStyle Mode="Slider" />
                        <ExportSettings IgnorePaging="true" OpenInNewWindow="true" FileName="ConditionsExport"
                            ExportOnlyData="true">
                            <Excel Format="ExcelML" />
                        </ExportSettings>
                        <MasterTableView NoMasterRecordsText="There are no conditions to display. If you applied filters, you may need to broaden your search."
                            CommandItemDisplay="Bottom">
                            <CommandItemTemplate>
                                <table width="100%">
                                    <tr>
                                        <td align="right">
                                            <asp:Button ID="ExportToExcelButton" runat="server" Width="100%" CommandName="ExportToExcel"
                                                Text="Export To Excel" />
                                        </td>
                                    </tr>
                                </table>
                            </CommandItemTemplate>
                            <ExpandCollapseColumn Visible="True">
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="ConditionId" SortExpression="ConditionId" UniqueName="ConditionId" Visible="False" />
                                <telerik:GridTemplateColumn HeaderStyle-Width="100px" HeaderText="Condition ID" SortExpression="ConditionIdentifier"
                                    DataField="ConditionIdentifier">
                                    <ItemTemplate>
                                        <asp:HyperLink CssClass="ConditionHyperLink" ID="EditLink" runat="server" Text='<%#Eval("ConditionIdentifier") %>'></asp:HyperLink>
                                    </ItemTemplate>
                                    <HeaderStyle Width="100px"></HeaderStyle>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn AllowSorting="False" DataField="Summary" HeaderText="Summary" UniqueName="Summary" FilterControlWidth="200px" />
                                <telerik:GridBoundColumn DataField="IdentifiedByFullName" HeaderStyle-Width="120px" HeaderText="Identified By" SortExpression="IdentifiedByLastName" UniqueName="IdentifiedByFullName" />
                                <telerik:GridDateTimeColumn DataField="DateCreated" HeaderStyle-Width="100px" HeaderText="Date Added" SortExpression="DateCreated" UniqueName="DateCreated" DataFormatString="{0:d}" />
                                <telerik:GridBoundColumn DataField="ConditionStatusName" HeaderStyle-Width="100px" HeaderText="Status" SortExpression="ConditionStatusName" UniqueName="ConditionStatusName" />
                                <telerik:GridDateTimeColumn DataField="ActualDueDate" HeaderStyle-Width="100px" HeaderText="Due Date" SortExpression="ActualDueDate" UniqueName="ActualDueDate" DataFormatString="{0:d}" EmptyDataText="Not Set" >
                                    <ItemStyle Font-Bold="True" ForeColor="Red" />
                                </telerik:GridDateTimeColumn>
                                <telerik:GridButtonColumn CommandName="Edit" HeaderText="Edit" UniqueName="Edit" HeaderStyle-Width="20px" Text="Edit" ButtonType="ImageButton" ItemStyle-HorizontalAlign="Center">
                                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                </telerik:GridButtonColumn>
                            </Columns>
                            
                        </MasterTableView>
                        <ClientSettings>
                            <Selecting AllowRowSelect="false" />
                        </ClientSettings>
                    </telerik:RadGrid>


Code behind for the export options:

bool isConfigured = false;
        protected void gridConditions_ExcelMLExportRowCreated(object sender, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e)
        {
            if(e.RowType == GridExportExcelMLRowType.HeaderRow)
            {
                gridConditions.Rebind();  //workaround to get the template column's content
            }
            if (e.RowType == GridExportExcelMLRowType.DataRow)
            {
                if (!isConfigured)
                {
                    //Set Worksheet name
                    e.Worksheet.Name = "Conditions List";
 
                    //Set Column widths
                    foreach (ColumnElement column in e.Worksheet.Table.Columns)
                    {
                        if (e.Worksheet.Table.Columns.IndexOf(column) == 2)
                            column.Attributes["ss:Width"] = "180"; //set width 180 to ProductName column
                        else
                            column.Attributes["ss:Width"] = "80"; //set width 80 to the rest of the columns
                    }
 
                    //Set Page options
                    PageSetupElement pageSetup = e.Worksheet.WorksheetOptions.PageSetup;
                    pageSetup.PageLayoutElement.IsCenteredVertical = true;
                    pageSetup.PageLayoutElement.IsCenteredHorizontal = true;
                    pageSetup.PageMarginsElement.Left = 0.5;
                    pageSetup.PageMarginsElement.Top = 0.5;
                    pageSetup.PageMarginsElement.Right = 0.5;
                    pageSetup.PageMarginsElement.Bottom = 0.5;
                    pageSetup.PageLayoutElement.PageOrientation = PageOrientationType.Landscape;
 
                    //Freeze panes
                    e.Worksheet.WorksheetOptions.AllowFreezePanes = true;
                    e.Worksheet.WorksheetOptions.LeftColumnRightPaneNumber = 1;
                    e.Worksheet.WorksheetOptions.TopRowBottomPaneNumber = 1;
                    e.Worksheet.WorksheetOptions.SplitHorizontalOffset = 1;
                    e.Worksheet.WorksheetOptions.SplitVerticalOffest = 1;
 
                    isConfigured = true;
                }
            }
        }
 
        protected void gridConditions_ExcelMLExportStylesCreated(object sender, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLStyleCreatedArgs e)
        {
            //Apply background colors
            foreach (StyleElement style in e.Styles)
            {
                if (style.Id == "headerStyle")
                {
                    style.InteriorStyle.Pattern = InteriorPatternType.Solid;
                    style.InteriorStyle.Color = System.Drawing.Color.Gray;
                }
                if (style.Id == "alternatingItemStyle")
                {
                    style.InteriorStyle.Pattern = InteriorPatternType.Solid;
                    style.InteriorStyle.Color = System.Drawing.Color.LightGray;
                }
                if (style.Id.Contains("itemStyle"))
                {
                    style.InteriorStyle.Pattern = InteriorPatternType.Solid;
                    style.InteriorStyle.Color = System.Drawing.Color.White;
                }
            }
        }


Any thoughts to what might be causing this?

Here is my grid code:

Daniel
Telerik team
 answered on 10 Nov 2010
5 answers
107 views
Hi, I try to implement very nice example with editing grid on doubleclick, but have some problem.
Look at the example: http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultcs.aspx
There is a column "In stock". During editing the values are loaded from DataSource1. Is it possible to load the date from different DataSource (not the same as RadGrid). As I saw somewher there is no DataSource proprties on GridDropDownListColumnEditor...
ToMa
Top achievements
Rank 1
 answered on 10 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?