Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
246 views
I have a drop down that I need to show an image in so I have added an ItemTemplate
<ItemTemplate> 
<%# setImage(DataBinder.Eval(Container.DataItem, "SUBTYPE").ToString()) %> 
           &nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem, "PRJ_NAME")%> 
</ItemTemplate>  

Now I am not looking to do anything special style wise just add and image to the left of the text which works but when I do this the LI that is generated around the Item no longer has a CSS class attribute.

normally the <LI> tag has a <LI class="rcbItem> and the javascript would change the hover when you roll over it but when I simply add my ItemTemplate that level loses all of this. is there a way I can put this back in? I have tried wrapping it with a <div> and I have tried added my own <LI> but this throws and error.

Thanks
Kevin Babcock
Top achievements
Rank 1
 answered on 16 Nov 2008
3 answers
118 views
Hi,

I am using a RadGrid ASP.NET AJAX(Version Q2 2008). It requires a script manager to run. If I am using <asp:scriptManager> it gives a runtime javaascript error.

Pls suggest.
Phil
Top achievements
Rank 2
 answered on 16 Nov 2008
1 answer
89 views
Is there a way to enable Modaling via Javascript?  I am using a RadWindowManager in my MasterPage and calling it from various pages throughout the site.  One of my windows requires the window to be modaled but the rest of the site does not require this.

This is what I am using for JavaScript right now
<script type="text/javascript" language="javascript">  
    //<![CDATA[  
    function openTerms(url) {  
        var oWnd = radopen(url, "RadWindowTerms");  
        oWnd.setSize(610, 600);  
        oWnd.Center();  
    }  
    //]]>  
</script> 

Thanks
Chase Florell
Top achievements
Rank 1
 answered on 15 Nov 2008
0 answers
81 views
Hello ,

Please let me know the code of Menu control that is same applied in you telerik site (Left Menu) like in demo section ..

http://demos.telerik.com/aspnet/Controls/Examples/Integration/Ajax/TreeView/DefaultCS.aspx?product=treeview

like collapsable menu ...

I am using this code but like your menu works

<radM:RadMenu ID="RadMenu1" Skin="Fusion" runat="server" Height="541px" Width="185px" ClickToOpen="True" Flow="Vertical" >
 <CollapseAnimation Type="None" Duration="0"></CollapseAnimation>
 <ExpandAnimation Type="InOutElastic" Duration="0" />
            <Items>
                <radM:RadMenuItem Text="Desktop" runat="server">
                <GroupSettings ExpandDirection="Down" Flow="Vertical" Height="100" OffsetX="20" />
                    <Items>
                        <radM:RadMenuItem runat="server" Text="Recent Work Cases">
                        </radM:RadMenuItem>
                        <radM:RadMenuItem Text="Flagged Cases" runat="server">
                        </radM:RadMenuItem>
                        <radM:RadMenuItem runat="server" Text="New Leads">
                        </radM:RadMenuItem>
                        <radM:RadMenuItem runat="server" Text="Monthly Quota">
                        </radM:RadMenuItem>
                    </Items>
                </radM:RadMenuItem>
                <radM:RadMenuItem runat="server" Text="Admin">
                <GroupSettings ExpandDirection="Down" Flow="Vertical" Height="100" OffsetX="20" />
                    <Items>
                        <radM:RadMenuItem runat="server" Text="Add/Edit Vendor">
                        </radM:RadMenuItem>
                        <radM:RadMenuItem ID="RadMenuItem1" runat="server" Text="Add/Edit Vendor">
                        </radM:RadMenuItem>
                        <radM:RadMenuItem ID="RadMenuItem2" runat="server" Text="Add/Edit Vendor">
                        </radM:RadMenuItem>
                        <radM:RadMenuItem ID="RadMenuItem3" runat="server" Text="Add/Edit Vendor">
                        </radM:RadMenuItem>
                        <radM:RadMenuItem ID="RadMenuItem4" runat="server" Text="Add/Edit Vendor">
                        </radM:RadMenuItem>
                    </Items>
                </radM:RadMenuItem>
                
            </Items>
        </radM:RadMenu>

Please help.

Thanks
Rishi




