Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
70 views
Hi,
I need to add itemtemplates to radcombobox  from clientside. Can someone please tell how we can achieve this?
Yana
Telerik team
 answered on 24 Jun 2010
1 answer
156 views
I have created a grid with a nested view template (similar to the demo http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx).

I have a grid in the first tab, I need the data in the grid to be fully modifyable, insert/edit and delete.  I have the grid formated, and I have a GridNumericColumnEditor to handle the formatted numeric input.  However, when I select edit or add new record the GridNumericColumnEditor formatted does not show up.

The data will look something like this:
DatePlayed: Just a normal calendar date.
WeekNo: 1, 2, 3.....25
Hole1 - Hole18: Will have values from 0 to 11.

Is this because the grid is in a nested view template ?

Please take a look at the code and let me know what I missed.

<%@ Page Language="c#" CodeFile="Default.aspx.cs" Inherits="Default" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
    <style type="text/css">  
    .viewWrap  
    {  
        padding:15px;  
        background:#2291b5 0 0 url(Img/bluegradient.gif) repeat-x;  
    }  
      
    .contactWrap  
    {  
        padding:10px 15px 15px 15px;  
        background:#fff;  
        color:#333;  
    }  
      
    .contactWrap td  
    {  
        padding:0 20px 0 0;  
    }  
      
    .contactWrap td td  
    {  
        padding:3px 20px 3px 0;  
    }  
      
    .contactWrap img  
    {  
        border:1px solid #05679d;  
    }  
      
    </style> 
</head> 
 
