Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
158 views

Hi,

Need help Issue in accessing session data in radwindow popup data in IE.

In our ASP.net application we stored datatable in session and using below code to open the popup.

string script = "function f(){$find(\"" + Window.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);

but we are facing issue to access session data in popup window(.aspx page) in IE we checked in chrome it is working fine.

Please let us know if more details required, can you please provide solution or any help.

Thank you in advance.

 

 

Danail Vasilev
Telerik team
 answered on 11 Apr 2016
3 answers
194 views

I am using entity frame work to pull my appointments in but I need to be able to set reminders on the appointments i have added the filed DataReminderField but obv i need to be able to set the remidner at the apointment creation side I am doing this through a custom booking form and its been requested I mimic the outlook reminder dialog which your component offers. So my main question is how do i write the valarm code through entity framework ?.

 

So the string i need to generate is this one

 

   BEGIN:VALARM
    TRIGGER:-PT2880M
    ACTION:DISPLAY
    DESCRIPTION:Reminder
    END:VALARM








Plamen
Telerik team
 answered on 11 Apr 2016
5 answers
369 views
I am trying to show a text value in a radgrid column cell that contains leading spaces, for example :-    '      111'.
The value is present in the td element when i view the source of the page,  but it is not shown in the browser. The grid in browser trims the leading spaces and displays  just   '111'.  How can i show the leading spaces in the grid column cell, without appending    before?
But when i sort the column it considers the leading spaces,  as it is present in the datasource. The end user finds it as a mismatch between what he enters in UI field and what he sees in grid. Please advice how to handle the situation.
devoas
Top achievements
Rank 1
 answered on 09 Apr 2016
3 answers
609 views

I have a UserControl as custom edit form inside my grid. It's bound directly to a data item using the Data Item property as demonstrated here.

 

private object _dataItem = null;
 
public object DataItem
{   
      get {return this._dataItem;}
      set {this._dataItem = value;}
}

 

Binding expressions display values in controls like this:

<div>
 <asp:TextBox ID="txtApples" runat="server" Text='<%# Bind("Apples") %>' Width="50px" Enabled="false" ></asp:TextBox>
 <asp:TextBox ID="txtOranges" runat="server" Text='<%# Bind("Oranges") %>' Width="50px" ></asp:TextBox>
 </div>

 

Users can edit the number of Oranges and divide Apples/Oranges on button click. The button click event handled in the ascx.cs file, which does the math and updated the value displayed in txtApples.

 

Now, I want to add a Reset button to the UserControl. When clicked, the original Apple value will display in txtApples. Seems like this value would be availble in the Edited Grid Item as described here: 

Accessing the edited grid item from the user control


When RadGrid loads the UserControl Edit Form, the UserControl has full access to the properties of the grid item in which it is loaded. Inside theUserControl, you can access the grid item using the Parent.NamingContainer property:

GridEditableItem editedItem = this.Parent.NamingContainer;

Once you have a reference to the GridEditableItem object, you can access any of its properties, such as cell text values, the DataItem object (available in DataBinding event handler), and so on.

How can I access the Apple cell text value?

 

 

 

Joe
Top achievements
Rank 1
 answered on 08 Apr 2016
6 answers
197 views

I created css for RadMenu and it does some things right. However, some issues remain, such as selected tab css, and end of menu css. In addition separation between tabs looks a little incomplete. Can you please take a look? Code and Pic attached

