Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
156 views
Hi all,

I am dynamically generating a RadGrid from code behind, which was perfectly working of retrieving the RadGrid Item data for hidden columns.

But, now I need to upgrade telerik version from "2011.1.413.35" to "2014.3.1209.35".

After doing this upgrade, the above method of retrieving the RadGrid Item data for hidden columns is not working, in other ways I am getting   in place of the value.

Here is my sample code to create grid:
I am putting xmldatasource to fill the RadGrid.

radGrid.MasterTableView.Columns.Add(_CreateColumn("ID", "", Unit.Percentage(0), false));

private GridBoundColumn _CreateColumn(string dataField, string text, Unit width, Boolean readOnly)
    {
        GridBoundColumn boundColumn = new GridBoundColumn();

        boundColumn.DataField           = dataField;
        boundColumn.HeaderText          = text;
        boundColumn.SortExpression      = boundColumn.DataField;
        boundColumn.HeaderStyle.Width   = width;
        boundColumn.ReadOnly            = readOnly;
        boundColumn.Visible             = (width.Value == 0 ? false : true);

        return boundColumn;
    }.

Sample code to retrieve item value:
RadGrid radGrid = (RadGrid)control;
foreach (GridDataItem grdItem in radGrid.Items)
{
     string ID = grdItem["ID"].Text;
}

But the ID =     which should be some value which I filled though xmldatasource.

Please provide some bunch of code or any kind of help will be appreciated.

Maria Ilieva
Telerik team
 answered on 29 Jan 2015
2 answers
130 views
Hi,

I am using a RadTreeList control and I want to set the selected property (checkbox) of a row, depending on a value from the datasource.
This is my code:

<telerik:RadTreeList ID="lstAanbod" runat="server" CssClass="_radgrid" OnNeedDataSource="lstAanbod_NeedDataSource" DataKeyNames="NR" ParentDataKeyNames="PARENT_NR" ClientDataKeyNames="DOSSIER_ID, PROFIEL_ID, GESELECTEERD"  EnableEmbeddedSkins="false" BorderStyle="None" GridLines="None" ShowFooter="true" AutoGenerateColumns="false" AllowMultiItemSelection="true">
    <ItemStyle HorizontalAlign="Left"></ItemStyle>
    <Columns>
        <telerik:TreeListSelectColumn HeaderStyle-Width="38px" UniqueName="SelectColumn"></telerik:TreeListSelectColumn>                   
        <telerik:TreeListBoundColumn HeaderStyle-Width="10%" DataField="CODE" HeaderText="Code"></telerik:TreeListBoundColumn>
        <telerik:TreeListBoundColumn HeaderStyle-Width="60%" DataField="TITEL" HeaderText="Titel"></telerik:TreeListBoundColumn>
        <telerik:TreeListBoundColumn HeaderStyle-Width="10%" DataField="NIVEAU" HeaderText="Niveau"></telerik:TreeListBoundColumn>
        <telerik:TreeListBoundColumn HeaderStyle-Width="10%" DataField="DOSSIER_ID" HeaderText="Niveau" Visible="false"></telerik:TreeListBoundColumn>
        <telerik:TreeListBoundColumn HeaderStyle-Width="10%" DataField="PROFIEL_ID" HeaderText="Niveau" Visible="false"></telerik:TreeListBoundColumn>     
    </Columns>         
    <ClientSettings Selecting-AllowItemSelection="true" Selecting-UseSelectColumnOnly="true" Selecting-AllowToggleSelection="true" ClientEvents-OnItemSelected="OnClientNodeSelected" ClientEvents-OnTreeListCreated="treeListCreated"></ClientSettings>     
</telerik:RadTreeList>


function UpdateAllChildren(currNode, nodes, nodecount, checked) {           
    var i;
    for (i = 0; i < nodecount; i++) {
        if (checked) {
            nodes[i].set_selected(true);
        }
        else {
            nodes[i].set_selected(false);
        }
    }
}
 
function treeListCreated(sender, args) {
    var items = sender.get_dataItems();
     
    for (var i = 0; i < items.length; i++) {
        var item = items[i];               
        if (item.get_dataKeyValue("GESELECTEERD") == "True") {                   
            item.set_selected(true);
        }
    }
}