<body class="BODY">  
    <form runat="server" id="mainForm" method="post">  
        <telerik:RadScriptManager runat="server" ID="ScriptManager1"/>  
        <telerik:RadFormDecorator ID="RadFormDecorator1" DecoratedControls="All" runat="server" /> 
        <telerik:RadSkinManager runat="server" ID="RadSkinManager1" PersistenceMode="Session"/>  
        <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" DataSourceID="SqlDataSource1" runat="server" PageSize="5"   
            AutoGenerateColumns="False"   
            AllowSorting="True"   
            AllowMultiRowSelection="False" 
            AllowPaging="True"   
            GridLines="None"   
            ShowFooter="true" 
            ShowStatusBar="true" 
            OnItemCreated="RadGrid1_ItemCreated" 
            OnItemCommand="RadGrid1_ItemCommand">  
            <PagerStyle Mode="NumericPages"></PagerStyle> 
            <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="MemberID" AllowMultiColumnSorting="false">  
                <NestedViewTemplate> 
                    <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">  
                        <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">  
                            <Tabs> 
                                <telerik:RadTab runat="server" Text="Contact Information" PageViewID="contactView"/>  
                                <telerik:RadTab runat="server" Text="Season Scores" PageViewID="scoreView"/>  
                                <telerik:RadTab runat="server" Text="Practice Rounds" PageViewID="practiceView"/>  
                            </Tabs> 
                        </telerik:RadTabStrip> 
                        <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">  
                            <telerik:RadPageView runat="server" ID="scoreView">  
                                <asp:Label ID="Label1" Text='<%# Eval("MemberID") %>' Visible="false" runat="server" /> 
                                <telerik:RadGrid runat="server" ID="scoresGrid" DataSourceID="SqlDataSource2" 
                                    ShowFooter="true"   
                                    ShowStatusBar="true" 
                                    AllowSorting="true" 
                                    AutoGenerateColumns="false" 
                                    OnInsertCommand="insertScores" 
                                    OnUpdateCommand="updateScores" 
                                    OnDeleteCommand="deleteScores">  
                                    <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" 
                                        DataKeyNames="MemberID, LeagueID, WeekNo" PageSize="7" EditMode="InPlace" CommandItemDisplay="top">  
                                        <Columns> 
                                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">  
                                                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                                <HeaderStyle Width="25px"></HeaderStyle> 
                                            </telerik:GridEditCommandColumn> 
                                            <telerik:GridButtonColumn ConfirmText="Delete These Scores?" ConfirmDialogType="RadWindow" 
                                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete" 
                                                UniqueName="DeleteColumn">  
                                                <HeaderStyle Width="25px" /> 
                                                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                            </telerik:GridButtonColumn> 
                                            <telerik:GridDateTimeColumn SortExpression="DatePlayed" HeaderText="Played On" HeaderButtonType="TextButton" 
                                                DataField="DatePlayed" UniqueName="DatePlayed" DataFormatString="{0:d}"/>  
                                            <telerik:GridNumericColumn SortExpression="WeekNo" HeaderText="Week" HeaderButtonType="TextButton" DataField="WeekNo" UniqueName="WeekNo" DataFormatString="{0:##}" HeaderStyle-Width="50px" HeaderStyle-HorizontalAlign="center" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole1" HeaderText="1" HeaderButtonType="TextButton" DataField="Hole1" UniqueName="Hole1" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole2" HeaderText="2" HeaderButtonType="TextButton" DataField="Hole2" UniqueName="Hole2" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole3" HeaderText="3" HeaderButtonType="TextButton" DataField="Hole3" UniqueName="Hole3" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole4" HeaderText="4" HeaderButtonType="TextButton" DataField="Hole4" UniqueName="Hole4" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole5" HeaderText="5" HeaderButtonType="TextButton" DataField="Hole5" UniqueName="Hole5" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole6" HeaderText="6" HeaderButtonType="TextButton" DataField="Hole6" UniqueName="Hole6" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole7" HeaderText="7" HeaderButtonType="TextButton" DataField="Hole7" UniqueName="Hole7" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole8" HeaderText="8" HeaderButtonType="TextButton" DataField="Hole8" UniqueName="Hole8" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole9" HeaderText="9" HeaderButtonType="TextButton" DataField="Hole9" UniqueName="Hole9" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole10" HeaderText="10" HeaderButtonType="TextButton" DataField="Hole10" UniqueName="Hole10" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole11" HeaderText="11" HeaderButtonType="TextButton" DataField="Hole11" UniqueName="Hole11" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole12" HeaderText="12" HeaderButtonType="TextButton" DataField="Hole12" UniqueName="Hole12" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole13" HeaderText="13" HeaderButtonType="TextButton" DataField="Hole13" UniqueName="Hole13" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole14" HeaderText="14" HeaderButtonType="TextButton" DataField="Hole14" UniqueName="Hole14" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole15" HeaderText="15" HeaderButtonType="TextButton" DataField="Hole15" UniqueName="Hole15" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole16" HeaderText="16" HeaderButtonType="TextButton" DataField="Hole16" UniqueName="Hole16" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole17" HeaderText="17" HeaderButtonType="TextButton" DataField="Hole17" UniqueName="Hole17" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                            <telerik:GridNumericColumn SortExpression="Hole18" HeaderText="18" HeaderButtonType="TextButton" DataField="Hole18" UniqueName="Hole18" DataFormatString="{0:##}" HeaderStyle-Width="25px" HeaderStyle-HorizontalAlign="right" ItemStyle-Width="25px" ItemStyle-HorizontalAlign="right" ColumnEditorID="holeData"/>  
                                        </Columns> 
                                    </MasterTableView> 
                                </telerik:RadGrid> 
 
                                <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:GolfLeague %>" 
                                    SelectCommand="SELECT * FROM Scores Where MemberID = @MemberID ORDER BY WeekNo" runat="server">  
                                    <SelectParameters> 
                                        <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="MemberID" /> 
                                    </SelectParameters> 
                                </asp:SqlDataSource> 
                            </telerik:RadPageView> 
                        </telerik:RadMultiPage> 
                    </asp:Panel> 
                </NestedViewTemplate> 
                <Columns> 
                    <telerik:GridBoundColumn SortExpression="FMLName" HeaderText="Player Name" HeaderButtonType="TextButton" 
                        DataField="FMLName" UniqueName="FMLName">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn SortExpression="EmailAddress" HeaderText="Email Address" HeaderButtonType="TextButton" 
                        DataField="EmailAddress" UniqueName="EmailAddress">  
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 
 
        <telerik:GridNumericColumnEditor ID="holeData" runat="server" NumericTextBox-Width="25px">  
            <NumericTextBox ID="txtScores" DataType="System.Int32" 
                MaxLength="2" MaxValue="100" MinValue="0" ShowSpinButtons="True" 
                Width="25px" runat="server"   
                EnabledStyle-HorizontalAlign="center" 
                FocusedStyle-HorizontalAlign="right" 
                HoveredStyle-HorizontalAlign="center" 
                NumberFormat-DecimalDigits="0"/>  
        </telerik:GridNumericColumnEditor> 
 
        <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:GolfLeague %>" runat="server" 
            SelectCommand="SELECT *, LastName + ', ' + FirstName + ISNULL(RTRIM(' ' + Initial),'') + ISNULL(RTRIM(' ' + Suffix),'') FMLName FROM Members">  
        </asp:SqlDataSource> 
    </form> 
</body> 
</html> 
 
Pavlina
Telerik team
 answered on 24 Jun 2010
1 answer
124 views
How do you go about applying the sortExpression to a Linq Dataset created by OpenAccess?

This is how I'm doing it, but is there an easier way?
        if (sortExpression.Count > 0) { 
            switch (sortExpression[0].FieldName.ToLower()) { 
                case "alias": 
                    if (sortExpression[0].SortOrder == GridSortOrder.Ascending) 
                        approvers = approvers.OrderBy(x => x.Alias).ToList(); 
                    else 
                        approvers = approvers.OrderByDescending(x => x.Alias).ToList(); 
                    break; 
                case "approvername": 
                    if (sortExpression[0].SortOrder == GridSortOrder.Ascending) 
                        approvers = approvers.OrderBy(x => x.ApproverName).ToList(); 
                    else 
                        approvers = approvers.OrderByDescending(x => x.ApproverName).ToList(); 
                    break; 
                case "approveremail": 
                    if (sortExpression[0].SortOrder == GridSortOrder.Ascending) 
                        approvers = approvers.OrderBy(x => x.ApproverEmail).ToList(); 
                    else 
                        approvers = approvers.OrderByDescending(x => x.ApproverEmail).ToList(); 
                    break; 
            } 
        } 

BaiH
Top achievements
Rank 1
 answered on 24 Jun 2010
5 answers
119 views
Hi

We are having an issue a different issue using Telerik version 5.6 with sharepoint's reusable content.
Well the update works fine.
But what happens is, let say a page has got telerik control and is set with some reusbale content. Now as soon as you add any other web part on the same page, for eg lets say Content Editor Webpart  or  Content query web part, the content in the telerik control which was displaying the reusable content before, just disappears, and shows just an anchor tag.

Have anybody come across this issue before. Is there any fix to this in the newer versions.

Thanks
Muzammil
Stanimir
Telerik team
 answered on 24 Jun 2010
1 answer
112 views
Hi,
I am using the RadGrid control in my project. Here I am loading this control dynamically in a RadTab control and trying to access the master table view of the grid control .

  var   tableView = $find("<%= grdAllDocs.ClientID %>").get_masterTableView();

but it is throwing the following exception.

Error Msg: null is null or not an object.

I am creating the grid control as follows:-

<telerik:RadGrid ID="grdAllDocs" runat="server" EnableViewState="True" AutoGenerateColumns="false"           
            
            AllowSorting="true" PageSize="25" OnItemCreated="grdAllDocs_ItemCreated"
            OnColumnCreated="grdAllDocs_ColumnCreated" OnItemDataBound="grdAllDocs_ItemDataBound"
            OnColumnCreating="grdAllDocs_ColumnCreating" AllowPaging="True" EnableEmbeddedSkins="false"
            Skin="RadSkin">
            <itemstyle wrap="false" />
            <mastertableview allowfilteringbycolumn="True" tablelayout="Fixed">
                        <PagerTemplate>
                            
                        </PagerTemplate>
                        <PagerStyle PageButtonCount="3" Mode="NumericPages" HorizontalAlign="Right" AlwaysVisible="true"    EnableSEOPaging="false" Position="TopAndBottom" ShowPagerText="true"></PagerStyle>
                        <Columns>
                                
                         </Columns>
                    </mastertableview>
        </telerik:RadGrid>

Please suggest me how I can get the master table view of the grid on the client side.

Thanks,
Alok...
Dimo
Telerik team
 answered on 24 Jun 2010
1 answer
96 views
We've updated the ToolsFile.xml to include the following class and css Files.
 <classes>
   
    <class name = "Table- Download" value=".table" />
    <class name = "Bullet" value=".bullet" />
  </classes>

  <cssFiles>
    <item name="/Style Library/styles.css" />
    <!-- temp for phase 1-->
    <item name="/Style Library/ToolsFile.css" />
  </cssFiles>

Everything works fine in IE, but when we test it in Firefox and Chrome the "Table- Download" style is not available from the drop down.

Hope to hear from you soon.
Thanks,
Fu Yuen

Thanks.
Stanimir
Telerik team
 answered on 24 Jun 2010
3 answers
208 views
i cannot seem to set the width of the gridmaskededitcolumn in a radgrid when it's in edit mode - it always seems to go to some set size instead of the size I set it to - how do I set the width?

<telerik:GridMaskedColumn DataField="contactcontent" UniqueName="contactcontent" 
                        FooterStyle-Width="90px" HeaderStyle-Width="90px" ItemStyle-Width="90px" Mask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" 
                        HeaderText="Contact" ColumnEditorID="ContactContentGridTextBoxColumnEditor"> 
                    </telerik:GridMaskedColumn> 
                    <telerik:GridMaskedColumn DataField="contactsecondarycontent" UniqueName="contactsecondarycontent" 
                        FooterStyle-Width="25px" HeaderStyle-Width="25px" ItemStyle-Width="25px" Mask="aaaaa" 
                        HeaderText="Ext." ColumnEditorID="ContactContentGridTextBoxColumnEditor"> 
                    </telerik:GridMaskedColumn> 
 
<telerik:GridMaskedColumnEditor ID="ContactContentMaskedColumnEditor" runat="server" 
            MaskedTextBox-PromptChar=" " MaskedTextBox-DisplayPromptChar=" " MaskedTextBox-DisplayMask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" 
            MaskedTextBox-Mask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"> 
            <MaskedTextBox runat="server" Width="90px" DisabledStyle-Width="90px" EmptyMessageStyle-Width="90px" 
                EnabledStyle-Width="90px" FocusedStyle-Width="90px" HoveredStyle-Width="90px" 
                InvalidStyle-Width="90px" ReadOnlyStyle-Width="90px" PromptChar=" " DisplayPromptChar=" " 
                DisplayMask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" 
                Mask="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" /> 
        </telerik:GridMaskedColumnEditor> 
        <telerik:GridMaskedColumnEditor ID="SecondaryContentMaskedColumnEditor" runat="server" 
            MaskedTextBox-PromptChar=" " MaskedTextBox-DisplayPromptChar=" " MaskedTextBox-DisplayMask="aaaaa" 
            MaskedTextBox-Mask="aaaaa"> 
            <MaskedTextBox runat="server" Width="25px" DisabledStyle-Width="25px" EmptyMessageStyle-Width="25px" 
                EnabledStyle-Width="25px" FocusedStyle-Width="25px" HoveredStyle-Width="25px" 
                InvalidStyle-Width="25px" ReadOnlyStyle-Width="25px" PromptChar=" " DisplayPromptChar=" " 
                DisplayMask="aaaaa" Mask="aaaaa" /> 
        </telerik:GridMaskedColumnEditor> 




also does anyone know how to get rid of the "_" on the display of the values promptchar does not work - it always shows the underlines even when i put in the " " instead as seen above
Dimo
Telerik team
 answered on 24 Jun 2010
1 answer
111 views

Hi, I want to use LINQ in the creation of heirarchy in radgrid, but to no avail, i can't solve.

Here is my snippet.

-------- .cs code-behind -----

// select from dropdownlist, then click button
protected void cmdView_Click(object sender, EventArgs e)
        {
            if (cmbItem.SelectedItem.Text != string.Empty)
            {               
                this.radExpand.Rebind();
            }
        }

// itemID is being fetched from dropdownlist
 void radExpand_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            DataModelDataContext context = new DataModelDataContext();
            if (cmbItem.SelectedItem.Text != string.Empty)
            {
                Guid teacherID = new Guid(cmbItem.SelectedValue);
                var data = from d in context.inventoryItems where d.itemID== itemIDselect d;
                this.radExpand.DataSource = data;
            }
        }

