Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
74 views
Hai,
      I Call a rad window on link button, then close it, again calling the Radwindow showing script error says that 

 Two components with the same id 'ctl00_CphMaster_RadPopupWindow_C_rgProduct' can't be added to the application.

please help me its very urgent............
Shinu
Top achievements
Rank 2
 answered on 05 Aug 2010
1 answer
261 views
I've been searching on here for a little bit and haven't been able to find anything to something that seems like it should be very simple.

I have a RadGrid with an edit column. I use a template for the edit form which is just a standard html table with some labels/text boxes in it. When the user clicks the submit button I want to get at the text boxes that the user is currently modifying.

<telerik:RadGrid ID="rgdTemp" runat="server"
        AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" GridLines="None"
        onitemcommand="rgdTemp_ItemCommand"
        onneeddatasource="rgdTemp_NeedDataSource" >
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn UniqueName="FirstName" DataField="FirstName" HeaderText="First Name" />
                <telerik:GridBoundColumn UniqueName="LastName" DataField="LastName" HeaderText="Last Name" />
                <telerik:GridEditCommandColumn EditText="Add Second Voucher" ButtonType="PushButton" />
            </Columns>
            <EditFormSettings EditFormType="Template">
                <FormTemplate>
                    <table>
                        <tr>
                            <td>
                                First Name:
                            </td>
                            <td>
                                <asp:TextBox ID="txtFirstName" runat="server" ReadOnly="true" Text='<%# Bind( "FirstName" ) %>'/>                    
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Last Name:
                            </td>
                            <td>
                                <asp:TextBox ID="txtLastName" runat="server" ReadOnly="true" Text='<%# Bind( "LastName" ) %>'/>                  
                            </td>
                        </tr>
                        <tr>
                            <td>
                                R:
                            </td>
                            <td>
                                <asp:TextBox ID="txtR" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                P:
                            </td>
                            <td>
                                <asp:TextBox ID="txtP" runat="server" Text="0" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="btnSubmit" runat="server" Text='<%# "Insert" %>'
                                        runat="server" CommandName='<%# "PerformInsert" %>'>
                                    </asp:Button>
                            </td>
                            <td>
                                <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
            <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
 
            <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
        </MasterTableView>
    </telerik:RadGrid>


The insert button really could just be a button that points to the code behind normally, just was something I was playing with.

Thanks
Princy
Top achievements
Rank 2
 answered on 05 Aug 2010
3 answers
74 views
Hi Friends,

                    I have a dynamically created RadGrid in Page1.aspx.My problem is when i go to another page Page2.aspx
and then coming back to Page1.aspx ,i loss my dynamically created datas in RadGrid.I  use Page.Redirect method to navigate to an another page.Its possible to store DataTable of RadGrid in Session  ,but i have large amount of datas.So storing in Session is not the correct way i think...Is there any way to store or not lossing datas while redirection.plz help me out.

Regards Titti.
TSM
Top achievements
Rank 1
 answered on 05 Aug 2010
2 answers
227 views
Hi guys,

I have an issue with setting the format of label and datepicker inside grid. I want to set "lblGridCreatedDate" and "lblGridCreatedDate" to have dd/MM/yyyy format in code behind. How can I do that?

Here is my code:
<telerik:GridTemplateColumn DataField="CreatedDate" HeaderText="Date" UniqueName="CreatedDate">
   <ItemTemplate>
       <asp:Label runat="server" ID="lblGridCreatedDate" Text='<%# Eval("CreatedDate") %>'></asp:Label>
   </ItemTemplate>
   <EditItemTemplate
       <telerik:RadDatePicker runat="server" ID="dtGridCreatedDate" Text='<%# Eval("CreatedDate") %>'></telerik:RadDatePicker>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

Thank you

AGT
Andy Taslim
Top achievements
Rank 1
 answered on 05 Aug 2010
2 answers
297 views

Hi all. I am using Visual Studio 08 SP1 with Telerik Asp.net ajax 2010 version..

