Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
155 views
I have been trying to figure out how to get the Click event of a button that  is created in an ITemplate for a menu item to bubble up to the top menu item layer.

I have a multi layer menu (for an intranet site, multiple top level and children/children layers)

Within one, I have created a 2nd generation child that spawns another child that has a custom template the adds a text box and a button for a quick entry method.

 MAIN MENU / IT / DO SOMETHING / (iTemplate Textbox + Button)

What I need is to be able to (hopefully) to capture the event at the menu item click event to handle the event in the same page and not in the ITemplate (I am able to intercept the click event in the ITemplate class)

The Menu Item Createion is a follows:

Dim _JobLines As New RadMenuItem
_JobLines.Text = "Clear Job Lines"


.Add(_JobLines) ' Adds to the parent menu

Dim _JobLinesTextBox As New RadMenuItem ' This is the menu item with the custom ITemplate instantiation
Dim _template As New Custom_Rad_Templates.TextBoxTemplate()
_template.InstantiateIn(_JobLinesTextBox)

_JobLines.Items.Add(_JobLinesTextBox)

ITemplate Class:

Class TextBoxTemplate
Implements ITemplate

Public Event Go_Click(sender As Object, e As EventArgs)

Public Sub InstantiateIn(ByVal container As Control)
Dim txtEntry As New TextBox()
txtEntry.ID = "txtEntry"
Dim cmdGo As New Button
cmdGo.ID = "cmdGo"
cmdGo.Text = "Go"


AddHandler cmdGo.Click, AddressOf cmdGo_Click
container.Controls.Add(txtEntry)
container.Controls.Add(cmdGo)

End Sub

Public Sub cmdGo_Click(sender As Object, e As EventArgs)

         RaiseEvent Go_Click(Me, e) ' (This is where I lose the event)
End Sub


Public Sub InstantiateIn1(container As Control) Implements ITemplate.InstantiateIn

End Sub
End Class


Im sure this has been done before, just cant find any clear help on the issue.

Thanks
Boyan Dimitrov
Telerik team
 answered on 30 Jan 2015
1 answer
214 views
Hello,

I'm having a lot of trouble figuring this out.  I have a web user control that loads inside a tabstrip tab.  This user control has a button on it.  When the user clicks on this button a RadPageView is loaded with another web user control as a modal popup window.  The modal window has several RadComboBoxes and a few RadTextBoxes.  I want to use a CustomValidator(s) to validate the combobox(s). If nothing has been selected the validation should fail.  The CustomValidator has the setting for ClientValidationFunction set for a JavaScript function.  I cannot get my code to execute the client-side validation function for the CustomValidator.

If anyone can help me figure this out I'd really appreciate it.  I've been struggling with this for the past week. 

Thanks.

The button and the validation summary are ajaxified within the RadAjaxManager that resides in the Master Page for the application:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" ClientIDMode="Static">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnAdd">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="btnAdd" />
                <telerik:AjaxUpdatedControl ControlID="pnlValidatorSummary" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

This is the markup for the RadWindow:
<telerik:RadWindowManager ID="rwmWindowManager" runat="server" EnableEmbeddedSkins="true" Skin="Metro" PreserveClientState="true">
    <Windows>
        <telerik:RadWindow ID="rdwAddNewAHU" runat="server" Modal="true" OnInit="rdwAddNewAHU_Init"
            Height="550" Width="600" Behaviors="Close" DestroyOnClose="true" ReloadOnShow="true" ShowContentDuringLoad="false" OnClientClose="OnClientClose">
            <ContentTemplate>
                <telerik:RadMultiPage ID="rmpAddNewAHU" runat="server" SelectedIndex="0">
                </telerik:RadMultiPage>
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
 
<asp:Button ID="btnAddNewAHU" runat="server" OnClientClick="openwin();return false" Text="Add New AHU" Visible="false" />
 
<telerik:RadScriptBlock ID="rsbInventory" runat="server">
    <script type="text/javascript">
        function openwin() {
            window.radopen(null, "rdwAddNewAHU");
        }
    </script>
</telerik:RadScriptBlock>

