Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views
Hello!

Sure - I can define my own xpath, datavalues etc..but there must be a DEFAULT xml schema setup for this control?

Please..someone tell me where I can get the FULL xml schema definition for RadMenu.
This demo is pathetic - sorry...but it is.

http://demos.telerik.com/aspnet-ajax/menu/examples/programming/xmldefinition/defaultcs.aspx

It states you can use the RadMenu.GetXml() method - but that method does NOT output all of the menu attributes as I'd expect..like url, flow, enabled..

Thanks!


Richard
Top achievements
Rank 1
 answered on 30 Dec 2011
1 answer
61 views
The sitemap control has a font property which can be bolded, but what if I want only certain entries bolded, or even the font color changed.  Can that be done?
Richard
Top achievements
Rank 1
 answered on 30 Dec 2011
1 answer
113 views
Hi,
I design a file upload function,use below this AsyncUpload,RadProgressArea,RadProgressManager in RadAjaxPanel.
When I click one button in RadAjaxPanel, After the page postback, and all of the session value in page will lost.
why? what is the resolution for this?

Thanks All.
Richard
Top achievements
Rank 1
 answered on 30 Dec 2011
3 answers
82 views
Hi,

i have two Template columns in a RadGrid, a RadDatePicker control in one and a RadCombobox in the other.
when user changes the date i need to call  Business Layer method and populate the radcombobox from clientside.

can any one please help me.

Thank you 
Jay
Top achievements
Rank 1
 answered on 30 Dec 2011
3 answers
135 views
I have a situation where we want to use a search method that is already in place for post backs on certain pages, however, they want to use the same method but use it for onkeypress to search while the user is entering to return matches, etc.  obviously the onkeypress is client-side and my method is in a class which I can call from the code behind which is server side. Suggestions on this?
Jeff
Top achievements
Rank 1
 answered on 30 Dec 2011
1 answer
55 views
For some reason IE is not rendering the 'RepeatColumns' Correctly.  My sitemap has 4 groups so I have the RepeatColumns set to 4 like so:
<telerik:RadSiteMap ID="RadSiteMap1" runat="server"
                    DataNavigateUrlField="Title" DataSourceID="RadSiteMapDataSource1"
                    DataTextField="Title" DataValueField="Description" Font-Names="Arial"
                    Font-Size="8pt" ShowNodeLines="True" Skin="Windows7">
                    <LevelSettings>
                        <telerik:SiteMapLevelSetting MaximumNodes="5">
                            <ListLayout AlignRows="True" RepeatColumns="4" />
                        </telerik:SiteMapLevelSetting>
                    </LevelSettings>
                </telerik:RadSiteMap>

However in IE only 3 columns show up and the 4th is on the next line.  Firefox, Chrome, and Safari all render this correctly.

If I set the columns to 5 instead of 4 it works correctly, but then the spacing is wrong because it is compensating for an additional column. 

Any ideas?
Ivan Zhekov
Telerik team
 answered on 30 Dec 2011
1 answer
122 views
I would like to offer users the ability to select from a list of videos, and upon clicking, show that video in a preview window.  Ideally, this would be docked, and would open for the video and then close once the video was completed.  Is this possible?  Are there any demos?
Slav
Telerik team
 answered on 30 Dec 2011
2 answers
240 views
Spell Check Handler Server Error:500
<html>
  
    <head>
  
        <title>No dictionary loaded. Set the DictionaryPath property from the spell checker settings or copy the dictionaries to ~/App_Data/RadSpell/</title>
  
        <style>
  
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
  
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
  
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
  
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
  
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
  
         pre {font-family:"Lucida Console";font-size: .9em}
  
         .marker {font-weight: bold; color: black;text-decoration: none;}
  
         .version {color: gray;}
  
         .error {margin-bottom: 10px;}
  
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
  
        </style>
  
    </head>
  
  
  
    <body bgcolor="white">
  
  
  
            <span><H1>Server Error in '/cpe' Application.<hr width=100% size=1 color=silver></H1>
  
  
  
            <h2> <i>No dictionary loaded. Set the DictionaryPath property from the spell checker settings or copy the dictionaries to ~/App_Data/RadSpell/</i> </h2></span>
  
  
  
            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
  
  
  
            <b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  
  
  
            <br><br>
  
  
  
            <b> Exception Details: </b>System.ArgumentException: No dictionary loaded. Set the DictionaryPath property from the spell checker settings or copy the dictionaries to ~/App_Data/RadSpell/<br><br>
  
  
  
            <b>Source Error:</b> <br><br>
  
  
  
            <table width=100% bgcolor="#ffffcc">
  
               <tr>
  
                  <td>
  
                      <code>
  
  
  
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</code>
  
  
  
                  </td>
  
               </tr>
  
            </table>
  
  
  
            <br>
  
  
  
            <b>Stack Trace:</b> <br><br>
  
  
  
            <table width=100% bgcolor="#ffffcc">
  
               <tr>
  
                  <td>
  
                      <code><pre>
  
  
  