Using below link as prototype, I would like to allow edit/delete functions for  certain rows  (Say allow edit/delete  to those Rows only if City = "London", if not edit/delete will be cancelled/not allowed).

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/commanditem/defaultcs.aspx


Below is my radgrid and onitemcommand for cancel. 

Thanks

---------

<telerik:RadGrid ID="RadGrid1" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true"
            DataSourceID="SessionDataSource1" AllowSorting="True" AutoGenerateColumns="true"
            AllowPaging="True" GridLines="None" runat="server" ShowFooter="True" AllowMultiRowSelection="True"
            PageSize="7" AllowMultiRowEdit="True" AllowAutomaticInserts="True" 
            OnItemDeleted="RadGrid1_ItemDeleted" onitemcommand="RadGrid1_ItemCommand">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView Width="100%"   CommandItemDisplay="Top" DataSourceID="SessionDataSource1"
                DataKeyNames="CustomerID">
                <CommandItemTemplate>
                    <div style="padding: 5px 5px;">
                        Custom command item template    
                        <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" />Edit selected</asp:LinkButton>  
                         <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# !RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />Add new</asp:LinkButton>  
                        <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# RadGrid1.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" /> Add this Customer</asp:LinkButton>  
                        <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected customers?')"
                            runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" />Delete selected customers</asp:LinkButton>  
                        <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" />Refresh customer list</asp:LinkButton>
                    </div>
                </CommandItemTemplate>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" />
            </ClientSettings>
        </telerik:RadGrid>


protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
       {
       // Here I need help to allow edit/delete for only Customers from London...
           if (e.CommandName == RadGrid.EditSelectedCommandName)
           {
                            
                 e.Canceled = true;
               }
           }
gc_0620
Top achievements
Rank 1
 answered on 04 Aug 2010
1 answer
65 views
I'm currently using a slider with two drag handles to set a date range on a web page which is intended to be used with a large touchscreen display.  The problem is that the default drag handles are a little too small to easily grab with a fingertip, so I'd like to use a custom set of larger ones.

I'm able to do custom skins just fine, right up until the point where I enlarge the drag handles, and then everything goes wrong.  My enlarged handle image experiences all kinds of strange behavior.  It will be truncated (I'll lose the right side of the image) when it first displays.  When I try hovering or dragging, it will suddenly grow to the full size, then sometimes shrink back when I let it go.  The left and right handles will display differently, then when I cross them they'll revert, and so forth.  Basically, it's all gone wacky on me.

The closest I've been able to get is with this entry in my custom css file:
.RadSlider_Custom .rslHorizontal a.rslDraghandle,
.RadSlider_Custom .rslHorizontal a.rslDraghandle:hover,
.RadSlider_Custom .rslHorizontal a.rslDraghandle:focus,
.RadSlider_Custom .rslHorizontal a.rslDraghandle:active
{
    background:url('Slider/customhandle.jpg');
    width:20px;
}

Am I close? :)

If you can attach a sample project with 2 custom drag handles that are simply 30x20 pixel black rectangles, that should get me to the finish line.

Thank you
KP IMG BPO
Top achievements
Rank 1
 answered on 04 Aug 2010
15 answers
291 views
Hi. I've got a RadTextBox using ClientEvents-OnKeyPress. It basically just detects if a user pressed the Enter key. It works fine but it makes a beeping sound like when you try to enter invalid input. Like I said the event fires okay just has that annoying beeping sound. Anyway around it?

Daniel
kyle perkins
Top achievements
Rank 1
 answered on 04 Aug 2010
2 answers
124 views
Hello,

I have a two column setup in the content section of my page using DIVs where the first one is floated to the left and set with a width of 220px and the second one is set with a margin-left of 260px no float.  I have two buttons in the second column that are affected by any telerik skin being applied to them.  Each button for some reason also inherits individually the margin-left of 260px.  So in the second column, I would have the start of the column itself at 260px, the first button at 520px and the second button another 260px from the first (780px).  The skin for the button seems to break apart as well making the button looking bigger than it should be and disconnect from it's right edge.  I have attached a screenshot of how the buttons look when the skin is applied.  I have also attached a picture of when no skins are applied to buttons and you will see that the buttons align as they should.

