Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
1.8K+ views
I have a RadGrid with a GridTemplateColumn like so:

<telerik:GridTemplateColumn HeaderText="Account" UniqueName="Account">
    <ItemTemplate>
        <div>
            <asp:DropDownList ID="ddlAccountLookup" Visible="false" runat="server">
            </asp:DropDownList>
            <asp:Label ID="grdAccountName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "AccountName") %>' /><br />
            <asp:Label ID="grdPhone" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Phone") %>' /><br />
            <asp:Label ID="grdEmail" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Email") %>' />
        </div>
    </ItemTemplate>
    <HeaderStyle CssClass="BigNormalBold" HorizontalAlign="Left" VerticalAlign="Bottom" />
    <ItemStyle CssClass="Normal" />
</telerik:GridTemplateColumn>


I need to find the ddlAccountLookup and make it Visible on PostBack, how would I go about doing this?

Thanks!
Swati
Top achievements
Rank 1
 answered on 24 Jul 2017
1 answer
48 views

Hello Support,

Currently we are using trial version of telerik.
We have Telerik reports, grids and charts in our application
We want to purchase the Telerik license for the application.
Could you please assist which product we should buy to fullfill our requirements and what is the process to buy the license.

Thanks and Regards

Sandip Katore

Imer
Telerik team
 answered on 24 Jul 2017
0 answers
182 views

Hiiii,

We have a Tree view and  clicking  "+"  uses the web service . How to call the web service explicitly  to expand that node and get it selected .

<telerik:RadTreeView ID="RadTreeViewBottom" runat="server" PersistLoadOnDemandNodes="false" RegisterWithScriptManager="true" 
        LoadingStatusPosition="None" OnClientNodeClicked="RadTreeViewBottom_ClientNodeClicked"
        OnClientKeyPressing="RadTreeViewBottom_ClientKeyPressing" EnableViewState="false"
        OnClientNodePopulating="RadTreeViewBottom_ClientNodePopulating" 
        OnClientLoad="RadTreeViewBottom_OnClientLoad"
        OnClientNodeDataBound="NodeDataBound" OnClientNodeExpanded="Expanded"
        Style="white-space: normal;">
        <WebServiceSettings Method="ViewerBottom_GetNodesChildren" Path="~/ScriptServices/ScriptService.asmx" />
        <Nodes>
            <telerik:RadTreeNode Text="ExistingNode" Visible="True"/>
        </Nodes>
    </telerik:RadTreeView>

 

 

Below one is the Webmethod which i use to call in the web service

[WebMethod(EnableSession=true)]
        public RadTreeNodeData[] ViewerBottom_GetNodesChildren(RadTreeNodeData node, object context)
        {
            IDictionary<string, object> contextDictionary = (IDictionary<string, object>)context;

            int topID = int.Parse(contextDictionary["TopID"].ToString());
            string type = contextDictionary["Type"].ToString();
            int parentID = 0;

            if (node != null)
                parentID = int.Parse(node.Value);
            object[] parms = new object[3];
            parms[0] = (int)topID;
            parms[1] = type;
            parms[2] = parentID;

            global::Viewer.ViewerService.Outline outline = (ViewerService.Outline)Data.WebServiceDataProvider.GetData(Data.ViewerClientServiceWrapper.MethodName.getOutline, parms);

            ViewerService.OutlineItem[] outlineItems = outline.ChildItems;

            List<RadTreeNodeData> result = new List<RadTreeNodeData>();

            foreach (ViewerService.OutlineItem item in outlineItems)
            {
                RadTreeNodeData nodeData = new RadTreeNodeData();

                nodeData.Text = item.Title;
                nodeData.Value = item.Id.ToString();
                nodeData.Attributes.Add("DocID", item.DocumentId);

                if (item.HasChildren)
                    nodeData.ExpandMode = TreeNodeExpandMode.WebService;

                result.Add(nodeData);
            }
            return result.ToArray();
        }

 

Below is my JS 1183 is parent node and 1185 is the child node.

