Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
88 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
1 answer
55 views
Hi ,
I am experiencing strange behavior from  RadComboBox located inside Radgrid's edit form template,
if I used  inplace editmod  works.

I have 3 cascading combobox.
When I doing the second  postback (by combobox) fires the ItemCommand.
The  CommandName property lose values. Instead of "InitInsert" is  random .
The combo becomes empty and the EditMode becomes   inplace.

With the same code :
If I use GridEditMode.EditForms the second postback (generated by combos) fires itemCommand_events.
If i use GridEditMode.inPlace the second postback (generated by combos) don't fires itemCommand_events.



Can you send me an example of RadGrid ,GridEditMode.EditForms ,with cascading combobox loaded programmatically? (c #)

Thanks

Antonio Stoilkov
Telerik team
 answered on 30 Dec 2011
1 answer
66 views
Hi all,

I am trying the same thing in given url.
http://demos.telerik.com/aspnet-ajax/scheduler/examples/dbschedulerprovider/defaultvb.aspx

But i am not able to add web config file .

<telerik.web.ui>

        <radScheduler defaultAppointmentProvider="Integrated">

            <appointmentProviders>

                <add name="ReadOnlySchedulerData" type="Telerik.Web.Examples.Scheduler.MyDbSchedulerProvider"

                    connectionStringName="TelerikConnectionString"

                    persistChanges="true" />

            </appointmentProviders>

        </radScheduler>

    </telerik.web.ui>

Please give a sample for how to get data from database and display using radshedular. Please give me full sample code and how to display.

Thanks,
Dhamu.

Helen
Telerik team
 answered on 30 Dec 2011
1 answer
89 views
I'm getting the following error when I click on the edit link in my grid.  Any help would be appreciated.

Specified argument was out of the range of valid values.
Parameter name: index


Aspx:
<telerik:RadGrid ID="grdWebForm" CssClass="infoDisplayGrid" runat="server" Skin="Office2007"
                  AllowPaging="true" OnPageIndexChanged="grdWebForm_PageIndexChanged" 
                  OnPageSizeChanged="grdWebForm_OnPageSizeChanged" PageSize="25"
                  AllowSorting="true" OnSortCommand="grdWebForm_SortCommand" OnNeedDataSource="grdWebForm_NeedDataSource"  OnItemDataBound="grdWebForm_ItemDataBound" 
                  AutoGenerateColumns="false" 
                  OnUpdateCommand="grdWebForm_UpdateCommand" OnDeleteCommand="grdWebForm_DeleteCommand" OnInsertCommand="grdWeForm_InsertCommand" OnPreRender="grdWebForm_PreRender">        
     <PagerStyle AlwaysVisible="true" />
     <MasterTableView DataKeyNames="RTFieldQCId" EditMode="InPlace" CommandItemDisplay="Top">
         <Columns>
             <telerik:GridDropDownColumn UniqueName="FullName" HeaderText="Tech Name" DataField="TechId" ListValueField="TechId" ListTextField="FullName" DropDownControlType="DropDownList"></telerik:GridDropDownColumn>                      
             <telerik:GridBoundColumn  UniqueName="LegacyMeterSerial" SortExpression="LegacyMeterSerial" HeaderText="Legacy Meter #" DataField="LegacyMeterSerial"></telerik:GridBoundColumn>
               
             <telerik:GridDateTimeColumn UniqueName="QCDate" PickerType="DatePicker" HeaderText="Date" DataField="QCDate" DataFormatString="{0:MM/dd/yyyy}"  EditDataFormatString="MMMM dd">
                 <ItemStyle Width="120px" />
             </telerik:GridDateTimeColumn>
             <telerik:GridNumericColumn UniqueName="Score" SortExpression="Score" HeaderText="Score" DataField="Score" ColumnEditorID="GridNumericColumnEditor1"></telerik:GridNumericColumn>
             <telerik:GridNumericColumn UniqueName="MaxScore" SortExpression="MaxScore" HeaderText="Max Score" DataField="MaxScore" ColumnEditorID="GridNumericColumnEditor1"></telerik:GridNumericColumn>
             <telerik:GridBoundColumn  UniqueName="Action" SortExpression="Action" HeaderText="Action" DataField="Action">
             </telerik:GridBoundColumn>                    
             <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn" CancelText="Cancel" EditText="Edit">
                 <HeaderStyle Width="85px"></HeaderStyle>
             </telerik:GridEditCommandColumn>        
             <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete"  /> 
         </Columns>
           
     </MasterTableView>
</telerik:RadGrid>          
     <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server">
     <NumericTextBox MaxLength="4" EmptyMessage="Ext." runat="server">
         <NumberFormat GroupSeparator="," />
     </NumericTextBox>
 </telerik:GridNumericColumnEditor>

CodeBehind:
protected void grdWebForm_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
 {
     //if (rt_table != string.Empty)
     //{
         grdWebForm.DataSource = GetWebFormData();
     //}
 }
 protected void grdWebForm_ItemDataBound(object sender, GridItemEventArgs e)
 {
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)
     {
         GridEditableItem editedItem = e.Item as GridEditableItem;
         GridEditManager editMan = editedItem.EditManager;
         GridDropDownColumnEditor editor = editMan.GetColumnEditor("FullName") as GridDropDownColumnEditor;
         List<TechInfo> techList = BuildTechSelectLists(false);
         editor.DataSource = techList; // BuildTechSelectLists(false);
         editor.DataTextField = "FullName";
         editor.DataValueField = "UserId";
         editor.DataBind();
     }
     if (e.Item is GridDataItem)
     {
         GridDataItem item = (GridDataItem)e.Item;
         DataRowView row = (DataRowView)e.Item.DataItem;
         item["FullName"].Text = row["FullName"].ToString();
     }
 }
