Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
116 views
I have a RadGrid and have enabled the drag and drop functionality to allow the dropping of rows onto a Scheduler.  The Scheduler itself is set to use a web service.

When I drop a row onto the Scheduler a new appointment is created on the client side but the web service method InsertAppointment is never called.  After stepping through in a debugger it seems there is an error occurring in this bit of Telerik code:
_storeResources: function(h) {
    var g = [];
    var f = this;
    h.forEach(function(i) {
    Array.add(g, {Key: i.get_key(),Type: i.get_type(),Text: i.get_text(),EncodedKey: i._getInternalKey(),Available: i.get_available(),Attributes: f._storeAttributes(i.get_attributes())});
    });
    return g;
}
The variable i is null, so the methods like i.get_key() do not exist.  Is anyone else seeing this error?  I tried to set up the example code from another post but was unable to attach the database, so it's difficult at this point to tell if I'm doing something wrong or there's a bug.
Plamen
Telerik team
 answered on 04 Dec 2013
1 answer
253 views
Hi all,

I need to extend RadSearchBox because this concept with only Text value (that is not persisted) now is unusable.

Lets say I have a case when I need to set a City to a Person. I have foreign key of the City in the Person entity and I am editing it. Lets also say there are 5 cities of the same name so I need to set VALUE (eg. foreign key) and text is pretty much unusable at this point. I cannot have preset city (if I am editing existing Person that moved to another city) and also I can only get the value after the user selected it (in event) so I cannot have 2 way binding here because VALUE field is only available in Search event.

So my question here is how do I extend RadSearchBox to have VALUE field in 2 way binding scenario? I tried to extend RadSearchBox with 2 hidden fields and overried OnSearch event to store Text and Value in those fields but OnSearch is not overridable so I need some other way to make Value and Text fields persistent or use some other control (please advise which).

Here is my code that I tried which obviously does not work:

public class RadSearchBoxExtender : RadSearchBox, INamingContainer
{
    #region Public properties.
 
    public string Value
    {
        get
        {
            this.EnsureChildControls();
            return this.valueField.Value;
        }
        set
        {
            this.EnsureChildControls();
            this.valueField.Value = value;
        }
    }
 
    public override string Text
    {
        get
        {
            this.EnsureChildControls();
            return this.textField.Value;
        }
        set
        {
            this.EnsureChildControls();
            this.textField.Value = value;
            base.Text = value;
        }
    }
 
    #endregion Public properties.
 
    #region Private methods.
 
    private HiddenField valueField;
    private HiddenField textField;
 
    private string valueFieldId
    {
        get
        {
            return this.ID + "_Value";
        }
    }
 
    private string textFieldId
    {
        get
        {
            return this.ID + "_Text";
        }
    }
 
    #endregion Private methods.
 
    #region Overrides.
 
    protected override void CreateChildControls()
    {
        this.valueField = new HiddenField();
        this.valueField.ID = this.valueFieldId;
        this.valueField.Value = null;
 
        this.textField = new HiddenField();
        this.textField.ID = this.valueFieldId;
        this.textField.Value = null;
 
        this.Controls.Add(this.valueField);
        this.Controls.Add(this.textField);
 
        base.CreateChildControls();
    }
 
    #endregion Overrides.
 
    protected new void OnSearch(SearchBoxEventArgs e)
    {
        base.OnSearch(e);
 
        this.EnsureChildControls();
        this.valueField.Value = e.Value;
        this.textField.Value = e.Text;
    }
 
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
    }
 
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
    }
 
    protected override void Render(System.Web.UI.HtmlTextWriter writer)
    {
        base.Render(writer);
        this.valueField.RenderControl(writer);
    }
}
Plamen
Telerik team
 answered on 04 Dec 2013
2 answers
954 views

I am trying to add template columns dynamically to a grid which already has two columns

I used the code 
Private Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
 
Dim table As New DataTable()
table.Load(get data from database)
 
For rowCounter As Integer = 0 To table.Rows.Count - 1
 
For columnCounter As Integer = 0 To table.Columns.Count Step -1
 
Dim tc As New GridTemplateColumn
tc.HeaderText = "qty_1"
tc.UniqueName = "qty1" & columnCounter.ToString
tc.ItemTemplate = New MyTemplate(tc.UniqueName)
grdSchedule.MasterTableView.Columns.Add(tc)
 
next
next
 
End Sub
 
Private Class MyTemplate
        Implements ITemplate
 
        Protected textBox As TextBox
        Private colname As String
 
        Public Sub New(ByVal cName As String)
            MyBase.New()
            colname = cName
        End Sub
 
        Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
            textBox = New TextBox
            textBox.ID = "abc"
            container.Controls.Add(textBox)
        End Sub
    End Class

I am able to create columns in the page Init event. But I have a problem using that logic in Init event, as I need to get data which decides the number of columns that need to be created, from database. I want to use it in pageload event.

Can you please help me in this. I am not able to create columns dynamically in pageload event now.

I followed the below posts but all of them are talking about page init event.
http://www.telerik.com/community/forums/aspnet-ajax/grid/problem-creating-radgrid-gridtemplatecolumn-dynamically.aspx
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html


Thanks,
Kaushik
Princy
Top achievements
Rank 2
 answered on 04 Dec 2013
7 answers
188 views
Hi Guys,

Until this version of Telerik (2013.2.611.35), I was able to save annotations (i.e., pencil, circle, etc.) along with the image even if the image was, for example, 1200x1600 pixels, in size.  This new version only saves the large image without any annotations.

Now, if I use an image say 300x300 pixels, the annotations save with the image fine.