--------------------- .aspx markup -------------------------
<telerik:RadGrid runat="server" ID="radExpand" AllowPaging="True" GridLines="None" PageSize="30" AutoGenerateColumns="False" ShowFooter="True" ShowGroupPanel="false"
                ShowStatusBar="True" OnNeedDataSource="radExpand_NeedDataSource" onitemcreated="radExpand_ItemCreated">
                <MasterTableView>
                        <Columns>
                        <telerik:GridBoundColumn DataField="itemID" HeaderText="ID" UniqueName="itemID">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="Item Name" UniqueName="itemName">
                            <ItemTemplate>
                                <%# myProject.getItemName(Convert.ToString(DataBinder.Eval(Container.DataItem, "itemID"))).ToUpper() %>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn UniqueName="Status" HeaderText="Status">
                            <ItemTemplate>
                                <%# myProject.getStatus(new Guid(Convert.ToString(DataBinder.Eval(Container.DataItem, "itemID")))) %>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

-----------------------------------------

Thank you.

Rosen
Telerik team
 answered on 24 Jun 2010
6 answers
187 views
The following does not work:

function

 

 

CloseOnReload() {

 

GetRadWindow().Close();

}

 

 

function GetRadWindow() {

 

 

 

var oWindow = null;

 

 

 

if (window.radWindow) oWindow = window.radWindow;

 

 

 

else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;

 

 

 

return oWindow;

 

}