[ArgumentException: No dictionary loaded. Set the DictionaryPath property from the spell checker settings or copy the dictionaries to ~/App_Data/RadSpell/]
  
   Telerik.Web.UI.Dictionaries.EditDistanceDictionary.Load(TextReader baseDictionaryReader, ICustomDictionarySource customSource, String cacheKey) +154
  
   Telerik.Web.UI.SpellChecker.LoadDictionary() +290
  
   Telerik.Web.UI.SpellChecker.get_dictionary() +18
  
   Telerik.Web.UI.SpellChecker.CheckWord(String word, String sLastWord) +162
  
   Telerik.Web.UI.TelerikSpellCheckProvider.CheckWord(ITextWord current, ITextWord previous) +64
  
   Telerik.Web.UI.SpellChecker.CheckText() +171
  
   Telerik.Web.UI.SpellChecker.BadWordsJScript() +13
  
   Telerik.Web.UI.SpellCheckHandler.ProcessSpellCheckRequest(HttpResponse response, SpellChecker checker, String text) +74
  
   Telerik.Web.UI.SpellCheckHandler.ProcessRequest(HttpContext context) +487
  
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
  
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
  
</pre></code>
  
  
  
                  </td>
  
               </tr>
  
            </table>
  
  
  
            <br>
  
  
  
            <hr width=100% size=1 color=silver>
  
  
  
            <b>Version Information:</b> Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
  
  
  
            </font>
  
  
  
    </body>
  
</html>
  
<!--
  
[ArgumentException]: No dictionary loaded. Set the DictionaryPath property from the spell checker settings or copy the dictionaries to ~/App_Data/RadSpell/
  
   at Telerik.Web.UI.Dictionaries.EditDistanceDictionary.Load(TextReader baseDictionaryReader, ICustomDictionarySource customSource, String cacheKey)
  
   at Telerik.Web.UI.SpellChecker.LoadDictionary()
  
   at Telerik.Web.UI.SpellChecker.get_dictionary()
  
   at Telerik.Web.UI.SpellChecker.CheckWord(String word, String sLastWord)
  
   at Telerik.Web.UI.TelerikSpellCheckProvider.CheckWord(ITextWord current, ITextWord previous)
  
   at Telerik.Web.UI.SpellChecker.CheckText()
  
   at Telerik.Web.UI.SpellChecker.BadWordsJScript()
  
   at Telerik.Web.UI.SpellCheckHandler.ProcessSpellCheckRequest(HttpResponse response, SpellChecker checker, String text)
  
   at Telerik.Web.UI.SpellCheckHandler.ProcessRequest(HttpContext context)
  
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
  
-->
when i test the RadSpell this error occures how could i solve this problem please help me.
Thank you.
Please Reply
Chandra
Top achievements
Rank 1
 answered on 30 Dec 2011
1 answer
103 views
Hello,

I have created one page which have Treeview and other controls. Child node data populating using web-service method.

 <ajaxToolkit:ToolkitScriptManager runat="server" ID="RadScriptManager1" AsyncPostBackTimeout="18000">
</ajaxToolkit:ToolkitScriptManager>
<telerik:RadScriptBlock>
<script>
 var allowDragDrop = "<%= allowDragAndDrop%>";
            var SelectedType;
            function nodePopulating(sender, eventArgs) {
                var node = eventArgs.get_node();
                var context = eventArgs.get_context();
                SelectedType = document.getElementById('<%=hdnSelectedNodeType.ClientID %>').value;
                context["ParentID"] = node.get_value();
                context["AllowDragAndDrop"] = allowDragDrop;
                context["SelectedType"] = SelectedType;
            }
        </script>
</telerik:RadScriptBlock>