However, when I run my page, I get an error on the line 'item_set_selected(true)' :

Unhandled exception at line 808, column 27 in http://localhost:11488/ScriptResource.axd? ...
0x800a138f - Runtime-fout JavaScript: Unable to get property '_selectedIndexes' of undefined or null referenced

What am I doing wrong?
Kostadin
Telerik team
 answered on 29 Jan 2015
1 answer
178 views
Hey !

I want to create a filter Template in Code Behind, but it's hard for me, can you help me ?

I would like to be able to filter the names of technicians with a combobox !

This is my code :

protected void Page_Load(object sender, EventArgs e)
{
    GetGestionDoc();
}

{
    if (Session["NumStation"] != null)
    {
        int numStation = Convert.ToInt32(Session["NumStation"]);
        document = entities.V_RAPPORTSVALIDES.Where(p => p.ID_STATION == numStation).ToList();
 
        List<DocumentObject> newList = new List<DocumentObject>();
 
        foreach (var item in document)
        {
            DocumentObject o = new DocumentObject(item.TYPE_VISITE, item.TYPE_DOCUMENT, Convert.ToDateTime(item.DATE_DOCUMENT), Convert.ToInt16(item.ANNEE_RAPPORTANNUEL), item.NOM_TECHNICIEN);
            newList.Add(o);
        }
 
        RadCommentGrid.DataSource = newList;
        RadCommentGrid.DataBind();
 
        ChangeHeaderName();
    }
}

private void ChangeHeaderName()
{
    foreach (GridColumn column in RadCommentGrid.MasterTableView.AutoGeneratedColumns)
    {
        switch (column.OrderIndex)
        {
            case 2:
                column.HeaderText = "Date du document";
                break;
            case 3:
                column.HeaderText = "Type de document";
                break;
            case 4:
                column.HeaderText = "Nom du technicien";
                break;
            case 5:
                column.HeaderText = "Type de visite";
                break;
            case 6:
                column.HeaderText = "Année du rapport annuel";
                break;
        }
    }
 
    GridColumn columnDateDoc = RadCommentGrid.MasterTableView.AutoGeneratedColumns.Where(p => p.UniqueName == "DATE_DOCUMENT").FirstOrDefault();
    columnDateDoc.OrderIndex = 1;
 
    GridColumn columnTypeDoc = RadCommentGrid.MasterTableView.AutoGeneratedColumns.Where(p => p.UniqueName == "TYPE_DOCUMENT").FirstOrDefault();
    columnTypeDoc.OrderIndex = 2;
 
    GridColumn columnTechnicien = RadCommentGrid.MasterTableView.AutoGeneratedColumns.Where(p => p.UniqueName == "NOM_TECHNICIEN").FirstOrDefault();
    columnTechnicien.OrderIndex = 3;
 
    GridColumn columnVisite = RadCommentGrid.MasterTableView.AutoGeneratedColumns.Where(p => p.UniqueName == "TYPE_VISITE").FirstOrDefault();
    columnVisite.OrderIndex = 4;
 
    GridColumn columnAnnee = RadCommentGrid.MasterTableView.AutoGeneratedColumns.Where(p => p.UniqueName == "ANNEE_RAPPORTANNEE").FirstOrDefault();
    columnAnnee.OrderIndex = 5;
}


I see in your demo, you can create a filter with a radcombobox but its in XML :

<telerik:RadComboBox
     
    ID="RadComboBoxTitle"
     
    DataSourceID="SqlDataSource2"
     
    DataTextField="ContactTitle"
     
    DataValueField="ContactTitle"
     
    Height="200px"
     
    AppendDataBoundItems="true"
     
    SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ContactTitle").CurrentFilterValue %>'
     
    runat="server"
     
    OnClientSelectedIndexChanged="TitleIndexChanged">
     
    <Items>
        <telerik:RadComboBoxItem Text="All" />
    </Items>
     
</telerik:RadComboBox>

Eyup
Telerik team
 answered on 29 Jan 2015
1 answer
500 views
I have a gridview with column name "Domain"

BY default it shows a single filter att one time but i want multiple filter in one time in single column