Rahul Gupta
Top achievements
Rank 1
 asked on 15 Nov 2008
3 answers
193 views
Hi,

Need help on deleting records off my Radgrid, i have tried to use client side delete and it works but upon page refresh and i add new product the row which i deleted earlier is not deleted?

How do i delete rows from my radgrid?

I am using datable

Code Behind

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

[System.ComponentModel.Description("Management")]

public partial class Management : System.Web.UI.UserControl
{

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void ProductAddButton_Click(object sender, EventArgs e)
    {
        DataTable dt = new DataTable();

        dt.Columns.Add(new DataColumn("ProdType"));
        dt.Columns.Add(new DataColumn("ProdUnitUser"));

        DataRow dr;

        GridDataItemCollection dtCol = ProductTable.Items;
        foreach (GridDataItem item in dtCol)
        {
            dr = dt.NewRow();
            dr["ProdType"] = item["ProdType"].Text;
            dr["ProdUnitUser"] = item["ProdUnitUser"].Text;
            dt.Rows.Add(dr);
        }

        dr = dt.NewRow();
        dr["ProdType"] = ProdTypeComboBox.SelectedItem.Text.ToString();
        dr["ProdUnitUser"] = ProdUnitUserNumTxtBox.Text.ToString();

        dt.Rows.Add(dr);
        ProductTable.DataSource = dt.DefaultView;
        ProductTable.DataBind();
    }

    protected void ConfirmButton_Click(object sender, EventArgs e)
    {
       
        DataTable du = new DataTable();
        ProductTable.DataSource = du;
        ProductTable.DataBind();

            DataTable dt1 = new DataTable();

            dt1.Columns.Add(new DataColumn("ProdType"));
            dt1.Columns.Add(new DataColumn("ProdUnitUser"));
            dt1.Columns.Add(new DataColumn("ProdAmt"));

            DataRow dr1;

            GridDataItemCollection dtCol1 = ConfirmTable.Items;
            foreach (GridDataItem item in dtCol1)
            {
                dr1 = dt1.NewRow();
                dr1["ProdType"] = item["ProdType"].Text;
                dr1["ProdUnitUser"] = item["ProdUnitUser"].Text;
                dr1["ProdAmt"] = item["ProdAmt"].Text;
                dt1.Rows.Add(dr1);
            }

            dr1 = dt1.NewRow();
            dr1["ProdType"] = ProdTypeComboBox.SelectedItem.Text.ToString();
            dr1["ProdUnitUser"] = ProdUnitUserNumTxtBox.Text.ToString();
            dr1["ProdAmt"] = ProdAmtNumTxtBox.Text.ToString();

            dt1.Rows.Add(dr1);
            ConfirmTable.DataSource = dt1.DefaultView;
            ConfirmTable.DataBind();
    }

    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        Response.Redirect("http://dev1:8080/");
    }
  
    protected void ProdTypeComboBox_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        if (ProdTypeComboBox.SelectedValue.ToString() == "CopyLog")
        {
            Label1.Text = "Units";
        }
        else
        {
            Label1.Text = "Users";
        }
    }

    protected void ProductTable_DeleteCommand(object source, GridCommandEventArgs e)
    {
        //GridDataItem dataItem = (GridDataItem)e.Item;
        //String ProdType = dataItem.GetDataKeyValue("ProdType").ToString();
    }
}

UI


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Management.ascx.cs" Inherits="Management" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2008.2.826.20, Culture=Neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Web20"  />
<telerik:RadAjaxPanel ID="RadAjaxPanel3" runat="server" Height="200px" Width="700px">
   