Treeview is located in one Update panel and Other controls are located in Second Update panel like below.
<div ID="Left">
  <asp:UpdatePanel ID="upLeft" runat="server" UpdateMode="Conditional">
       <ContentTemplate>
             <telerik:RadTreeView ID="tvNodes" runat="server" EnableDragAndDrop="false" ExpandAnimation-Type="OutExpo"
                                        ExpandAnimation-Duration="800" EnableDragAndDropBetweenNodes="false"
                                        CollapseAnimation-Type="OutElastic"
                                        CollapseAnimation-Duration="800" Skin="Windows7" OnNodeDrop="tvNodes_HandleDrop"
                                        OnNodeExpand="tvNodes_NodeExpand" OnNodeClick="tvNodes_Click"
                                        OnContextMenuItemClick="tvNodes_ContextMenuItemClick"
                                        OnClientContextMenuItemClicking="onClientContextMenuItemClicking"
                                        OnClientContextMenuShowing="onClientContextMenuShowing"
                                        OnClientNodeDropping="onNodeDropping"
                                        OnClientNodeDragging="OnClientNodeDragging"
                                        OnClientNodeClicked="OnClientNodeClicked"
                                        OnClientNodeClicking="OnClientNodeClicking"
                                        OnClientNodePopulating="nodePopulating">
                                        <ContextMenus>
                                            <telerik:RadTreeViewContextMenu ID="NodesTreeMenu" runat="server" CssClass="MenuGroup"
                                                Skin="Windows7">
                                                <CollapseAnimation Type="none" />
                                            </telerik:RadTreeViewContextMenu>
                                        </ContextMenus>
                                        <WebServiceSettings Path="../ManageNode.asmx" Method="GetNodes"></WebServiceSettings>
                                    </telerik:RadTreeView>
    </ContentTemplate>
   </asp:UpdatePanel>
</div>
<div id="right">
     <asp:UpdatePanel ID="upright" runat="server" UpdateMode="Conditional">
         <ContentTemplate>
           <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" ValidationGroup="surveyValidate" />
            .......................... <!-- Other Controls -->
         </ContentTemplate>
       </asp:UpdatePanel>
</div>

When I clicked on node then I have loaded selected node-data into the right side controls which is in upRight update panel, when I perform click "btnSave" then we are updating node information and then call upleft.Update() to update treeview node,
after that If I want to populate child nodes for selected node then it will gives error like eventArgs.get_context() is null.

if upleft.Update()  is commented then perform above operation then the error is not occurred. But I have to update the Treeview information as well.

Please help me out why this error is occurred.

Thanks,
Mohmedsadiq Modan
Helen
Telerik team
 answered on 30 Dec 2011
1 answer
89 views
hi
i am trying to darg row from a grid into another grid, after dropping the row , the onRowdrop event is fired, but for first one in serverside  e.HtmlElement in undefined.