Any help would be greatly appreciated.

Thanks,
Ron
Ron
Top achievements
Rank 2
 answered on 04 Aug 2010
1 answer
281 views
Hhello everyone,
I am using hierarchical radgrid with mastertableview and nestedtableview that contains another grid inside,
I am trying to use  scroll with static headers in the master grid, scroll apears, headers staying in theire position and every thing looks great,
However, when the user clicks outside of the grid, or makes any action on the page , the data in the section is disappear
yes, I am using neeDataSource event, this is not the problem, I don't see any postback when it's happaning..

can any one help

here is my relevant code


<telerik:RadGrid ID="institutes" Skin="Skin" runat="server" AutoGenerateColumns="False" EnableEmbeddedSkins="false"   OnItemCommand="itemCommand" OnNeedDataSource="needDataSource"
        AllowSorting="False" AllowMultiRowSelection="False" AllowPaging="False" PageSize="5" 
        GridLines="None"  ShowFooter="True"  OnGroupsChanging="Group"  ShowGroupFooter="true"   >
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <GroupingSettings ShowUnGroupButton="true" RetainGroupFootersVisibility="true"    />
       
 
 
 
        <ClientSettings>
              <ClientEvents OnHierarchyCollapsed="HierarchyCollapsed" OnHierarchyExpanding="RadGrid1_HierarchyExpanding" />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        </ClientSettings>
        <MasterTableView AllowMultiColumnSorting="False" DataKeyNames="InstitueId,Id" ExpandCollapseColumn-ExpandImageUrl="../Images/expand1.png"
            ExpandCollapseColumn-ButtonType="ImageButton" ExpandCollapseColumn-CollapseImageUrl="../Images/minus.png"
            ShowGroupFooter="false" HierarchyLoadMode="ServerOnDemand"   ExpandCollapseColumn-AutoPostBackOnFilter="false"  GroupsDefaultExpanded="false" GroupLoadMode="Server"
            AllowSorting="false">
             
              <GroupByExpressions>
                    <telerik:GridGroupByExpression  >
                    <GroupByFields  >
                    <telerik:GridGroupByField FieldName="Town"  FieldAlias="רשות" />
                    </GroupByFields>
                    <SelectFields>
                     <telerik:GridGroupByField FieldName="Town"   FieldAlias="רשות" HeaderValueSeparator=" "   />
                     <telerik:GridGroupByField FieldName="Quantity"  FieldAlias="אוכלים" FormatString="                              {0}     "  HeaderText=" " Aggregate="Sum"       HeaderValueSeparator=""   />                     <telerik:GridGroupByField FieldName="ChangeQuantity"   HeaderText=" " Aggregate="Sum"  FormatString="                            {0}"   HeaderValueSeparator="  "  />
               
                   </SelectFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
            <Columns>
                
                 <telerik:GridBoundColumn HeaderText="סמל" DataField="Semel" UniqueName="Semel" >
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="מוסד" DataField="Name" UniqueName="Institue" >
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="אוכלים בפועל" DataField="Quantity" DataFormatString="{0:N0}" UniqueName="InstitueQuantity"
                    FooterAggregateFormatString="סה"כ אוכלים בפועל :{0:N0}" Aggregate="Sum" >
                </telerik:GridBoundColumn>
                
                
            <telerik:GridTemplateColumn HeaderText="כמות מבוקשת" Aggregate="Sum" FooterAggregateFormatString="<div id='total' >כמות מבוקשת {0:N0} </div>" UniqueName="InstitueChangeQuantity"
                    DataField="ChangeQuantity">
                    <ItemTemplate>
                        <div id='<%#Eval("Id")+"tot" %>' >
                            <%#((decimal)Eval("ChangeQuantity")).ToString("0")%>
                        </div>
                    </ItemTemplate>