<table style="width: 550px">
      
        <tr>
            <td style="width: 95px">
            <asp:Label ID="NameLbl" runat="server" Text="Name"></asp:Label></td>
            <td style="width: 100px">
            <telerik:RadTextBox ID="NameTxtBox" runat="server"></telerik:RadTextBox></td>
            <td rowspan="11" style="width: 30px">
            </td>
           
            <td style="width: 95px">
            <asp:Label ID="CityLbl" runat="server" Text="City"></asp:Label></td>
            <td style="width: 100px">
            <telerik:RadTextBox ID="CityTxtBox" runat="server"></telerik:RadTextBox>
            </td>
       </tr>
      
        <tr>
            <td style="width: 95px">
            <asp:Label ID="ContactPersonLbl" runat="server" Text="Contact Person"></asp:Label></td>
            <td style="width: 100px">
            <telerik:RadTextBox ID="ContactPersonTxtBox" runat="server"></telerik:RadTextBox>
            </td>
           
            <td style="width: 95px">
            <asp:Label ID="StateLbl" runat="server" Text="State"></asp:Label></td>
            <td style="width: 100px">
            <telerik:RadTextBox ID="StateTxtBox" runat="server"></telerik:RadTextBox></td>
        </tr>
       
        <tr>
            <td style="width: 95px">
            <asp:Label ID="ContactNoLbl" runat="server" Text="Contact No."></asp:Label>
            </td>
           
            <td style="width: 100px">
            <telerik:RadTextBox ID="ContactNoTxtBox" runat="server"></telerik:RadTextBox>
            </td>
           
            <td style="width: 95px">
            <asp:Label ID="PostCodeLbl" runat="server" Text="Post Code"></asp:Label>
            </td>
           
            <td style="width: 100px">
            <telerik:RadTextBox ID="PostCodeTxtBox" runat="server"></telerik:RadTextBox>
            </td>
        </tr>
       
        <tr>
            <td style="width: 95px">
            <asp:Label ID="FaxNoLbl" runat="server" Text="Fax No."></asp:Label>
            </td>
           
            <td style="width: 100px">
            <telerik:RadTextBox ID="FaxNoTxtBox" runat="server"></telerik:RadTextBox>
            </td>
           
            <td style="width: 95px">
            <asp:Label ID="EMailLbl" runat="server" Text="E-Mail"></asp:Label>
            </td>
           
            <td style="width: 100px">
            <telerik:RadTextBox ID="EMailTxtBox" runat="server"></telerik:RadTextBox>
            </td>
        </tr>
       
        <tr>
            <td style="width: 95px">
            <asp:Label ID="AddressLbl" runat="server" Text="Address"></asp:Label>
            </td>
           
            <td style="width: 100px">
            <telerik:RadTextBox ID="AddressTxtBox" runat="server"></telerik:RadTextBox>
            </td>
           
            <td style="width: 95px">
            <asp:Label ID="ContractNoLbl" runat="server" Text="Contract No."></asp:Label>
            </td>
           
            <td style="width: 100px">
            <telerik:RadTextBox ID="ContractNotxtBox" runat="server"></telerik:RadTextBox>
            </td>
        </tr>
       
        <tr>
            <td colspan="2">
                <br />
            </td>
           
            <td colspan="2" rowspan="3">
            </td>
        </tr>
       
        <tr>
            <td style="width: 95px">
            <asp:Label ID="DateLbl" runat="server" Text="Date Start"></asp:Label>
            </td>
           
            <td style="width: 100px">
            <telerik:RadDatePicker ID="DateStartPicker" runat="server" Width="125px">
                <Calendar runat="server" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                </Calendar>
            </telerik:RadDatePicker>
            </td>
        </tr>
       
        <tr>
            <td colspan="2">
                <br />
            </td>
        </tr>
       
        <tr>
            <td style="width: 95px">
            <asp:Label ID="ProdTypeLbl" runat="server" Text="Product Type"></asp:Label>
            </td>
            <td style="width: 100px">
            <telerik:RadComboBox ID="ProdTypeComboBox" runat="server" Width="126px" AutoPostBack="True" OnSelectedIndexChanged="ProdTypeComboBox_SelectedIndexChanged">
                <Items>
                    <telerik:RadComboBoxItem runat="server" Text="CopyLog" Value="CopyLog" Selected="True" />
                    <telerik:RadComboBoxItem runat="server" Text="FaxLog" Value="FaxLog" />
                    <telerik:RadComboBoxItem runat="server" Text="PrintLog" Value="PrintLog" />
                    <telerik:RadComboBoxItem runat="server" Text="TeleLog" Value="TeleLog" />
                </Items>
            <CollapseAnimation Duration="200" Type="OutQuint" />
            </telerik:RadComboBox>
            </td>
           
            <td style="width: 95px">
            <asp:Label ID="Label1" runat="server" Text="Units"></asp:Label>
            </td>
           
            <td style="width: 100px">
            <telerik:RadNumericTextBox ID="ProdUnitUserNumTxtBox" runat="server" Type="Number" Width="125px">
            <NumberFormat DecimalDigits="0" /></telerik:RadNumericTextBox>
            </td>
        </tr>
       
        <tr>
            <td colspan="2">
                <br />
            </td>
           
            <td colspan="2" rowspan="2">
            </td>
        </tr>
       
        <tr>
            <td style="width: 95px">
            </td>
           
            <td style="width: 100px">
            <asp:Button ID="ProductAddButton" runat="server" Text="Add Product" OnClick="ProductAddButton_Click" UseSubmitBehavior="False"/>
            </td>
        </tr>
       