public DataTable GetWebFormData()
 {
     SqlConnection connection = new SqlConnection(
     ConfigurationManager.ConnectionStrings["ProFieldMeter"].ConnectionString);
     DataTable dt = new DataTable();
     string strquery = "Select qc.RTFieldQCID,qc.TechId,qc.LegacyMeterSerial,qc.QCDate,qc.Score,qc.MaxScore,qc.Attachment,qc.Action, u.Lastname + ', ' + u.FirstName as FullName FROM RTFieldQC qc left join ProFieldCore.dbo.ProfieldUser u on qc.TechId = u.UserId";
     SqlDataAdapter adapter = new SqlDataAdapter(strquery, connection);
     adapter.Fill(dt);
     return dt;
 }
Antonio Stoilkov
Telerik team
 answered on 30 Dec 2011
3 answers
81 views
can anyone tell me please if there are known issues with edit form column number being set.  All of my settings are working except for this one.  any assistance appreciated.  using the latest release and I cannot get the row of the dataset to break into columns.
<EditFormSettings ColumnNumber="2" CaptionDataField="Plaintiffs" CaptionFormatString="Edit Single Record {0}"
                InsertCaption="New Product">
                <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                    Width="100%" />
                <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                <EditColumn ButtonType="PushButton" UpdateText="Update record"
                    UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                </EditColumn>
                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
            </EditFormSettings>
regina
Top achievements
Rank 1
 answered on 30 Dec 2011
6 answers
139 views
Hi,

I'm using RadEditor (telerik v 2010.2.826.35) in my aspx pages. i have customized its default font to Calibri. So, when the  user clicks in the editor to type something, the default font sets to Calibri. Now, i save the content in the editor in database. When I checked the DB entry, I found that the default font (Calibri) is not stored in DB. However, if i change the font in editor while writing, that very font details is stored in the DB.

My requirement is that text entered in the editor should be stored with the default styling as well if no customization is done and not just for customized style.

Can you please suggest me something?


Thanks

Sumit
Rumen
Telerik team
 answered on 30 Dec 2011
1 answer
98 views
I am trying to use the chart control, but things are not going as expected.  I have entered the Data from my query with the columns of data from what i expect to be the smallest to largest.  In the building process DataYColumn = 1, DataYColumn2 = 2,and DataYColumn3 = 4396.  All I end up seeing is one line of data in the Legend and nothing is stacked.

 

 

 

 

 

<telerik:RadChart ID="RadChart3" runat="server" DefaultType="StackedBar100"
        SeriesOrientation="Horizontal" ChartImageFormat="Jpeg"
        DataSourceID="AccessDataSource4" Skin="BabyBlue" Width="500px">
        <Appearance>
            <FillStyle MainColor="239, 255, 254">
            </FillStyle>
            <Border Color="188, 229, 231" Width="8" />
        </Appearance>
        <Series>
<telerik:ChartSeries Name="" Type="StackedBar100" DataLabelsColumn="contactdate By Month"
                DataYColumn="Expr1" DataYColumn2="Sum Of contactdates_custno"
                DataYColumn3="CountOfcustsales">
    <Appearance>
        <FillStyle FillType="Solid" MainColor="194, 230, 252">
        </FillStyle>
        <TextAppearance TextProperties-Color="78, 168, 188">
        </TextAppearance>
        <Border Color="177, 215, 250" />
    </Appearance>
            </telerik:ChartSeries>