</telerik:GridTemplateColumn>
                  <telerik:GridTemplateColumn HeaderText="סטטוס" DataField="Status.Code" UniqueName="InstitueStatus" ItemStyle-Width="150px"  >
                                            <ItemTemplate>
                                                <asp:HiddenField ID="hidStatusCode" runat="server" Value='<%#Eval("Status.Code") %>' />
                                                <asp:Label ID="lblStatus" runat="server">
                                                    <telerik:RadBinaryImage ID="imageStatus" runat="server" ImageAlign="Middle" ImageUrl='<%# "../Images/" +Eval("Status.Icon")+"_16_normal.png" %>'
                                                        Width="12px" Height="12px" /> 
                                                    <%#Eval("Status.Name")%></asp:Label>
                                               
                                              
                                            </ItemTemplate>
                </telerik:GridTemplateColumn>
                 
            </Columns>
            <NestedViewTemplate>
                <asp:Panel runat="server" ID="InnerContainer" Visible="true" CssClass="viewWrap">
                    <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" Skin=""    Style="padding-right: 20px;" SelectedIndex="0" OnClientTabSelected="tabSelected" >
                        <Tabs>
                            <telerik:RadTab runat="server" Text="פירוט מנות" PageViewID="PageView1" SelectedCssClass="SelectedTab"
                                CssClass="CustomTab">
                            </telerik:RadTab>
                            <telerik:RadTab runat="server" Text="מאפיינים" PageViewID="PageView2" SelectedCssClass="SelectedTab"
                                CssClass="CustomTab">
                            </telerik:RadTab>
                        </Tabs>
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" >
                        <telerik:RadPageView runat="server" ID="PageView1">
                            <!--Item (Classes) Grid  -->
                            <telerik:RadGrid runat="server" OnItemDataBound="dgItems_ItemCreated" ID='itemsGrid'
                                ShowFooter="true" EnableLinqExpressions="false" OnNeedDataSource="itemsGrid_NeedDataSource"
                                AllowSorting="false" Skin="Skin" EnableEmbeddedSkins="false"  >
                                <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="false"
                                    ShowFooter="false" ClientDataKeyNames="SmartId,Id,Status.Code,Quantity" DataKeyNames="SmartId,Id"
                                    HierarchyLoadMode="ServerOnDemand">
                                    <ItemStyle HorizontalAlign="Right" />
                                    <AlternatingItemStyle HorizontalAlign="Right" />
                                    <Columns>
                                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
                                        <telerik:GridBoundColumn HeaderText="כיתה" DataField="ClassName" UniqueName="Class">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn HeaderText="פריט" DataField="ItemName"  UniqueName="ItemOrAccount" >
                                        </telerik:GridBoundColumn>
                                        
                                        <telerik:GridBoundColumn HeaderText="אוכלים בפועל" DataField="Quantity" DataFormatString="{0:N0}" UniqueName="Quantity1">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn HeaderText="כמות מבוקשת" DataField="ChangeQuantity" UniqueName="requestQuantity1">
                                            <ItemTemplate>
                                                <telerik:RadNumericTextBox ID="request1" Width="50px" ShowSpinButtons="true" NumberFormat-DecimalDigits="0"
                                                    MinValue="0" AllowOutOfRangeAutoCorrect="true" BorderStyle="None" runat="server"
                                                    AutoPostBack="false"  DbValue='<%#Eval("ChangeQuantity") %>'  ClientEvents-OnValueChanged="quantityChanged">
                                                </telerik:RadNumericTextBox>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                          <telerik:GridCalculatedColumn HeaderText="הפרש" UniqueName="Difference1" DataType="System.Double"
                                            DataFields="ChangeQuantity,Quantity" Expression="{0}-{1}" Aggregate="Sum" />
                                    
                                         <telerik:GridBoundColumn HeaderText="תקציב מאושר" DataField="Price" DataFormatString="{0:N0}" UniqueName="Quantity2"  Display="false">
                                        </telerik:GridBoundColumn>
                                         
                                        <telerik:GridTemplateColumn HeaderText="תקציב מבוקש" DataField="ChangeAmount" UniqueName="requestAmount" Display="false">
                                            <ItemTemplate>
                                                <telerik:RadNumericTextBox ID="requestAmount" Width="50px" ShowSpinButtons="true" NumberFormat-DecimalDigits="0"
                                                    MinValue="0" AllowOutOfRangeAutoCorrect="true" BorderStyle="None" runat="server"
                                                    AutoPostBack="false" DbValue='<%#Eval("ChangeAmount") %>' ClientEvents-OnValueChanged="quantityChanged">
                                                </telerik:RadNumericTextBox>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridCalculatedColumn HeaderText="הפרש" UniqueName="Difference2" DataType="System.Double"  Display="false"
                                            DataFields="ChangeAmount,Price" Expression="{0}-{1}" Aggregate="Sum" />
                                        <telerik:GridTemplateColumn HeaderText="סיבת שינוי" UniqueName="changeReason">
                                            <ItemTemplate>
                                                <telerik:RadComboBox DataTextField="Name" DataValueField="Id" ID="changeReasons"
                                                    runat="server" Width="80px">
                                                </telerik:RadComboBox>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                         
                                        <telerik:GridCalculatedColumn HeaderText="סהכ" UniqueName="SumField" DataType="System.Double"  Display="false"
                                            DataFields="Amount" Expression="" Aggregate="Sum" />
                                     
                                         
                                        <telerik:GridTemplateColumn HeaderText="סטטוס" DataField="Status.Code" UniqueName="Status">
                                            <ItemTemplate>
                                                <asp:HiddenField ID="hidStatusCode" runat="server" Value='<%#Eval("Status.Code") %>' />
                                                <asp:Label ID="lblStatus" runat="server">
                                                    <telerik:RadBinaryImage ID="imageStatus" runat="server" ImageAlign="Middle" ImageUrl='<%# "../Images/" +Eval("Status.Icon")+"_16_normal.png" %>'
                                                        Width="12px" Height="12px" /> 
                                                    <%#Eval("Status.Name")%></asp:Label>
                                                <telerik:RadComboBox DataValueField="Code" ID="ddlStatus" runat="server" DataTextField="Name"
                                                    Width="120px" Visible="false" OnClientSelectedIndexChanged="statusChanged">
                                                    <ItemTemplate>
                                                        <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" ImageUrl='<%# "../Images/" +Eval("Icon")+"_16_normal.png" %>' />
                                                        <%#Eval("Name") %>
                                                    </ItemTemplate>
                                                </telerik:RadComboBox>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                         
                                           
                                         
                                    </Columns>
                                </MasterTableView>
                                <ClientSettings>
                                    <ClientEvents OnRowSelected="RowSelected" OnRowDeselected="RowDeSelected" />
                                    <Selecting AllowRowSelect="true" />
                                    
                                </ClientSettings>
                            </telerik:RadGrid>
                        </telerik:RadPageView>
                        <telerik:RadPageView ID="pageView2" runat="server"  >
                            
                         <div style="text-align:right;padding-right:-200px;">
                             
                            <iframe id='<%#"ifr_"+Eval("InstitueId") %>' width="100%" height="500px"   src="about:blank" frameborder="0" scrolling="no" style="position:static;" ></iframe>
                           
                         </div>
                        </telerik:RadPageView>
                    </telerik:RadMultiPage>
                </asp:Panel>
            </NestedViewTemplate>
        </MasterTableView>
         
         
    </telerik:RadGrid>