</table><br />

<telerik:RadGrid ID="ProductTable" runat="server" AutoGenerateColumns="False" Skin="Hay" Width="530px" GridLines="None" OnDeleteCommand="ProductTable_DeleteCommand">

<MasterTableView GridLines="None" DataKeyNames="ProdType">
    <RowIndicatorColumn>
        <HeaderStyle Width="20px" />
    </RowIndicatorColumn>
    <ExpandCollapseColumn>
        <HeaderStyle Width="20px" />
    </ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="ProdType" HeaderText="Product Type" UniqueName="ProdType"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ProdUnitUser" HeaderText="Product Unit/Users" UniqueName="ProdUnitUser"></telerik:GridBoundColumn>
        <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="column" ConfirmText="1 Record Will Be Deleted, Confirm?" ConfirmTitle="Deleting record"></telerik:GridButtonColumn>
    </Columns>
</MasterTableView>

<FilterMenu EnableTheming="True" Skin="Telerik">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
    <ClientSettings>
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
</telerik:RadGrid><br />

<table>

    <tr>
        <td style="width: 100px">
        <asp:Label ID="AmountLbl" runat="server" Text="Amount"></asp:Label>
        </td>
       
        <td style="width: 100px">
        <telerik:RadNumericTextBox ID="ProdAmtNumTxtBox" runat="server" Culture="English (United States)" Width="125px">
        <NumberFormat DecimalDigits="0" /></telerik:RadNumericTextBox>
        </td>
       
        <td style="width: 30px" rowspan="1">
        </td>
       
        <td style="width: 100px">
        <asp:Button ID="ConfirmButton" runat="server" Text="Confirm" OnClick="ConfirmButton_Click"/>
        </td>
    </tr>
   
</table><br />

<telerik:RadGrid ID="ConfirmTable" runat="server" AutoGenerateColumns="False" GridLines="None" Skin="Hay" Width="530px" PageSize="5">
<MasterTableView AllowAutomaticDeletes="True" DataKeyNames="ProdType,ProdUnitUser,ProdAmt">
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn HeaderText="Product Type" UniqueName="ProdType" DataField="ProdType">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="Product Unit/User" UniqueName="ProdUnitUser" DataField="ProdUnitUser">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderText="Amount" UniqueName="ProdAmt" DataField="ProdAmt">
        </telerik:GridBoundColumn>
        <telerik:GridClientDeleteColumn ConfirmText="Are you sure you want to delete the selected row?" ConfirmTitle="Delete Record" Text="Delete" UniqueName="column"/>
    </Columns>
</MasterTableView>
<FilterMenu EnableTheming="True" Skin="Hay">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
</telerik:RadGrid><br />
    <table>
    <tr>
        <td style="width: 200px">
            <br />
            <asp:Button ID="SubmitButton" runat="server" Text="Submit" OnClick="SubmitButton_Click"/></td>
    </tr>
</table>
</telerik:RadAjaxPanel>

Thank You In Advance
Yves
Top achievements
Rank 1
 answered on 15 Nov 2008
2 answers
132 views
I'm currently evaluating the new suite with a view to standardising our application on it.  My question is -- does every control require a script manager?