My RadGrid Structure is this

DOMAIN
@yahoo.com
@gmail.com
@india.com


I want to filter domain other than @yahoo.com and @gmail.com

How to do that in RadGrid Filter ??
 
 
Eyup
Telerik team
 answered on 29 Jan 2015
1 answer
87 views
Hi,

is it possible or a planned feature to mark certain days as holidays inside the calender for planning the different tasks?
Thank you.

Regards,
Felix
Bozhidar
Telerik team
 answered on 29 Jan 2015
1 answer
112 views
Hi,

is it possible to create a task inside the gantt-chart without a determination of the start time and end time? Because in some project plannings I want to create some tasks but do not know when they are going to start or end. Thanks.

Regards,
Felix
Bozhidar
Telerik team
 answered on 29 Jan 2015
1 answer
172 views
I want to bind the RadScheduler control from dataset, I have set all the required properties like DataStartField, DataEndField, DataSubjectField, DataKeyField etc, but couldn't able to show appointments on the Control. For your information I'm getting data in dataset from SQL Server Database and there is no chance that dataset is null. Please help with both RadScheduler design and aspx.cs part.
Boyan Dimitrov
Telerik team
 answered on 29 Jan 2015
8 answers
232 views
We're using the DiffEngine component to identify changes between saved versions of the Editor content.  These version changes must then be approved by a Content Approver (user). There are two problematic scenarios we have encountered.

Scenario 1:

version 1 html:  <a title="xxx" href="http://wwww.test.com/xxxxx.pdf">a link</a>
version 2 html:  <a title="yyyy" href="http://wwww.test.com/yyyyyyy.pdf">a link</a>

The DiffEngine reports no differences in these two HTML snippets. This is a major problem for us. The linked document (href) was changed and the "title" content was changed; we need for these changes to be identified so they can be approved by the Content Approver user.


Scenario 2:

version 1 html:  <img src="http://demos.telerik.com/aspnet-ajax/editor/images/editor.jpg" alt="telerik" />
version 2 html:  <img src="http://demos.telerik.com/aspnet-ajax/editor/images/editor.jpg" alt="telerik">

The DiffEngine reports a difference in these two html snippets, despite the fact that only the closing tag changed.

Here's the output of the DiffEngine:

<table class="diff_deleted"><tr><td><img src="http://demos.telerik.com/aspnet-ajax/editor/images/editor.jpg" alt="telerik" /></td></tr></table><table class="diff_new"><tr><td><img src="http://demos.telerik.com/aspnet-ajax/editor/images/editor.jpg" alt="telerik"></td></tr></table>


Scenario 2 is more of a nuisance, but it would be nice if the DiffEngine would ignore something as trivial as a closing tag change.

Scenario 1 is a show-stopper for us.  It is possible to have the DiffEngine identify the changed href and the changed title in this scenario?

Thanks,
Trevor.


Ianko
Telerik team
 answered on 29 Jan 2015
2 answers
275 views
Hi ,

I am using Inline template to insert data. There are two command button which is Insert and Update.  To insert appointment, I am trying to call  Insert Appointment method inside RadScheduler1_AppointmentCommand. My code is as below.

Appointment apptForInsert = e.Container.Appointment;
RadScheduler1.InsertAppointment(apptForInsert);
RadScheduler1.Rebind();

By right, it should go to RadScheduler1_AppointmentInsert() method. But it didn't and the inline template form also not closed after all the events fired. Please help me with this issue. 

And there is also another problem I would like to ask. Is there any way to call RadScheduler1_AppointmentCommand from the javascript? I know I can call insertAppointment using javascript. But I am looking for a way to call AppointmentCommand.



Thank you.

Best regards,
Ei Wai

Ei Wai
Top achievements
Rank 1
 answered on 29 Jan 2015
4 answers
1.0K+ views
I'm trying to make my RadTextBox labels appear over the input box instead of to the left. Is there any native way to do this? I tried giving the CSS label a display:block, but this didn't work. After looking at the code, I see the label is put in a table cell next to the input box. Is there any property I'm missing that handles this, or is the only way is not to use a label and put them in a table row manually?
Ashley
Top achievements
Rank 1
 answered on 29 Jan 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?