Thanks in advance

Eli
Pavlina
Telerik team
 answered on 04 Aug 2010
4 answers
265 views
Hi,

I have used a RadGrid inside a repeater, but having issues getting values out of it. Initially I realised I was rebinding on every postback, oops, but now changed that to only bind on initial load but when I click edit etc on the grid that particular GridView disappears.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Config.ascx.cs" Inherits="Admin_Config" ClassName="Admin.Config" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<h1>Config</h1>
<script type="text/javascript">
    function RowDblClick(sender, eventArgs) {
        sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
    }
</script>
<asp:Repeater ID="rptGroups" OnItemDataBound="rptGroups_ItemDataBound" runat="server">
    <ItemTemplate>
        <h2><asp:Literal ID="litHeader" runat="server" /></h2>
        <asp:UpdatePanel ID="upKeys" UpdateMode="Conditional" runat="server">
            <ContentTemplate>
                <asp:Literal ID="litTest" runat="server" />
                <telerik:RadGrid ID="rgKeys" AutoGenerateColumns="false" AllowSorting="True" AutoGenerateEditColumn="true" AllowAutomaticUpdates="True" Skin="Telerik"
                    OnUpdateCommand="rgKeys_UpdateCommand" runat="server">
                    <MasterTableView EditMode="PopUp" CommandItemDisplay="Bottom" CommandItemSettings-AddNewRecordText="Add new key"
                        CommandItemSettings-ShowRefreshButton="false" DataKeyNames="name" AllowSorting="true">
                        <Columns>
                            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" UniqueName="Name"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Alias" HeaderText="Alias" SortExpression="Alias" UniqueName="Alias"></telerik:GridBoundColumn>
                            <telerik:GridCheckBoxColumn DataField="Active" HeaderText="Active" SortExpression="Active" UniqueName="Active"></telerik:GridCheckBoxColumn>
                            <telerik:GridBoundColumn DataField="Value1" HeaderText="Value 1" SortExpression="Value1" UniqueName="Value1"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Value2" HeaderText="Value 2" SortExpression="Value2" UniqueName="Value2"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Value3" HeaderText="Value 3" SortExpression="Value3" UniqueName="Value3"></telerik:GridBoundColumn>
                        </Columns>
                        <EditItemStyle ForeColor="Gray"></EditItemStyle>
                        <EditFormSettings InsertCaption="Add new key" CaptionFormatString="Edit details key '{0}'" CaptionDataField="name" PopUpSettings-Modal="true">
                            <FormCaptionStyle Font-Bold="true" />   
                        </EditFormSettings>     
                    </MasterTableView>
                    <ClientSettings>
                        <ClientEvents OnRowDblClick="RowDblClick" />
                    </ClientSettings>
                </telerik:RadGrid>
            </ContentTemplate>
        </asp:UpdatePanel>
    </ItemTemplate>