We currently use a combination of a tab control with a set of menus for a standard navigation. If we were to migrate to your controls, it appears that they would have to have a script manager, and therefore be included in a FORM tag. As you cannot have more than one form on a page, this would really cause us a lot of headaches.

Is there any way to use the Menu, Tab and Multipage controls outside a form?

Thanks
kieran
Top achievements
Rank 1
 answered on 15 Nov 2008
5 answers
180 views
I am using the latest asp.net for ajax RadGrid (2008.1.619.20) in a dotnetnuke module.

I was just following the tutorial pdf and it said I had to check the enable ajax option but I found on this forum that you have to ajaxify the grid using the updatepanel or the ajaxmanager. However clicking on a header or draggin a header to group the grid still causes a flashing postback of the entire page.
My other module that uses an ajax manager ajaxifies nicely but it does not contain a grid.

Here is a code snippet:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  
    DefaultLoadingPanelID="WedstrijdBeheerLoadingPanel"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1"  
                    LoadingPanelID="WedstrijdBeheerLoadingPanel" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
 
<telerik:RadAjaxLoadingPanel ID="WedstrijdBeheerLoadingPanel" runat="server" Height="75px" 
    Width="75px"
    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' 
        style="border: 0px;" /> 
</telerik:RadAjaxLoadingPanel> 
 
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server"  
    ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>"  
    SelectCommand="SELECT * FROM wedstrijd"></asp:SqlDataSource> 
 
<telerik:RadGrid ID="RadGrid1" runat="server" EnableAjaxSkinRendering="true" AllowPaging="True"  
    AllowSorting="True" DataSourceID="SqlDataSource1" GridLines="None"  
    ShowGroupPanel="True" Skin="WebBlue"
    <AlternatingItemStyle BackColor="#E0DFE3" Font-Bold="False" Font-Italic="False"  
        Font-Overline="False" Font-Strikeout="False" Font-Underline="False"  
        Wrap="True" /> 
    <PagerStyle Mode="NextPrevAndNumeric" /> 
<MasterTableView AutoGenerateColumns="False" DataKeyNames="ItemID"  
        DataSourceID="SqlDataSource1"
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="ItemID" DataType="System.Int32"  
            HeaderText="ItemID" ReadOnly="True" SortExpression="ItemID" UniqueName="ItemID"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Title" HeaderText="Title"  
            SortExpression="Title" UniqueName="Title"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="EndDate" DataType="System.DateTime"  
            HeaderText="EndDate" SortExpression="EndDate" UniqueName="EndDate"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="CreatedDate" DataType="System.DateTime"  
            HeaderText="CreatedDate" SortExpression="CreatedDate" UniqueName="CreatedDate"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="MaxEntries" DataType="System.Int32"  
            HeaderText="MaxEntries" SortExpression="MaxEntries" UniqueName="MaxEntries"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Antwoord" HeaderText="Antwoord"  
            SortExpression="Antwoord" UniqueName="Antwoord"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Antwoord2" HeaderText="Antwoord2"  
            SortExpression="Antwoord2" UniqueName="Antwoord2"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Clicks" DataType="System.Int32"  
            HeaderText="Clicks" SortExpression="Clicks" UniqueName="Clicks"
        </telerik:GridBoundColumn> 
    </Columns> 
</MasterTableView> 
    <ClientSettings AllowDragToGroup="True"
    </ClientSettings> 
</telerik:RadGrid> 
 

Steve Newbery
Top achievements
Rank 1
 answered on 15 Nov 2008
2 answers
171 views

 

 Hi All,


I have a grid. In this grid i have a client select column.
that is being used to select / deselect all the rows of grid.
I want to call  a javascript method when user selects / deselects rows by
clicking on header client select column.

Does any body know how to do it, tell me...

Thanks in advance......    


Brijendra Pandey

Brijendra Kumar
Top achievements
Rank 1
 answered on 15 Nov 2008
1 answer
107 views
I'm getting duplicate times in the TimeLabel column when I set TimeLabelRowSpan = 1 and MinutesPerRow = 30 (i.e. 12pm, 12pm, 1pm, 1pm, 2pm, 2pm, etc.)
Is there some Time Format property I should be setting to get the :30 to show up, or is this a bug?
Penny
Top achievements
Rank 1
 answered on 14 Nov 2008