ASPX:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="grd_DrugItems">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugItems"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugGroup"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btn_NewGroup">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugItems"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugGroup"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                        <telerik:AjaxUpdatedControl ControlID="txt_GroupName" />
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugGroupMaster"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="grd_DrugGroupMaster">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugGroupMaster"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadButton1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugItems"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugGroup"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                        <telerik:AjaxUpdatedControl ControlID="grd_DrugGroupMaster"
                            LoadingPanelID="MasterAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
    <div style="direction:ltr; width:770px; height:340px; margin:auto; margin-top:5px; background-image:url('Images/GroupBackground.png'); background-repeat:repeat-x; border-style:solid; border-width:1px; border-color:RGB(7,45,75);">
            <div id="HeaderSeprator" style="direction:rtl;background-image:url('Images/bg_foot_forms.gif'); background-position:bottom; width:95%; height:23px; margin:auto; background-repeat:no-repeat;">
                <p style="direction:rtl; margin:auto; width:-moz-max-content; margin-top:5px; font-family:Tahoma; font-size:12px; color:White;">
                    Please drag and drop
                </p>
            </div>
            <div id="ContainsGridDrugList" style="float:left; padding-left:10px; padding-right:1px; width:370px;height:270px; direction:ltr;">
                <p class="HeaderTextDrugList">
               drugs in pharmacy
                </p>
            <telerik:RadGrid ID="grd_DrugItems" runat="server" GridLines="None" Width="365px"
                onneeddatasource="grd_DrugItems_NeedDataSource" AutoGenerateColumns="False"
                    onrowdrop="grd_DrugItems_RowDrop" AllowMultiRowSelection="True">
                <ClientSettings AllowRowsDragDrop="True">
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
                    <ClientEvents OnMasterTableViewCreated="MasterTableViewGrids_Created"
                        OnRowDropping="onRowDropping" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="200px" />
                </ClientSettings>
                <MasterTableView DataKeyNames="DrugId" TableLayout="Fixed" Width="100%" >
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn Display="False"
                            FilterControlAltText="Filter col_DrugId column" UniqueName="col_DrugId">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DrugForm" HeaderText="Form"
                            UniqueName="col_DrugForm">
                            <HeaderStyle Width="70px" HorizontalAlign="Left"/>
                            <ItemStyle HorizontalAlign="Left" Wrap="False" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DrugName" HeaderText="Name"
                            UniqueName="col_DrugName">
                            <HeaderStyle Width="205px" HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" Wrap="False" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DrugDose" HeaderText="Dose"
                            UniqueName="col_DrugDose">
                            <HeaderStyle Width="70px" HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" Wrap="False" />
                        </telerik:GridBoundColumn>
                    </Columns>
 
                <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                </EditFormSettings>
                </MasterTableView>
                <FilterMenu EnableImageSprites="False"></FilterMenu>
                <HeaderStyle  HorizontalAlign="Left"/>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
            </telerik:RadGrid>               
            </div>
 
            <div id="ContainsGridGroupDrug" style=" float:right; padding-left:1px; padding-right:10px; width:370px; height:270px; direction:ltr">
                <p class="HeaderTextDrugList">
 drugs in group
                </p>
            <telerik:RadGrid ID="grd_DrugGroup" runat="server" AutoGenerateColumns="False"
                CellSpacing="0" GridLines="None" onneeddatasource="grd_DrugGroup_NeedDataSource"
                onrowdrop="grd_DrugGroup_RowDrop" Width="365px" AllowMultiRowSelection="True">
                <PagerStyle Mode="NumericPages" />
                <ClientSettings AllowRowsDragDrop="True">
                    <Selecting AllowRowSelect="True" />
                    <ClientEvents OnMasterTableViewCreated="MasterTableViewGrids_Created" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"
                        ScrollHeight="200px" />
                </ClientSettings>
                <MasterTableView DataKeyNames="DrugId" TableLayout="Fixed" Width="100%">
                    <Columns>
                        <telerik:GridBoundColumn Display="False"
                            FilterControlAltText="Filter col_DrugId column" UniqueName="col_DrugId">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DrugForm" HeaderText="Form"
                            UniqueName="col_DrugForm">
                            <HeaderStyle Width="70px" HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" Wrap="False" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DrugName" HeaderText="Name"
                            UniqueName="col_DrugName">
                            <HeaderStyle Width="205px" HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" Wrap="False" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="DrugDose" HeaderText="Dose"
                            UniqueName="col_DrugDose">
                            <HeaderStyle Width="70px" HorizontalAlign="Left" />
                            <ItemStyle HorizontalAlign="Left" Wrap="False" />
                        </telerik:GridBoundColumn>
                    </Columns>
                <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                </EditFormSettings>
                </MasterTableView>
                <HeaderStyle HorizontalAlign="Left"/>
            <FilterMenu EnableImageSprites="False"></FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
            </telerik:RadGrid>
                        </div>
 
            <div id="GroupCommands" style="float:left;margin-top:1px; margin-bottom:0px; bottom:0px; position:relative; width:100%; height:40px; border-top-style:solid; border-top-width:1px; border-top-color:RGB(7,45,75); background-color:White;">
               <div id="DivGroupNameTextBox" style="float:right; direction:rtl; width:400px; padding-top:10px; padding-right:10px;">
                    <telerik:RadTextBox ID="txt_GroupName" runat="server" Width="300px"
                        Label="نام گروه:" >
                    </telerik:RadTextBox>
                </div>
                <div style="height:39px; float:right; width:200px;">
                    <telerik:RadButton ID="btn_NewGroup" runat="server" Text="RadButton"
                        Width="32px" Height="32px" CssClass="CommandImageButton"
                        onclick="btn_NewGroup_Click">
                        <Image ImageUrl="Images/Icons/PublicCommand/Save32.png" />
                    </telerik:RadButton>
                    <telerik:RadButton ID="Btn_RecycleBin" runat="server" Text="RadButton" Width="32px" Height="32px" CssClass="CommandImageButton">
                        <Image ImageUrl="Images/Icons/PublicCommand/RecycleBin32.png" />
                    </telerik:RadButton>
                </div>
                <asp:Button ID="Button1" runat="server" Text="Button" />
                <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton"
                        Width="32px" Height="32px" >
                        <Image ImageUrl="Images/Icons/PublicCommand/Save32.png"  IsBackgroundImage="true"/>
                </telerik:RadButton>
            </div>               
        </div>   
        <br />
        <div style="direction:ltr">
         
            <telerik:RadGrid ID="grd_DrugGroupMaster" runat="server" CellSpacing="0"
                GridLines="None" onneeddatasource="grd_DrugGroupMaster_NeedDataSource"
                AutoGenerateColumns="False" SkinID="LTRSkin"
                ondetailtabledatabind="grd_DrugGroupMaster_DetailTableDataBind">
                <ClientSettings>
                    <ClientEvents OnMasterTableViewCreated="MasterTableViewGrids_Created" />
                </ClientSettings>
            <MasterTableView DataKeyNames="GroupId" ClientDataKeyNames="GroupId">
                <DetailTables>
                    <telerik:GridTableView runat="server"
                        ClientDataKeyNames="DrugGroupMasterID,DrugGroupDetailID"
                        DataKeyNames="DrugGroupMasterID,DrugGroupDetailID" AllowPaging="True"
                        NoDetailRecordsText="دارویی در این گروه قرار داده نشده است">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridBoundColumn DataField="DrugForm"
                                FilterControlAltText="Filter col_DrugForm column" HeaderText="Form"
                                UniqueName="col_DrugForm">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DrugName"
                                FilterControlAltText="Filter col_DrugName column" HeaderText="Name"
                                UniqueName="col_DrugName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DrugDose"
                                FilterControlAltText="Filter col_DrugDose column" HeaderText="Dose"
                                UniqueName="col_DrugDose">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DrugGroupMasterID" Display="False"
                                FilterControlAltText="Filter col_DrugGroupMasterID column"
                                HeaderText="DrugGroupMasterID" UniqueName="col_DrugGroupMasterID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="DrugGroupDetailID" Display="False"
                                FilterControlAltText="Filter col_DrugGroupDetailID column"
                                HeaderText="DrugGroupDetailID" UniqueName="col_DrugGroupDetailID">
                            </telerik:GridBoundColumn>
                        </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
                     </telerik:GridTableView>
                </DetailTables>
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="DrugGroupMasterID" MasterKeyField="GroupId" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridBoundColumn DataField="GroupId"
                        FilterControlAltText="Filter col_GroupId column" HeaderText="Group Id"
                        UniqueName="col_GroupId">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="GroupName"
                        FilterControlAltText="Filter col_GroupName column" HeaderText="Group Name"
                        UniqueName="col_GroupName">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <FilterMenu EnableImageSprites="False"></FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
    </telerik:RadGrid>
 
        </div>
    <br />
