Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
971 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
198 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
71 views
ClientEvents.OnCommand   the 'DeleteSelected' command do not Pass this Event  Why?
Princy
Top achievements
Rank 2
 answered on 04 Dec 2013
3 answers
159 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
114 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
626 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
112 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
82 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
3 answers
118 views
I own a license and have access to the source code for 2013.1.220, but I need a few fixes available in 2013.1.326.

I know there is a 403 version, but since it requires jQuery 1.9.1, I can't use it for my project yet (I don't want to serve 2 separate versions of jQuery).

So, is there a source code zip for 2013.1.326 I can download? I couldn't find it in the my account section.
Kick
Top achievements
Rank 1
 answered on 04 Dec 2013
3 answers
81 views

Fix the missing AWS security service..

1. Take the same approach as in your everlive provider

 -- snip from source

public string ApiKey { get; set; }



2. Add the same approach to your amazon provider..

public string AccessKey { get; set; }

public string SecretKey { get; set; }



3. See separate thread about missing dynamic key support.

You can keep the old style webconfig file, but it should be deprecated, i.e only used if both of the above are not available..

This is stanadard AWS security..

Marin Bratanov
Telerik team
 answered on 03 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?