Thank you

 .RadMenu .rmItem
        {           
            font-family: 'Open Sans', sans-serif;
            font-size:13px;
            font-weight:bolder;
            text-decoration:none;
            text-align:center;
            position:relative;
            padding:5px;
            outline: none;
        
            background-image: linear-gradient(bottom, #7B1342 0%, #DB4D8D 100%);
            background-image: -o-linear-gradient(bottom, #7B1342 0%, #DB4D8D 100%);
            background-image: -moz-linear-gradient(bottom, #7B1342 0%, #DB4D8D 100%);
            background-image: -webkit-linear-gradient(bottom, #7B1342 0%, #DB4D8D 100%);
            background-image: -ms-linear-gradient(bottom, #7B1342 0%, #DB4D8D 100%);
            background-image: -webkit-gradient(linear,left bottom,left top,color-stop(0, #7B1342),color-stop(1, #DB4D8D));

            -pie-background: linear-gradient(#DB4D8D, #7B1342);
            behavior: url(/styles/pie/PIE.htc);
     
            -webkit-border-radius: 5px;
            -moz-border-radius: 5px;
            -o-border-radius: 5px;
            border-radius: 5px;
    
            -webkit-box-shadow: inset 0px 1px 0px #DB4D8D, 0px 5px 0px 0px #661A3C, 0px 10px 5px #999;
            -moz-box-shadow: inset 0px 1px 0px #DB4D8D, 0px 5px 0px 0px #661A3C, 0px 10px 5px #999;
            -o-box-shadow: inset 0px 1px 0px #DB4D8D, 0px 5px 0px 0px #661A3C, 0px 10px 5px #999;
            box-shadow: inset 0px 1px 0px #DB4D8D, 0px 5px 0px 0px #661A3C, 0px 10px 5px #999;
     
        }
David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 08 Apr 2016
4 answers
159 views

I currently able to export multiple grids to excel in one file. Problem is that me superiors would like it to be prettier.

Is there a way to export multi grids in html format? Please help!

My current export code is this:

                   Dim gridControlsFound As New List(Of RadGrid)()

                    gridControlsFound.Add(grdBCA_Assumptions_TravelDemand)
                    gridControlsFound.Add(grdBCA_Assumptions_StartupCosts)
                    gridControlsFound.Add(grdBCA_Assumptions_AnnualCosts)

                    ExportMultiGrid(gridControlsFound, "GrantReport")

Private Sub ExportMultiGrid( _
                            ByVal gridControlsFound As List(Of RadGrid), _
                            ByVal FileName As String)

        Dim tableXLS As New xls.Table()
        Dim ExportInSingleSpreadsheet As Boolean = True

        For Each grid As RadGrid In gridControlsFound
            grid.AllowPaging = False
            grid.CurrentPageIndex = 0
            'grid.Rebind()
            GenerateTable(grid, tableXLS)
        Next

        If ExportInSingleSpreadsheet = True Then
            [structure].Tables.Add(tableXLS)
        End If

        Dim renderer As New xls.XlsBiffRenderer([structure])
        Dim renderedBytes As Byte() = renderer.Render()
        Response.Clear()
        Response.AppendHeader("Content-Disposition:", "attachment; filename=" & FileName & ".xls")
        Response.ContentType = "application/vnd.ms-excel"
        Response.BinaryWrite(renderedBytes)
        Response.[End]()

    End Sub

 

 Private Sub GenerateTable(grid As RadGrid, ByRef singleTable As xls.Table)

        Dim ExportInSingleSpreadsheet As Boolean = True

        If ExportInSingleSpreadsheet = False Then
            singleTable = New xls.Table(grid.ID)
            row = 1
            col = 1
        Else
            If Not isFirstItem Then
                row += 1
            Else
                isFirstItem = False
            End If
        End If

         For i As Integer = 0 To grid.Columns.Count - 1

            If grid.Columns(i).HeaderText.Length = 1 Then
                If grid.Columns(i).UniqueName = "Discount1" Then
                    singleTable.Cells(i + 1, row).Value = txbDiscountRate_1.Text & "% discount rate ($ mil.)"
                ElseIf grid.Columns(i).UniqueName = "Discount2" Then
                    singleTable.Cells(i + 1, row).Value = txbDiscountRate_2.Text & "% discount rate ($ mil.)"
                Else
                    singleTable.Cells(i + 1, row).Value = grid.Columns(i).HeaderText
                End If
            Else
                singleTable.Cells(i + 1, row).Value = grid.Columns(i).HeaderText
            End If

        Next

        row += 1

        For Each item As GridDataItem In grid.MasterTableView.Items
            For Each column As GridColumn In grid.Columns
                singleTable.Cells(col, row).Value = item(column.UniqueName).Text
                col += 1
            Next
            col = 1
            row += 1
        Next

        If ExportInSingleSpreadsheet = False Then
            [structure].Tables.Add(singleTable)
        End If

    End Sub

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 08 Apr 2016
4 answers
173 views
Hi,
I have radtreemap that has a single parent_id.
At the moment it’s all renders in pretty much the same colour, (albeit slightly different tones)
Is there a way to force each item (square) to have a different colour?
Thanks.
Ivan Danchev
Telerik team
 answered on 08 Apr 2016
14 answers
637 views
Is it possible to use the export to pdf function of a radgrid to save the outputted pdf on the server? Essentially what I am trying to accomplish is to have a page with a bunch of user inputs and then when the user clicks the submit button it would save the page with everything that they have typed in as a pdf. I was hoping to achieve this by putting the entire page inside of a radgrids item template and then in the submit buttons code behind, I would like to export the grid to pdf and save it in a directory on the server. Is this at all possible? Is there an example somewhere on how to do it? Is this even the best approach to take?
Daniel
Telerik team
 answered on 08 Apr 2016
1 answer
136 views

hi

 

The radlistbox is not showing or displaying anything on screen. Why is that so? Thanks

 

here is my code:

 

 <telerik:RadListBox ID="lbList"  runat="server" BorderWidth="0px" BorderStyle="None" Width="100%" style="top: 0px; left: 0px"  BorderColor="White">            <ItemTemplate>
             <table>
                 <tr>
                    <td ><asp:Image ID="Image1" runat="server" ImageUrl="~/crm/profileimage/freelance.png" /></td>
                    <td>John Wayne</td>
                </tr>
             </table>
        </ItemTemplate>
</telerik:RadListBox>

Pavlina
Telerik team
 answered on 08 Apr 2016
1 answer
145 views

 

Checkboxes in a batch grid require an extra click to put them into Edit mode, but that's fixed with this code I got on this forum...

function changeEditor(sender) {
    var grd = GetControlRAD("grdPODetails");
    var batchManager = grd.get_batchEditingManager();
    batchManager.openCellForEdit(sender.parentElement.parentElement);
    sender.checked = !sender.checked;
}

<telerik:RadGrid ID="grdPODetails" runat="server" AllowSorting="True" AutoGenerateColumns="False" Skin="Office2010Blue" GridLines="None">
    <HeaderContextMenu EnableAutoScroll="True">
    </HeaderContextMenu>
    <MasterTableView CommandItemDisplay="Top" EditMode="Batch" InsertItemDisplay="Bottom"
            ClientDataKeyNames="PurchaseOrderDetailKey"
            DataKeyNames="PurchaseOrderDetailKey">
        <BatchEditingSettings EditType="Cell" OpenEditingEvent="Click" />
        <CommandItemSettings ShowRefreshButton="False" ShowSaveChangesButton="true" ShowCancelChangesButton="true" />
        <NoRecordsTemplate>
            No detail lines to display.
        </NoRecordsTemplate>
        <Columns>
 
            <telerik:GridTemplateColumn DataField="PrintOnPurchaseOrder" HeaderText="Print" UniqueName="PrintOnPurchaseOrder" DataType="System.Boolean">
                <HeaderStyle Width="40px" />
                <ItemStyle Width="40px" />
                <ItemTemplate>
                    <input id="chkPrint" type="checkbox" checked='<%# Eval("PrintOnPurchaseOrder") %>' onclick="changeEditor(this);" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:CheckBox ID="chkPrint" runat="server" Checked='<%# Bind("PrintOnPurchaseOrder") %>' />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="PostToGeneralLedger" HeaderText="Post" UniqueName="PostToGeneralLedger" DataType="System.Boolean">
                <HeaderStyle Width="40px" />
                <ItemStyle Width="40px" />
                <ItemTemplate>
                    <input id="chkPost" type="checkbox" checked='<%# Eval("PostToGeneralLedger") %>' onclick="changeEditor(this);" />
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:CheckBox ID="chkPost" runat="server" Checked='<%# Bind("PostToGeneralLedger") %>' />
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
            <telerik:GridTemplateColumn DataField="UnitDescription" UniqueName="UnitDescription" HeaderText="Unit Desc" DataType="System.String">
                <ItemTemplate>
                    <asp:Label ID="lblUnitDescription" runat="server"
                        Text='<%# Eval("UnitDescription") %>'>
                    </asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <telerik:RadTextBox ID="txtUnitDescription" runat="server" MaxLength="10" Width="100%"
                    Text='<%# Bind("UnitDescription") %>' >
                    </telerik:RadTextBox>
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
 
        </Columns>
    </MasterTableView>
    <ClientSettings AllowKeyboardNavigation="true">
        <Selecting AllowRowSelect="True" />
        <ClientEvents/>
    </ClientSettings>
</telerik:RadGrid>

 

A breakpoint in changeEditor shows it's only called once, to put it in edit mode. But the first time you click it (and every time following if you keep clicking it while still in edit mode) I need to handle that event. For instance, in this grid, if I check the checkbox in the 2nd column, how can I set column "UnitDescription" in the same row to "A", but if I uncheck the checkbox (while still in EditMode) it sets UnitDescription" to "B"?

I tried putting an event handler on the checkbox within EditItemTemplate, but that didn't work... or I did it wrong. It's almost like when it opens in edit mode, a new checkbox is created on the fly. But I can't figure out where it is or how to grab its events. Please help.

 

Kostadin
Telerik team
 answered on 08 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?