var node1 = parentNode.findNodeByValue("1183");
                       if (node1 == null)
                           return;
                       else {
                           node1.expand();
                           var node2 = parentNode.findNodeByValue("1185");
                           if (node2 != null) {
                               node2.select();
                           }

in JS here node2 returns me null i think  because I'm not able to Call the Webservice ecplicitly can anyone suggest me ? how to call it programatically .

 

 

 

sanam
Top achievements
Rank 1
 asked on 22 Jul 2017
3 answers
588 views
Am using radgrid and creating it in aspx but on certain action i add more GridTemplateColumns to the grid.

    private void CreateDateColumns(List<DateTime> occurenceList)
    {
        if (occurenceList != null && occurenceList.Count > 0)
        {
            int index = 1;
            foreach (DateTime occurence in occurenceList)
            {
                string templateColumnName = occurence.Date.ToShortDateString();
                GridTemplateColumn templateColumn = new GridTemplateColumn();
                templateColumn.ItemTemplate = new MyTemplate(templateColumnName, index);
                grdStudentAttendanceList.MasterTableView.Columns.Add(templateColumn);
                templateColumn.HeaderText = templateColumnName;
                templateColumn.UniqueName = templateColumnName;
                
                index++;
            }
        }
    }

    private class MyTemplate : ITemplate
    {
        protected RadComboBox rcbAttendance;
        private string colname;
        private int _index;
        public MyTemplate(string cName, int index)
        {
            colname = cName;
            _index = index;
        }
        public void InstantiateIn(System.Web.UI.Control container)
        {
            rcbAttendance = new RadComboBox();
            rcbAttendance.Items.Add(new RadComboBoxItem("---Select---", "-1"));
            rcbAttendance.Items.Add(new RadComboBoxItem("Present", "1"));
            rcbAttendance.Items.Add(new RadComboBoxItem("Absent", "2"));
            rcbAttendance.Items.Add(new RadComboBoxItem("Leave", "3"));
            rcbAttendance.ID = "rcbAttendance" + _index;
            container.Controls.Add(rcbAttendance);
        }
    }

All are fine with creation but when i press save button or any combobox make postback the only dynamically generated columns content disappear and the other columns stay.
What i noticed that columns still in place with headertext but only content are disappeared (in my case content are comboboxes)

After enabling viewstate for grid only header text appear.

What should i do to keep columns contents after postback and get their values ?
Swati
Top achievements
Rank 1
 answered on 21 Jul 2017
1 answer
127 views

We would like add a custom attribute with a unique value to each option (<li>) in RadComboBox. Either the custom attribute needs to be added to <li> tag or add a <span> tag inside <li> tag and add custom attribute to <span> tag.

We load the options to ComboBox using web service. I read the Item Templates are not supported when we use a web service to populate RadComboBox with data so we assume adding a <span> tag with custom attribute is not possible.

Is there any way to achieve this?

<ul class="rcbList">

  <li class="rcbHovered">1</li>
  <li class="rcbItem">2</li>
  <li class="rcbItem">3</li>
  <li class="rcbItem">4</li>
  <li class="rcbItem">4</li>
  <li class="rcbItem">5</li>
 </ul>

Peter Milchev
Telerik team
 answered on 21 Jul 2017
2 answers
137 views
Hello,

I'm trying to build an application which allows the user to create filters and save them in a database to be used with SSIS.
I'm able to save and load the filter in base64 format and i can also get the generated SQL with the RadFilterSqlQueryProvider.

I have to make the initial parametrization of the application, and it has lots and lots of filters and criteria and I would like to use something like a spreadsheet to build the string, something like ([Field1] = '7' AND [Field2] = 8), save it directly to the database (MS SQL Server 2008) and have RadFilter parse those strings.
Then the user would be able to edit the filters and I wouldn't have to build them "manually" via webform. :)

I'm using VS2010 with ASP.Net Ajax Q1 2012 SP1

Can anyone show me the light? :)
Sérgio
Top achievements
Rank 1
 answered on 21 Jul 2017