5 answers
161 views
I have a grid in a usercontrol. All events in the grid works, except for PerformInsert and Update commands. Those two commands never fires. I have looked at all the examples, tried different solutions, but no matter what I do, the events never fires. All they do is closing the editform. I have tried with LinqDataSource, and NeedDataSource in codebehind. Here is my Grid:

<code>
            <telerik:RadGrid ID="rgBestander"
                runat="server"
                AllowSorting="true"
                AllowPaging="true"
                PageSize="20"
                AutoGenerateColumns="false"
                ClientSettings-EnableRowHoverStyle="true"
                GridLines="none"
                Skin="WebBlue"
                Width="97%"
                PagerStyle-Mode="NextPrevAndNumeric"
                PagerStyle-NextPagesToolTip="Neste side"
                PagerStyle-NextPageText="Neste >>"
                Pagerstyle-NextPageToolTip="Neste side"
                PagerStyle-PrevPagesToolTip="Forrige side"
                PagerStyle-PrevPageText="<< Forrige"
                PagerStyle-PrevPageToolTip="Forrige side"
                PagerStyle-ShowPagerText="false"
                OnItemCommand="rgBestander_ItemCommand"
                OnInsertCommand="rgBestander_InsertCommand"
                OnUpdateCommand="rgBestander_UpdateCommand"
                OnNeedDataSource="rgBestander_NeedDataSource">
                <MasterTableView DataKeyNames="Id"
                    Width="100%"
                    CommandItemDisplay="Top"
                    CommandItemSettings-AddNewRecordText="Legg til ny bestand"
                    CommandItemSettings-RefreshText="Oppdater"
                    NoMasterRecordsText="Ingen data Ã¥ vise ...">
                    <Columns>
                        <telerik:GridBoundColumn DataField="Id" SortExpression="Id" HeaderText="&nbsp;BestandID" ReadOnly="true" HeaderButtonType="TextButton" ItemStyle-Width="100" HeaderStyle-Width="100" />
                        <telerik:GridBoundColumn DataField="BestandNavn" SortExpression="BestandNavn" HeaderText="&nbsp;Bestand" />
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelText="Avbryt" EditText="Oppdater" InsertText="Lagre" ItemStyle-HorizontalAlign="Right" />
                    </Columns>
                    <EditFormSettings EditFormType="Template">
                        <FormTemplate>
                            <table border="0" cellpadding="2" cellspacing="0">
                                <tr>
                                    <td><asp:Label ID="lblBestandID" runat="server" Text="BestandID" /></td>
                                    <td><asp:TextBox ID="txtBestandID" runat="server" Text='<%# Eval( "Id") %>' CssClass="tekstfelt" style="width:100px" ReadOnly="true" /></td>
                                </tr>
                                <tr>
                                    <td><asp:Label ID="lblBestandNavn" runat="server" Text="Bestand navn" /></td>
                                    <td><asp:TextBox ID="txtBestandNavn" runat="server" Text='<%# Eval( "BestandNavn") %>' CssClass="tekstfelt" style="width:500px" /></td>
                                </tr>
                                <tr>
                                    <td colspan="2">&nbsp;</td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td><asp:Button ID="btnLagre" Text='<%#  (Container as GridItem).OwnerTableView.IsItemInserted ? "Legg til" : "Oppdater" %>' runat="server" CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>' CssClass="logginnknapp" /><asp:Button ID="btnAvbryt" Text="Avbryt" runat="server" CausesValidation="False" CommandName="Cancel" CssClass="logginnknapp" /></td>
                                </tr>
                            </table>
                        </FormTemplate>
                    </EditFormSettings>
                </MasterTableView>
            </telerik:RadGrid>
</code>

And here is the codebehind:
<code>

        protected void rgBestander_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            var ds = Repository.getCurrent().HentAlleBestander();
            rgBestander.DataSource = ds.ToList();
        }

        protected void rgBestander_InsertCommand(object source, GridCommandEventArgs e)
        {
   var thisMessage = "Hello world";
        }
</code>

Eric Skaggs
Top achievements
Rank 2
 answered on 14 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?