This is the code I use to load the RadPageView with the popup user control:
private void LoadMyUserControl(string controlName, Control parent)
{
    parent.Controls.Clear();
    RadPageView pageView = new RadPageView();
    UserControl ctrl = (UserControl)LoadControl(controlName);
    string userControlID = controlName.Split('.')[0];
    ctrl.ID = userControlID.Replace("/", "").Replace("~", "");
    pageView.Controls.Add(ctrl);
    parent.Controls.Add(pageView);
}
 
protected void rdwAddNewAHU_Init(object sender, System.EventArgs e)
{
    int roleID = ApplicationInformation.GetRoleID();
     
 
    switch (roleID)
    {
        case 1: //Read Only
            btnAddNewAHU.Visible = false;
            break;
        default: //Suggesters and Approvers
            btnAddNewAHU.Visible = true;
            LoadMyUserControl(@"~/Modules/EspsMT/wucInventoryAddAHU.ascx", rmpAddNewAHU);
            rdwAddNewAHU.OpenerElementID = btnAddNewAHU.ClientID;
            break;
    }           
}

This is the markup for my popup user control "wucInventoryAddAHU.ascx":
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="wucInventoryAddAHU.ascx.cs" Inherits="FACApps.Module.ESPSMT.wucInventoryAddAHU" %>
 
<telerik:RadScriptBlock ID="rsbInventory" runat="server">
    <script type="text/javascript">
    <!--Initialize the controls on the popup window during close-->
    function OnClientClose(sender, eventArgs) {
        var comboBoxes = ['cmbBuildings',
            'cmbAHUManufacturers',
            'cmbAHUTypes',
            'cmbAHUConfigurations',
            'cmbAHUHousingVersion',
            'cmbAHUSpecialUse',
            'cmbAHULocation',
            'cmbAHUCanisters',
            'cmbAHUCommissionMonth',
            'cmbAHUCommissionYear'];
 
        var textBoxes = ['txtAHUUnitTag',
            'txtAHUAccessRequirements',
            'txtAHUComments'];
 
        for (i in comboBoxes) {
            ctrl = comboBoxes[i];
            comboBox = $find(ctrl);
            comboBox.trackChanges();
            comboBox.get_items().getItem(0).select();
            comboBox.updateClientState();
            comboBox.commitChanges();
        }
 
        for (i in textBoxes) {
            ctrl = textBoxes[i];
            textBox = $find(ctrl);
            textBox.set_value(null);
        }
 
        document.getElementById('vsValidationSummary').style.display = 'none';
    }
 
    function clientValidationBuildings(sender, args) {
        if ($find("<%=cmbBuildings.ClientID%>") > 0) {
            alert("valid");
            arg.IsValid = true;
            }
            else {
            alert("not valid");
            arg.IsValid = false;
            }
        }
    </script>
</telerik:RadScriptBlock>
 
<div style="margin-left: 10px;">
    <asp:Panel ID="pnlValidatorSummary" runat="server">
        <asp:ValidationSummary ID="vsValidationSummary" runat="server" Width="480px" BorderStyle="None" ForeColor="Red" HeaderText="* Please enter required values." ClientIDMode="Static" ValidationGroup="vgp"></asp:ValidationSummary>
    </asp:Panel>