</asp:Repeater>

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Xml.Linq;
using Telerik.Web.UI;
 
public partial class Admin_Config : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            XDocument Config = Cache.XDoc.Load("Config.xml");
            rptGroups.DataSource = Config.Element("config").Elements("group").Where(x => x.Attribute("hidden").Value == "false");
            rptGroups.DataBind();
        }
    }
    protected void rptGroups_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        XElement ConfigGroup = (XElement)e.Item.DataItem;
        ((Literal)e.Item.FindControl("litHeader")).Text = ConfigGroup.Attribute("alias").Value;
 
        var Keys = from x in ConfigGroup.Elements("key")
                   where x.Attribute("hidden").Value == "false"
                   orderby Convert.ToInt32(x.Attribute("sortId").Value) ascending
                   select new
                        {
                            Name = x.Attribute("name").Value,
                            Alias = x.Attribute("alias").Value,
                            Description = x.Attribute("description").Value,
                            Active = x.Attribute("active").Value,
                            SortId = x.Attribute("sortId").Value,
                            Value1 = x.Attribute("value1").Value,
                            Value2 = x.Attribute("value2").Value,
                            Value3 = x.Attribute("value3").Value
                        };
         
        ((RadGrid)e.Item.FindControl("rgKeys")).DataSource = Keys;
        ((RadGrid)e.Item.FindControl("rgKeys")).DataBind();
    }
    protected void rgKeys_UpdateCommand(object source, GridCommandEventArgs e)
    {
        Hashtable NewValues = new Hashtable();
        e.Item.OwnerTableView.ExtractValuesFromItem(NewValues, (GridEditableItem)e.Item);
 
        // Cant get any values out here...
    }
}

Pavlina
Telerik team
 answered on 04 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?