</Series>
        <Legend>
            <Appearance Corners="Round, Round, Round, Round, 6"
                Dimensions-Margins="20%, 3%, 1px, 1px">
                <ItemTextAppearance TextProperties-Color="120, 162, 19">
                </ItemTextAppearance>
                <Border Color="194, 212, 109" />
            </Appearance>
        </Legend>
        <PlotArea>
            <XAxis>
                <Appearance Color="226, 218, 202" MajorTick-Color="216, 184, 86"
                    ValueFormat="Percent">
                    <MajorGridLines Color="244, 227, 195" Width="0" />
                    <TextAppearance TextProperties-Color="78, 168, 188">
                    </TextAppearance>
                </Appearance>
                <AxisLabel>
                    <Appearance RotationAngle="270">
                    </Appearance>
                    <TextBlock>
                        <Appearance TextProperties-Color="78, 168, 188">
                        </Appearance>
                    </TextBlock>
                </AxisLabel>
            </XAxis>
            <YAxis>
                <Appearance Color="226, 218, 202" MajorTick-Color="216, 184, 86"
                    MinorTick-Color="216, 184, 86">
                    <MajorGridLines Color="244, 227, 195" />
                    <MinorGridLines Color="244, 227, 195" />
                    <TextAppearance TextProperties-Color="78, 168, 188">
                    </TextAppearance>
                </Appearance>
                <AxisLabel>
                    <Appearance RotationAngle="0">
                    </Appearance>
                    <TextBlock>
                        <Appearance TextProperties-Color="78, 168, 188">
                        </Appearance>
                    </TextBlock>
                </AxisLabel>
            </YAxis>
            <YAxis2>
                <AxisLabel>
                    <Appearance RotationAngle="0">
                    </Appearance>
                </AxisLabel>
            </YAxis2>
            <Appearance Dimensions-Margins="20%, 24%, 12%, 10%">
                <FillStyle MainColor="255, 249, 239" SecondColor="Transparent">
                </FillStyle>
                <Border Color="226, 201, 156" />
            </Appearance>
        </PlotArea>
        <ChartTitle>
            <Appearance Dimensions-Margins="4%, 10px, 10px, 7%">
                <FillStyle MainColor="">
                </FillStyle>
            </Appearance>
            <TextBlock Text="Customers Interested">
                <Appearance TextProperties-Color="232, 140, 0"
                    TextProperties-Font="Verdana, 20pt, style=Bold">
                </Appearance>
            </TextBlock>
        </ChartTitle>
    </telerik:RadChart>

Evgenia
Telerik team
 answered on 30 Dec 2011
4 answers
136 views
I have a radgrid that I am trying to setup a filter template for it.

The column is a checkbox column.  It is a bit field in the database.  
<telerik:GridCheckBoxColumn DataField="Requirement_Received" DataType="System.Boolean"
     HeaderText="Requirement Received?" SortExpression="Requirement_Received" UniqueName="Requirement_Received">
    <HeaderStyle Width="125px" />
 </telerik:GridCheckBoxColumn>

The end users want it to just be a dropdown box with All, Yes, No.  I have tried a few things with no luck.  

I have another column that displays a "Labor Estimate" for an int data type.
The end users would like to have a  drop down list with All, Less than 10, 10 to 40, and more than 40.  Is this possible to do also?
Antonio Stoilkov
Telerik team
 answered on 30 Dec 2011
6 answers
485 views
Hello,

I wonder If somebody knows how to create center align button in RadAlert ? I've tried some css tricks (.rwpopupbutton class) but without success :(

In the attachment there is a picture which describes my request:
Red rounded rectangle shows standard position of button.
Green rounded rectangle is what I need to achieve.

Could you help me please to solve this issue ?

Best regards

Vasssek
Roberto
Top achievements
Rank 1
 answered on 30 Dec 2011
4 answers
130 views
Hi,

i am working on telerik tree view with the following code

var tree = $find("<%= RadTreeView1.ClientID %>");
                        var node = tree.findNodeByText('str');                     
                        node.select();
                    
 var nodes = tree.get_allNodes();
                        for (var i = 0; i < nodes.length; i++) {                      
                            if (nodes[i].get_nodes().get_count() != 0 && nodes[i].get_text()!="") {                             
                                nodes[i].expand();
                            }
                        }

i want to search a node by text. then i want to expand all the tree and also need a click on searched node. above code is not working properly. please guide me.
i shall be very thankful to you for that.

Regards,

Faisal
Bozhidar
Telerik team
 answered on 30 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?