</div>
<div style="margin-left: 10px;">
    <p>Select a building:</p>
 
    <telerik:RadComboBox ID="cmbBuildings" runat="server" Width="480" MaxHeight="300" OnDataBound="cmbBuildings_DataBound" AllowCustomText="false" ClientIDMode="Static" NoWrap="true" ValidationGroup="vgp"></telerik:RadComboBox>
    <asp:CustomValidator ID="cv" ValidateEmptyText="true" ClientValidationFunction="clientValidationBuildings" EnableClientScript="true" ControlToValidate="cmbBuildings" runat="server" ValidationGroup="vgp">*</asp:CustomValidator>
 
 
    <hr />
 
    <p>Enter New Air Handler Unit Details:</p>
 
    <asp:Label runat="server">Air Handling Unit Tag:</asp:Label><telerik:RadTextBox ID="txtAHUUnitTag" runat="server" ClientIDMode="Static"></telerik:RadTextBox><br />
 
    <asp:Label runat="server">Select Manufacturer:</asp:Label><telerik:RadComboBox ID="cmbAHUManufacturers" runat="server" MaxHeight="150" OnDataBound="cmbAHUManufacturers_DataBound" AllowCustomText="false" ClientIDMode="Static" NoWrap="true"></telerik:RadComboBox>
    <br />
 
    <asp:Label runat="server">Select Type:</asp:Label><telerik:RadComboBox ID="cmbAHUTypes" runat="server" MaxHeight="150" OnDataBound="cmbAHUTypes_DataBound" AllowCustomText="false" ClientIDMode="Static" NoWrap="true"></telerik:RadComboBox>
 
    <br />
 
    <asp:Label runat="server">Select Configuration:</asp:Label><telerik:RadComboBox ID="cmbAHUConfigurations" runat="server" MaxHeight="150" OnDataBound="cmbAHUConfigurations_DataBound" AllowCustomText="false" ClientIDMode="Static" NoWrap="true"></telerik:RadComboBox>
 
    <br />
 
    <asp:Label runat="server">Select Housing Version:</asp:Label><telerik:RadComboBox ID="cmbAHUHousingVersion" runat="server" MaxHeight="150" OnDataBound="cmbAHUHousingVersion_DataBound" AllowCustomText="false" ClientIDMode="Static" NoWrap="true"></telerik:RadComboBox>
 
    <br />
 
    <asp:Label runat="server">Special Use:</asp:Label><telerik:RadComboBox ID="cmbAHUSpecialUse" runat="server" MaxHeight="150" ClientIDMode="Static" NoWrap="true">
        <Items>
            <telerik:RadComboBoxItem Text="--Select--" Value="-1" />
            <telerik:RadComboBoxItem Text="No" Value="0" />
            <telerik:RadComboBoxItem Text="Yes" Value="1" />
        </Items>
    </telerik:RadComboBox>
 
    <br />
 
    <asp:Label runat="server">Select Location:</asp:Label><telerik:RadComboBox ID="cmbAHULocation" runat="server" MaxHeight="150" OnDataBound="cmbAHULocation_DataBound" AllowCustomText="false" ClientIDMode="Static" NoWrap="true"></telerik:RadComboBox>
 
    <br />
 
    <asp:Label runat="server">Access Requirements:</asp:Label><telerik:RadTextBox ID="txtAHUAccessRequirements" runat="server" Rows="1" ClientIDMode="Static"></telerik:RadTextBox><br />
 
    <asp:Label runat="server">Canisters:</asp:Label><telerik:RadComboBox ID="cmbAHUCanisters" runat="server" MaxHeight="150" ClientIDMode="Static" NoWrap="true">
        <Items>
            <telerik:RadComboBoxItem Text="--Select--" Value="-1" />
            <telerik:RadComboBoxItem Text="0" Value="0" />
            <telerik:RadComboBoxItem Text="3" Value="3" />
        </Items>
    </telerik:RadComboBox>
 
    <br />
 
    <asp:Label runat="server">Comments:</asp:Label><telerik:RadTextBox ID="txtAHUComments" runat="server" Rows="5" ClientIDMode="Static"></telerik:RadTextBox><br />
 
    <asp:Label runat="server">Test/Commission Month:</asp:Label><telerik:RadComboBox ID="cmbAHUCommissionMonth" runat="server" MaxHeight="150" OnDataBound="cmbAHUCommissionMonth_DataBound" AllowCustomText="false" ClientIDMode="Static" NoWrap="true"></telerik:RadComboBox>
 
    <br />
 
    <asp:Label runat="server">Year:</asp:Label><telerik:RadComboBox ID="cmbAHUCommissionYear" runat="server" MaxHeight="150" OnDataBound="cmbAHUCommissionYear_DataBound" AllowCustomText="false" ClientIDMode="Static" NoWrap="true"></telerik:RadComboBox>
 
    <br />
 
    <asp:Button ID="btnAdd" runat="server" Text="Enter Air Handler" OnClick="btnAdd_Click" CausesValidation="true" ValidationGroup="vgp" />