This is called by a CloseOnReload() script registered as a startup script when some action is performed.
Georgi Tunev
Telerik team
 answered on 24 Jun 2010
1 answer
145 views
i tried to use a technique that works fine for GridMaskedColumn and GridNumericColumn but it does not work for GridDropDownColumn to set the focus to a particular row of the grid when it's displayed in edit mode

here's my column

<telerik:GridDropDownColumn DataField="id" DataSourceID="MyObjectDataSource" 
                                    HeaderText="Name" ListTextField="name" ListValueField="id" DataType="System.Guid" 
                                    UniqueName="id"> 
                                </telerik:GridDropDownColumn> 



and here's my code

Entity insertedRecordToSetFocusTo = null; 
        protected void MyRadGrid_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
            // focus 
            if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) 
            { 
                GridEditableItem item = (GridEditableItem)e.Item; 
                if (insertedRecordToSetFocusTo != null) 
                { 
                    // check if we are at the row to set focus to 
                    if (item.GetDataKeyValue("id2").ToString() == insertedRecordToSetFocusTo.id2.ToString()) 
                    { 
                        RadComboBox c = (RadComboBox)item["id"].Controls[0]; 
                        c.Focus(); 
                        insertedRecordToSetFocusTo = null; 
                    } 
                } 
            } 
        } 

Tsvetina
Telerik team
 answered on 24 Jun 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?