</asp:Content>
C#:
private DrugInteractionEntities Context;       
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Context == null)
                Context = new DrugInteractionEntities();
 
            grd_DrugItems.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
            grd_DrugItems.MasterTableView.AllowPaging = false;
            grd_DrugItems.MasterTableView.ShowFooter = false;
            grd_DrugItems.MasterTableView.AutoGenerateColumns = false;
            grd_DrugItems.MasterTableView.Dir = GridTableTextDirection.LTR;
            grd_DrugItems.Skin = "Default";
            grd_DrugItems.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
 
            grd_DrugGroup.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
            grd_DrugGroup.MasterTableView.AllowPaging = false;
            grd_DrugGroup.MasterTableView.ShowFooter = false;
            grd_DrugGroup.MasterTableView.AutoGenerateColumns = false;
            grd_DrugGroup.MasterTableView.Dir = GridTableTextDirection.LTR;
            grd_DrugGroup.Skin = "Default";
            grd_DrugGroup.HeaderStyle.HorizontalAlign = HorizontalAlign.Left;
 
            if (this.IsPostBack == false)
            {
                grd_DrugGroupMaster.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                grd_DrugGroupMaster.MasterTableView.AllowPaging = false;
                grd_DrugGroupMaster.DataSource = Context.DrugGroupMasters;
                grd_DrugGroupMaster.MasterTableView.Dir = GridTableTextDirection.LTR;
 
                grd_DrugGroupMaster.MasterTableView.Attributes.Add("class", "RadGrid RadGrid_Web20");
 
                grd_DrugGroupMaster.MasterTableView.DetailTables[0].DataSource = Context.DrugGroupDetails;
                grd_DrugGroupMaster.MasterTableView.DetailTables[0].Dir = GridTableTextDirection.LTR;
 
            }
 
        }
 
        protected void grd_DrugItems_RowDrop(object sender, GridDragDropEventArgs e)
        {
            IList<DrugList> _groupingDrugList = GroupingDrugList;
 
            if (string.IsNullOrEmpty(e.HtmlElement))
            {
                if (e.DraggedItems[0].OwnerGridID == grd_DrugItems.ClientID)
                {
                    // Drugs drag from drugitemGrid to GroupGrid
                    int destinationIndex = -1;
                    foreach (GridDataItem draggedItem in e.DraggedItems)
                    {
 
                        int dragDrugId = Convert.ToInt32(draggedItem.GetDataKeyValue("DrugId"));
                        if (GroupingDrugListContains(_groupingDrugList, dragDrugId))
                            continue;
                        DrugList dl = Context.DrugLists.Where(d => d.DrugId == dragDrugId).First();
                        int ItemIndex = (e.DestDataItem == null ? 0 : e.DestDataItem.ItemIndex);
                        _groupingDrugList.Insert(ItemIndex, dl);
 
                    }
 
                    GroupingDrugList = _groupingDrugList;
                    grd_DrugGroup.Rebind();
                }
            }
        }
        protected void grd_DrugGroup_RowDrop(object sender, GridDragDropEventArgs e)
        {
            if(String.IsNullOrEmpty(e.HtmlElement) && e.HtmlElement=="Btn_RecycleBin")
            {
                 
                IList<DrugList> _groupingDrugList = GroupingDrugList;
                foreach (GridDataItem draggedItem in e.DraggedItems)
                {
                    int dragDrugId = Convert.ToInt32(draggedItem.GetDataKeyValue("DrugId"));
                    GroupingDrugListRemoveById(_groupingDrugList, dragDrugId);
                }
                this.GroupingDrugList = _groupingDrugList;
                this.grd_DrugGroup.Rebind();
            }
 
        }
 
        protected void grd_DrugItems_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            grd_DrugItems.DataSource = Context.DrugLists;
        }
 
        protected void grd_DrugGroup_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            grd_DrugGroup.DataSource = GroupingDrugList;           
        }
 
        protected IList<DrugList> GroupingDrugList
        {
            get
            {
                try
                {
                    object obj = Session["GroupingDrugList"];
                    if(obj==null)
                    {
                        Session["GroupingDrugList"] = obj = new List<DrugList>();
                    }                   
                    return (IList<DrugList>) obj;
                }
                catch
                {
                    Session["GroupingDrugList"] = null;
                }
                return new List<DrugList>();
            }
            set { Session["GroupingDrugList"] = value; }           
        }
 protected void btn_NewGroup_Click(object sender, EventArgs e)
        {
            DrugGroupMaster DGM = new DrugGroupMaster() {GroupName = txt_GroupName.Text};
            for (int i = 0; i < this.GroupingDrugList.Count; i++)
            {
                DrugGroupDetail DGD = new DrugGroupDetail();
 
                DGD.DrugId = this.GroupingDrugList[i].DrugId;
                DGD.DrugGroupDetailID = i;
                DGM.DrugGroupDetails.Add(DGD);
            }
            Context.AddToDrugGroupMasters(DGM);
            Context.SaveChanges();
 
            this.GroupingDrugList = null;
        }
 
        protected void grd_DrugGroupMaster_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (e.IsFromDetailTable == false)
            {
                grd_DrugGroupMaster.MasterTableView.DataSource = Context.DrugGroupMasters;
            }
        }
        protected void grd_DrugGroupMaster_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem) e.DetailTableView.ParentItem;
            int groupMasterId = Convert.ToInt32(dataItem.GetDataKeyValue("GroupId"));
            grd_DrugGroupMaster.MasterTableView.DetailTables[0].DataSource =
                from drugDetail in Context.DrugGroupDetails
                where drugDetail.DrugGroupMasterID == groupMasterId
                select
                    new
                        {
                            drugDetail.DrugGroupMasterID,
                            drugDetail.DrugGroupDetailID,
                            drugDetail.DrugId,
                            drugDetail.DrugList.DrugForm,
                            drugDetail.DrugList.DrugName,
                            drugDetail.DrugList.DrugDose
                        };
        }
    }

Thank you
Antonio Stoilkov
Telerik team
 answered on 30 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?