</div>

This is the server-side code for the button 'btnAdd':
protected void btnAdd_Click(object sender, EventArgs e)
{
    if (Page.IsValid)
    {
        int roleID = ApplicationInformation.GetRoleID();
        switch (roleID)
        {
            case 3: // Suggesters
            case 5: // Suggesters
                //Perform some task
                break;
            case 7: // Approvers
            case 9: // Approvers
                //Perform some task
                break;
        }
    }
}









Shawn
Top achievements
Rank 1
 answered on 30 Jan 2015
15 answers
590 views
Hi,

I am using telerik dropdowntree with webservice binding as suggested in this link http://demos.telerik.com/aspnet-ajax/dropdowntree/examples/populatingwithdata/webserviceandclienttemplates/defaultcs.aspx

My requirement is to get selected item from database and show selected item in dropdowntree with webservice  demand on load. I need solution to this as soon as possible, could you please suggest a way?
Ivan Danchev
Telerik team
 answered on 30 Jan 2015
1 answer
140 views
Hi

the radrotator control has the funcionality of responsive ,the properties set height &width  equal percentage

greats
Slav
Telerik team
 answered on 30 Jan 2015
4 answers
237 views
I will add code samples if necessary, but I'm hoping someone else recognizes this problem and found a solution.

I am updating the filtering of an Asp.net DataView and then binding the chart to it, but it never refreshes with the new data.

I did get a client side script to do a repaint, and I can see it repaint after the DataBind, but still no new data results showing up.

Thanks in advance for any insight or help.

-Rick
Danail Vasilev
Telerik team
 answered on 30 Jan 2015
1 answer
151 views
Hi, 

we are pro grammatically creating Radgrid and we also have multi headers in some columns.
When filter is applied then all other single header columns shows filter menu but multi header columns does not show filter menu when click on filter button

please let me know what i my doing any wrong or whether we can not applied filter to multi header column


Column definition code is below