6 answers
216 views
I have multiple links opening a radwindow that uses anchor tags.  sample code: NavigateUrl="~/controls/HostPages/SearchDetailed.aspx#casescale".  This was working initially then just stopped working.  If I open the url in a seperate browser the anchor tags work fine.

Any ideas?

Thanks in advance.
Ivan Danchev
Telerik team
 answered on 21 Jul 2017
8 answers
1.2K+ views
Evening
I have now spent 2 days trying all the logs I could find on the forum to resolve this.
When I debug the site locally it all runs fine, but when I publish to my azure web apps location the default.aspx page gives me a  Could not load file or assembly 'Telerik.Web.UI'

I have attached the website. It has no functionality, just a single default page with some controls.
All I need is for it to open up when published to the web.

Thank you
Theo
Vinod
Top achievements
Rank 1
 answered on 21 Jul 2017
0 answers
194 views

Hello,

i have a column in rad data grid which bind to property from TimeSpan type the kind of this column is template and i present the data in this format  HH:MM:SS, when hour present the total hours (more then 24) from this function:

protected string PrintTimeSpan(TimeSpan? time)
        {
            return time == null ? "N/A" : string.Format("{0}:{1}:{2}", (int) time.Value.TotalHours, time.Value.Minutes, time.Value.Seconds);
        }

 

I want to enable to filter this column when user input will be in same format currently when i enter input with more than 24 hours it throw error about the format, how i costume the action of some filters on template column (like "greater than" and "less than"), without to implement the section of filter template in myself.

in addition how i define validator on filter filed  to unable to enter string with wrong format, currently i can enter in this column filter of kind time span regular string and get error on page when try to filter

this is example of my column definition

01.<telerik:GridTemplateColumn DataField="AllGood" FilterControlAltText="Filter AllGood column" SortExpression="AllGood" UniqueName="AllGood" FilterControlWidth="70px">
02.                                <HeaderTemplate>
03.                                    <table style="width: 100%; text-align: center">
04.                                        <tr style="text-align: center">
05.                                            <td>
06.                                                <asp:Image runat="server" AlternateText="Status - All Good" ToolTip="Status - All Good" ImageAlign="Middle" Height="60px" Width="60px" ImageUrl='~/Images/Stations/Green.png' />
07.                                            </td>
08.                                        </tr>
09.                                    </table>
10.                                </HeaderTemplate>
11.                                <ItemTemplate>
12.                                    <asp:Label ID="AllGoodLabel" runat="server" Text='<%# PrintTimeSpan((TimeSpan?)Eval("AllGood")) %>'></asp:Label>
13.                                </ItemTemplate>
14.                            </telerik:GridTemplateColumn>

 

 

Adi
Top achievements
Rank 1
 asked on 20 Jul 2017
0 answers
121 views

I'm working on customizing advanced form of the scheduler.

I have been able to achieve the customization part using user controls (AdvancedForm, ResourceControl and MultipleValuesResourceControl).

I have two controls of single value resource control type and one control of multiple values resource control type. Find the screenshot depicting this.

My requirement involves replacing this multiple values resource control from check boxes to a multi-select combo box.

I tried replicating the current multiple values resource by adding a new user control, called it MultipleValuesDropDownResourceControl.ascx, registered it in AdvancedForm and tried making changes in the MultipleValuesDropDownResourceControl.cs file to replace with but I wasn't able to achieve this functionality. I wasn't able to even partly achieve this, hence I don't have any code to share.

Can anyone please provide some guidance on how a control type can be modified. 

Links I have referred to achieve customized advanced form - http://www.telerik.com/support/code-library/customize-the-advanced-form-with-the-advanced-template-user-controls

http://www.telerik.com/videos/aspnet-ajax/advanced-aspnet-ajax-scheduler-customization (tutorial I followed)

http://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/how-to/customize-the-advanced-form-template

Swetha
Top achievements
Rank 1
 asked on 20 Jul 2017
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?