I have tried setting the MaxJSONLength property to the maximum value, but that did not solve it either.

Bryan
:-(
Vessy
Telerik team
 answered on 04 Dec 2013
1 answer
66 views
ClientEvents.OnCommand   the 'DeleteSelected' command do not Pass this Event  Why?
Princy
Top achievements
Rank 2
 answered on 04 Dec 2013
3 answers
148 views

We are using RadGrid for ready only purpose and the item Databound event fires twice for GridDataItem & GridEditableItem.

Even though its read only it fires twice. Are there any settings we can restrict the unwanted events.
 
Princy
Top achievements
Rank 2
 answered on 04 Dec 2013
3 answers
108 views
Hi,

When rendering a button inside a table that is in a raddock I get extra height applied to the button with the net reult in the button redering wrongly.  I've stripped back to bare minimum , I've attached a copy of the generated page - problem in both IE and Chrome.  Take away the table and the button renders fine .  Buttons outside the dock render fine.  This occurs on the default skin and the black skin, I haven't checked any others...

Any ideas?

Regards

Jon

Code for it is:

<head runat="server">
    <title></title>
</head>
<body >
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="uxRadScriptManager" runat="server"></telerik:RadScriptManager>
        <telerik:RadStyleSheetManager ID="uxRadStyleSheetManager" Runat="server"></telerik:RadStyleSheetManager>
        <telerik:RadButton ID="RadButton2" runat="server" Text="This button is OK" ></telerik:RadButton>
        <br/>
          
        <br/>
        <telerik:RadDockZone runat="server" ID="RadDockZone2" >
            <telerik:RadDock ID="uxLogonPanel" runat="server" Title="Logon" style="overflow:hidden;"
                EnableAnimation="false" AutoPostBack="false" Resizable="false" DefaultCommands="None"
                EnableDrag="False" Index="-1" Pinned="True" Tag="" Width="296" >
                <ContentTemplate>
                    <telerik:RadButton ID="RadButton1" runat="server" Text="Inside dock" ></telerik:RadButton>
                    <table id="uxLogonTable" Runat="server">
                        <tr>
                            <td >
                                <telerik:RadButton ID="uxLogonButton" runat="server" Text="Inside table in dock" ></telerik:RadButton>
                            </td>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadDock>
        </telerik:RadDockZone>
    </form>
</body>
</html>
Jon
Top achievements
Rank 1
 answered on 04 Dec 2013
4 answers
606 views
I have a radGrid with a column which is password.
I would like the password filed in both edit and grid mode to hide the password with ********.

This is the column:
<telerik:GridTemplateColumn HeaderText="Password"  UniqueName="pass" DataField="pass" SortExpression="Pass">
                       <ItemTemplate>
                           <asp:Label ID="lblpass" runat="server" Text='<%# Eval("pass")  %>' width="100px"></asp:Label>
                       </ItemTemplate>
                       <EditItemTemplate>
                           <telerik:RadTextBox ID="txtpass" Width="300px" runat="server" Text='<%# Bind("pass") %>' >
                           </telerik:RadTextBox>
                       </EditItemTemplate>
                   </telerik:GridTemplateColumn>
How can I achieve to apply such format to the password data?
Thanks,
Felice
Felice
Top achievements
Rank 1
 answered on 04 Dec 2013
1 answer
107 views
Hello. 

My RadGrid is behaving strangely. Look at the picture attached.

My code:
<telerik:RadGrid ID="grdCanaisComunicacao" runat="server" AllowSorting="true" AutoGenerateColumns="false" Width="80%"
                            OnNeedDataSource="grdCanaisComunicacao_NeedDataSource"
                            OnBatchEditCommand="grdCanaisComunicacao_BatchEditCommand">
                            <MasterTableView DataKeyNames="CanalComunicacaoID" EditMode="Batch" BatchEditingSettings-OpenEditingEvent="DblClick" CommandItemDisplay="Top">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="Descricao" UniqueName="colDescricao" HeaderText="Descrição" HeaderStyle-Width="30%">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn DataField="CanalComunicacaoTipoID" UniqueName="colTipo" HeaderText="Tipo" HeaderStyle-Width="30%">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblTipo" Text='<%# Eval("TipoDescricao") %>'></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <telerik:RadDropDownList runat="server" ID="ddlTipoCanal" DataValueField="CanalComunicacaoTipoID" DataTextField="Descricao" DataSourceID="dsCanalComunicacaoTipo">
                                            </telerik:RadDropDownList>
                                        </EditItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridCheckBoxColumn DataField="IsPrincipal" HeaderText="Canal Principal" SortExpression="IsPrincipal"
                                        UniqueName="colIsPrincipal" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="20%">
                                    </telerik:GridCheckBoxColumn>
                                    <telerik:GridButtonColumn ConfirmText="Excluir este canal de comunicação?" ConfirmDialogType="RadWindow" HeaderStyle-Width="20%"
                                        ConfirmTitle="Delete" HeaderText="Delete" ButtonType="ImageButton" ItemStyle-Width="16px" ItemStyle-Height="16px"
                                        CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                                    </telerik:GridButtonColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
Venelin
Telerik team
 answered on 04 Dec 2013
1 answer
67 views
I have an interesting scenario:

I have an editable rad-grid with a SQL back-end.  I would like, after a new row is inserted, to "Add a new record," open in edit mode (not inserted yet), with some information from the previous entry.  Is this at all possible?

Some sort of User prompt for the type of the subsequent entry would be handy as well.

Thanks,
Mark
Princy
Top achievements
Rank 2
 answered on 04 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?