RadGrid1.ID = "gvTransaction";
        //RadGrid1.EnableViewState = false;
        RadGrid1.AutoGenerateColumns = false;
        RadGrid1.MasterTableView.DataKeyNames = Datakeys;
        RadGrid1.MasterTableView.HeaderStyle.Wrap = false;
        RadGrid1.MasterTableView.ItemStyle.Wrap = false;
        RadGrid1.MasterTableView.BorderWidth = 0;
        RadGrid1.CssClass = "RadGridCustomClass";
        RadGrid1.ShowFooter = true;
        RadGrid1.AlternatingItemStyle.BackColor = Color.White;
        RadGrid1.MasterTableView.EnableHierarchyExpandAll = false;
        RadGrid1.ClientSettings.Resizing.AllowRowResize = false;
        RadGrid1.EnableHeaderContextMenu = false;
        RadGrid1.EnableHeaderContextFilterMenu = false;
        RadGrid1.MasterTableView.AllowFilteringByColumn = true;

        RadGrid1.MasterTableView.Columns.Clear();
        RadGrid1.MasterTableView.ColumnGroups.Clear();
        RadGrid1.GroupingSettings.CaseSensitive = false;
        RadGrid1.AllowSorting = false;

        //RadGrid1.ClientSettings.Scrolling.EnableVirtualScrollPaging = true;
        RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = true;
        RadGrid1.ClientSettings.Scrolling.ScrollHeight = 230;
        RadGrid1.ClientSettings.Scrolling.ScrollBarWidth = 100;
        //RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 7;
        RadGrid1.Width = 1300;
        RadGrid1.ClientSettings.Scrolling.AllowScroll = true;
        RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(gvTransaction_NeedDataSource);
        RadGrid1.FilterCheckListItemsRequested += new GridFilterCheckListItemsRequestedEventHandler(gvTransaction_FilterCheckListItemsRequested);
        RadGrid1.PreRender += new EventHandler(gvTransaction_PreRender);
        RadGrid1.ItemCommand += new GridCommandEventHandler(gvTransaction_ItemCommand);

        //RadGrid1.EnableHeaderContextMenu = true;
        //RadGrid1.EnableHeaderContextFilterMenu = true;
        // RadGrid1.MasterTableView.ExportToExcel();
        RadGrid1.FilterType = GridFilterType.Combined;
        DataTable dtActivityOptionCodes = new DataTable();
        DataTable dtMVData = new DataTable();
        DataTable dtReadOnlyFields = new DataTable();
        try
        {
            for (int j = 0, indexNo = 0; j < tlmSettings.Count(); j++)
            //  for (int j = 0; j < tlmSettings.Count(); j++)
            {
                SeasonalTNAService.TLMSettings tlmSettingsgroup = new TLMSettings();
                tlmSettingsgroup.SeasonalTLMId = tlmSettings[j].SeasonalTLMId;
                var cboGroupedValues = objSeasonalTNAServiceClient.FetchSeasonalTLMGroupedValues(tlmSettingsgroup);

                if (cboGroupedValues.Count() > 0)
                {
                    MVTlmSettings[j].IsGrouped = 1;
                }
                if (tlmSettings[j].FieldTypeID == 352)
                {
                    TableItemStyle style = new TableItemStyle();


                    SeasonalTNAService.TLMSettings tlmSettingsObjs = new SeasonalTNAService.TLMSettings();
                    tlmSettingsObjs.FieldID = tlmSettings[j].CategoryId;
                    tlmSettingsObjs.CategoryId = 404;
                    tlmSettingsObjs.FieldTypeID = 352;
                    var cboMValues = objSeasonalTNAServiceClient.FetchMasterValues(tlmSettingsObjs);

                    SeasonalTNAService.TLMSettings tlmSettingsObjs1 = new TLMSettings();
                    tlmSettingsObjs1.CategoryValueId = 404;
                    tlmSettingsObjs1.SeasonalTLMId = tlmSettings[j].SeasonalTLMId;
                    tlmSettingsObjs1.MasterId = tlmSettingsObjs1.SeasonalTLMId;
                    var cboSavedMValues = objSeasonalTNAServiceClient.FetchSeasonalTLMMasterCboValues(tlmSettingsObjs1);


                    var result = cboMValues.Where(p => cboSavedMValues.Any(p2 => p.FieldValueID == p2.FieldValueID));

                    if (result.Count() > 0)
                    {
                        int executeOnce = 0;
                        GridColumnGroup columnGroup = new GridColumnGroup();
                        columnGroup.HeaderText = tlmSettings[j].Name;
                        columnGroup.Name = tlmSettings[j].Name;
                        columnGroup.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                        RadGrid1.MasterTableView.ColumnGroups.Add(columnGroup);
                        RadGrid1.MasterTableView.ExpandCollapseColumn.Visible = true;
                        int k = 0;
                        foreach (var item in result)
                        {
                            var column = new GridBoundColumn
                            {
                                HeaderText = item.FieldValue,
                                DataField = tlmSettings[j].Name + "$_" + item.FieldValue,
                                ColumnGroupName = tlmSettings[j].Name,
                                //DataMemberBinding = new Binding("Columns[" + _dynamicColumns + "]"),
                            };
                            //gvTransaction.Columns.Add(column);
                            column.FilterCheckListEnableLoadOnDemand = true;
                            RadGrid1.MasterTableView.Columns.Add(column);

                            TLMSettings tlm = new TLMSettings();
                            tlm.SeasonalTLMId = tlmSettings[j].SeasonalTLMId;
                            tlm.SeasonalTemplateId = tlmSettings[j].SeasonalTemplateId;
                            tlm.SeasonalActivityId = tlmSettings[j].SeasonalActivityId;
                            tlm.TLMValueId = tlmSettings[j].TLMValueId;
                            tlm.TLMId = tlmSettings[j].TLMId;
                            tlm.SubModuleId = tlmSettings[j].SubModuleId;
                            tlm.CategoryId = tlmSettings[j].CategoryId;
                            tlm.HierarchyHeaderId = tlmSettings[j].SubModuleId;
                            tlm.HierarchyId = tlmSettings[j].HierarchyId;
                            tlm.FieldCode = tlmSettings[j].FieldCode;
                            tlm.FieldType = "DEC";//tlmSettings[j].FieldType;               -
                            tlm.Calculation = tlmSettings[j].Calculation;
                            tlm.Name = item.FieldValue;
                            tlm.Formula = tlmSettings[j].Formula;
                            tlm.PreviousActivityID = tlmSettings[j].PreviousActivityID;
                            tlm.PreviousActivityFieldId = tlmSettings[j].PreviousActivityFieldId;
                            tlm.MasterFieldId = tlmSettings[j].CategoryId;
                            tlm.OrderNo = tlmSettings[j].OrderNo;
                            // tlm.TLMValSubId = Convert.ToString(dr["tlm_value_id_sub_module_id"]);
                            tlm.FieldTypeID = tlmSettings[j].FieldTypeID;

                            tlm.TLMValueCode = tlmSettings[j].TLMValueCode;
                            tlm.TotalCalculation = tlmSettings[j].TotalCalculation;
                            tlm.RowCalculation = tlmSettings[j].RowCalculation;
                            tlm.ColumnCalculation = tlmSettings[j].ColumnCalculation;
                            tlm.PlanCompletion = tlmSettings[j].PlanCompletion;
                            tlm.ActualCompletion = tlmSettings[j].ActualCompletion;
                            tlm.IsSubHeader = 1;
                            tlm.MasterFieldName = tlmSettings[j].Name;
                            var items = from elem in MVTlmSettings
                                        where elem.Name == tlmSettings[j].Name
                                        select elem;


                            if (executeOnce == 0)
                            {
                                foreach (var x in items)
                                {

                                    indexNo = MVTlmSettings.IndexOf(x);
                                }

                                if (indexNo + k != 0)
                                {
                                    MVTlmSettings.RemoveAt(indexNo + k);
                                }

                                executeOnce++;
                            }
                            if (MVTlmSettings.Count() < (indexNo + k))
                            {
                                MVTlmSettings.Add(tlm);
                            }
                            else
                            {
                                MVTlmSettings.Insert(indexNo + k, tlm);
                            }


                            dtActivityOptionCodes.Columns.Add(tlmSettings[j].Name + "$_" + item.FieldValue);
                            dtMVData.Columns.Add(tlmSettings[j].Name + k);

                            if (dtMVData.Rows.Count > 0)
                            {
                                dtMVData.Rows[0][tlmSettings[j].Name + k] = item.FieldValue;
                            }
                            else
                            {
                                DataRow dr = dtMVData.NewRow();
                                dr[tlmSettings[j].Name + k] = item.FieldValue;
                                dtMVData.Rows.Add(dr);
                            }
                            k++;
                        }
                    }
                    else
                    {
                        var column = new GridBoundColumn
                        {
                            HeaderText = tlmSettings[j].Name,
                            DataField = tlmSettings[j].Name

                        };
                        //column.FilterTemplate = n
                        column.AutoPostBackOnFilter = true;
                        column.CurrentFilterFunction = GridKnownFunction.Contains;
                        column.FilterCheckListEnableLoadOnDemand = true;
                        RadGrid1.MasterTableView.Columns.Add(column);
                        dtActivityOptionCodes.Columns.Add(tlmSettings[j].Name);
                        dtMVData.Columns.Add(tlmSettings[j].Name);
                    }
                }
                else
                {
                    var column = new GridBoundColumn
                    {
                        HeaderText = tlmSettings[j].Name,
                        DataField = tlmSettings[j].Name

                    };
                    column.AutoPostBackOnFilter = true;
                    column.CurrentFilterFunction = GridKnownFunction.Contains;
                    column.FilterCheckListEnableLoadOnDemand = true;
                    RadGrid1.MasterTableView.Columns.Add(column);
                    dtActivityOptionCodes.Columns.Add(tlmSettings[j].Name);
                    dtMVData.Columns.Add(tlmSettings[j].Name);
                }
                if (MVTlmSettings[j].IsSubHeader == 1)
                {
                    if (MVTlmSettings[j].FieldType == "INT")
                    {
                        dtActivityOptionCodes.Columns[MVTlmSettings[j].MasterFieldName + "$_" + MVTlmSettings[j].Name].DataType = typeof(System.Int32);
                    }
                    else if (MVTlmSettings[j].FieldType == "DEC")
                    {

                        dtActivityOptionCodes.Columns[MVTlmSettings[j].MasterFieldName + "$_" + MVTlmSettings[j].Name].DataType = typeof(System.Double);
                    }
                    else if (MVTlmSettings[j].FieldCode == "G004")
                    {

                        dtActivityOptionCodes.Columns[MVTlmSettings[j].MasterFieldName + "$_" + MVTlmSettings[j].Name].DataType = typeof(System.String);
                    }
                    //else if (MVTlmSettings[j].FieldType == "DATE")
                    //{

                    //    dtActivityOptionCodes.Columns[MVTlmSettings[j].Name].DataType = typeof(System.DateTime);
                    //}
                    else
                    {
                        dtActivityOptionCodes.Columns[MVTlmSettings[j].MasterFieldName + "$_" + MVTlmSettings[j].Name].DataType = typeof(System.String);
                    }
                }
                else
                {
                    if (MVTlmSettings[j].FieldType == "INT")
                    {
                        dtActivityOptionCodes.Columns[MVTlmSettings[j].Name].DataType = typeof(System.Int64);
                    }
                    else if (MVTlmSettings[j].FieldType == "DEC")
                    {

                        dtActivityOptionCodes.Columns[MVTlmSettings[j].Name].DataType = typeof(System.Double);
                    }
                    else if (MVTlmSettings[j].FieldCode == "G004")
                    {

                        dtActivityOptionCodes.Columns[MVTlmSettings[j].Name].DataType = typeof(System.String);
                    }
                    //else if (MVTlmSettings[j].FieldType == "DATE")
                    //{

                    //    dtActivityOptionCodes.Columns[MVTlmSettings[j].Name].DataType = typeof(System.DateTime);
                    //}
                    else
                    {
                        dtActivityOptionCodes.Columns[MVTlmSettings[j].Name].DataType = typeof(System.String);
                    }
                }
                if (!tlmSettings[j].FieldCode.StartsWith("T"))
                {
                    dtReadOnlyFields.Columns.Add(tlmSettings[j].Name);
                }
                if (tlmSettings[j].FieldCode.Equals("G004") && ddlActivityCompletion.SelectedValue == "224")
                {
                    dtReadOnlyFields.Columns.Remove(tlmSettings[j].Name);
                }
                if (tlmSettings[j].FieldCode.Equals("G006"))
                {
                    dtReadOnlyFields.Columns.Remove(tlmSettings[j].Name);
                }
                if (!tlmSettings[j].PreviousActivityID.Equals(-1))
                {
                    if (!dtReadOnlyFields.Columns.Contains(tlmSettings[j].Name))
                    {
                        dtReadOnlyFields.Columns.Add(tlmSettings[j].Name);
                    }
                }
                //if (tlmSettings[j].ActualCompletion.Equals(1))
                //{
                //    if (!dtReadOnlyFields.Columns.Contains(tlmSettings[j].Name))
                //    {
                //        dtReadOnlyFields.Columns.Add(tlmSettings[j].Name);
                //    }
                //}
                if (tlmSettings[j].FieldTypeID == 353 || tlmSettings[j].FieldTypeID == 354)
                {
                    if (!dtReadOnlyFields.Columns.Contains(tlmSettings[j].Name))
                    {
                        dtReadOnlyFields.Columns.Add(tlmSettings[j].Name);
                    }
                }
                if (tlmSettings[j].PlanCompletion.Equals(1))
                {
                    if (!dtReadOnlyFields.Columns.Contains(tlmSettings[j].Name))
                    {
                        dtReadOnlyFields.Columns.Add(tlmSettings[j].Name);
                    }
                }
            }



            //if (status == 1)
            //{
            var column1 = new GridBoundColumn
            {
                HeaderText = "STATUS",
                DataField = "STATUS"
            };
            RadGrid1.MasterTableView.Columns.Add(column1);
            dtActivityOptionCodes.Columns.Add("STATUS");
            dtMVData.Columns.Add("STATUS");

            logger.Error("Grid Structure Created");


            dtActivityOptionCodes.Columns.Add("HierarchyId");
            dtActivityOptionCodes.Columns.Add("TransactionStatusId");
            dtActivityOptionCodes.Columns.Add("Access");
            dtActivityOptionCodes.Columns.Add("TransStatusCategoryValueId");
            dtActivityOptionCodes.Columns.Add("TransStatusCategoryValueCode");

            dtMVData.Columns.Add("HierarchyId");
            dtMVData.Columns.Add("TransactionStatusId");
            dtMVData.Columns.Add("Access");
            dtMVData.Columns.Add("TransStatusCategoryValueId");
            dtMVData.Columns.Add("TransStatusCategoryValueCode");

            //ViewState["Vists"] = (int)ViewState["Vists"] + 1;
            ViewState["MVTlmSettings"] = MVTlmSettings;
            ViewState["tlmSettings"] = tlmSettings;
            ViewState["HierarchyOrder"] = HOrder;

            ViewState["dtColumns"] = dtActivityOptionCodes;
            ViewState["dtMVColumns"] = dtMVData;
            ViewState["ReadOnlyField"] = dtReadOnlyFields;
            this.PlaceHolder1.Controls.Add(RadGrid1);

        }
        catch (Exception ex)
        {
            logger.Error("Error while creating structure" + ex.Message.ToString());
            ShowError("MS00");
            logger.Error(ex.StackTrace.ToString());
        }

Thanks,
Madhavi   
Eyup
Telerik team
 answered on 30 Jan 2015
1 answer
129 views
Hi Team,

I am using Telerik Ajax q1 2013 version.(2013.1.403.40)
For Column Reorder according to this link http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/column-row-resize-reorder/defaultcs.aspx
In Grid I have given code like this
<telerik:RadGrid ID="rdgd1" runat="server">
         <MasterTableView TableLayout="Fixed" >
            ........
         </MasterTableView>
           <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true">
                   <Scrolling AllowScroll="True" UseStaticHeaders="true" SaveScrollPosition="True" ScrollHeight="240px"/>
                  <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="True"/>
             </ClientSettings>
</telerik:RadGrid>
Columns Reorder is working fine but Column headers are not Moving/Reordering. Am i missing any thing here, Can you please resolve my issue asap.
Thanks in advance.




Konstantin Dikov
Telerik team
 answered on 30 Jan 2015
2 answers
307 views
Hi,

I am trying to set specific series to certain colours and they are not being set and just revert to the default colours chosen by Telerik.

I am trying to set the specific colours with the following code:

            TimelineChart.PlotArea.Series[0].ColorField = "#8C1717";
            TimelineChart.PlotArea.Series[0].Name = "Very High Risks";
            TimelineChart.PlotArea.Series[1].ColorField = "red";
            TimelineChart.PlotArea.Series[1].Name = "High Risks";... and so forth

This is not working although I believe it should.  If I change the names of the series, I get the desired changes, it is just the colours that are not the desired ones.  

Any thoughts?


Danail Vasilev
Telerik team
 answered on 30 Jan 2015
1 answer
214 views
We have a problem in converting non English characters to pdf using RadEditor. Only English characters are getting converted while "#" is displaying in place of characters  like chinese, japanese etc when converted to pdf.

Tested characters:
Polish - ąćęłńóśźż
Japanese - あ い う え お か き く け こ さ し す せ そ が ぎ ぐ げ ご ぱ ぴ ぷ ぺ ぽ
Chinese - 二: 第二 二十 十二 老二

I also tested this in your latest Editor semo service. (http://demos.telerik.com/aspnet-ajax/editor/examples/import-export/pdf-export/defaultcs.aspx). Still same result is found.

Could you please suggest some workaround possible to resolve this issue.
Ianko
Telerik team
 answered on 30 Jan 2015
1 answer
144 views
hi,
     Can you please tell me that how we can use the RadGrid to create an interface like a spreadsheet?
or any other telerik control for doing the same.
and one more, want to use  tab index in grid by default vertically not a horizantally in spreadsheet grid.

thank you.
Pavlina
Telerik team
 answered on 30 Jan 2015
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?