Telerik Forums
UI for ASP.NET AJAX Forum
17 answers
1.3K+ views
When using the GridExcelBuilder to add and format a new row when exporting from the RadGrid, is there a way to set a cell within the row to wrap text? This would give the same effect as if you invoked the "Alignment > Text Control > Wrap Text" option in the Format Cells property sheet in Excel. Hopefully the code snippet below will give an idea of what I'm trying to do.

protected void Grid_ExcelMLExportRowCreated ( object source, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e ) 
    if ( e.RowType == GridExportExcelMLRowType.HeaderRow ) 
    { 
        RowElement myNewRow = new RowElement(); 
        CellElement myNewCell = new CellElement(); 
        myNewCell.StyleValue = "myNewStyle"
        myNewCell.MergeAcross = e.Row.Cells.Count - 1; 
        //now call the hypothetical property which doesn't seem to exist... 
        myNewCell.WrapText = true
        //etc... 
    } 

Thanks,

Keith

Kostadin
Telerik team
 answered on 06 Nov 2013
1 answer
80 views
Hallo Telerik Team

I am using two radtextboxes in my login.aspx  with password strength checking enabled for the second textbox. I am following this http://www.telerik.com/help/aspnet-ajax/input-textbox-pasword-strength-checker.html tutorial. The issue is that if the user enter coma it is treated as a usual letter instead of a special character. Is this intended or some inadvertent pitfall in the control?
Shinu
Top achievements
Rank 2
 answered on 06 Nov 2013
1 answer
168 views
Its name is clear. But when I run the following in the developer tools' console:
setTimeout(function(){
console.log($find("ctl00_MainContent_gv").get_batchEditingManager().get_currentlyEditedCell());
},5000);
Then get the focus to a grid cell open for editing, I get null logged after the 5 seconds elapse.

I'm creating a new functionality that requires getting the current edited cell at a keyup event handler. How to achieve this?
أشرف
Top achievements
Rank 1
 answered on 06 Nov 2013
3 answers
361 views
I have recently upgraded a project to Telerik.Web.UI.dll 2013.3.1015.40.  Our RadWindows are opened through a common handler function which calls set_visibleStatusbar(false), this no longer works if I set RenderMode to auto in web.config and view in a modern browser.  I have verified by manually getting a reference to the window in the browser console and calling the method directly, the status bar does not disappear.

The status bar does disappear if I set the RenderMode to classic in web.config or set VisibleStatusbar="false" in the aspx.

This seems like a bug to me, anything I might have overlooked?
Marin Bratanov
Telerik team
 answered on 06 Nov 2013
6 answers
218 views
Hello,
I have a problem with control panel. When I'm trying to get into settings panel (to set up "Keep older versions") the app is getting error "System.InvalidOperationException: Password decryption failed." (more in the attached screenshot). I tried to reinstall that, with no result. It's showing every time im clicking on settings icon.

Cezary
Top achievements
Rank 1
 answered on 06 Nov 2013
1 answer
233 views
There is a radtextbox and a radsearchbox in my aspx page. The Javascript in this page has a getOrder() in which I want to access the width of the textbox and set it to searchbox using style.width. The width of searchbox increases to the stipulated width but the lens symbol position remains unchanged. If I set width in markup it works, but not in JavaScript.
Shinu
Top achievements
Rank 2
 answered on 06 Nov 2013
1 answer
165 views
Hi Team, 
I am working in RadAsyncUpload. My requirement is at a point of time I will upload only one file. While uploading the file I don't want other files to be selected or remove already selected file.

Here, I wanted to either disable the whole file name that is displayed above the inlineprogress of upload control or disable the remove button associated to the file name. Also I have to disable the select button of the control when other files are uploading to the server. 

When I use the following code when the file got selected

document.getElementById("<%# RadAsyncUpload1.ClientID%>").Enabled = false;

the whole control got disabled and the file is not getting uploaded. Hope you understand my question

Thanks & Regards,
Mohan
Princy
Top achievements
Rank 2
 answered on 06 Nov 2013
1 answer
120 views
I try to make like this example http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx

My problem is it not  <telerik:RadGrid> but it is
 <telerik:GridTableView>

Problem in here ...
<ItemTemplate>
                     <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>
                      <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'
                    runat="server">
                      <asp:Image runat="server" style="float:left" Width="200px" Height="200px" ImageUrl='<%# Eval("Url")%>' />
                        </asp:Panel>
                       </ItemTemplate>

This is my full code:
<body>
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All"
        EnableRoundedCorners="false" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ajaxsettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </ajaxsettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" runat="server" Width="95%"
        AutoGenerateColumns="False" PageSize="7" AllowSorting="True" AllowPaging="True"
        GridLines="None" ShowStatusBar="true">
        <mastertableview datasourceid="SqlDataSource1" datakeynames="Id" allowmulticolumnsorting="True"
            width="100%">
            <Columns>
                <telerik:GridBoundColumn DataField="TT_TenMauVat" HeaderText="Tên mẫu vật" SortExpression="TenMauVat"
                    FilterDelay="1000" HeaderStyle-Width="200px" UniqueName="TenMauVat" CurrentFilterFunction="Contains"
                    ShowFilterIcon="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="TT_SoHieuMauVat" HeaderText="Số hiệu mẫu vật"
                    SortExpression="SoHieuMauVat" FilterDelay="1000" HeaderStyle-Width="200px" UniqueName="SoHieuMauVat"
                    CurrentFilterFunction="StartsWith" ShowFilterIcon="false">
                </telerik:GridBoundColumn>
            </Columns>
            <DetailTables>
                <telerik:GridTableView AutoGenerateColumns="false" AllowSorting="false" DataSourceID="SqlDataSource2"
                    Width="100%" ShowHeader="false" PageSize="7">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="Id" MasterKeyField="Id"></telerik:GridRelationFields>
                    </ParentTableRelation>
                    <Columns>
                        <telerik:GridBoundColumn DataField="TT_TenMauVat" HeaderText="Tên mẫu vật" SortExpression="TenMauVat"
                            FilterDelay="1000" HeaderStyle-Width="200px" UniqueName="TenMauVat" CurrentFilterFunction="Contains"
                            ShowFilterIcon="false">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <ItemTemplate>
                        <fieldset style="padding: 10px;">
                            <legend style="padding: 5px;"><b>Thông tin chi ti?t c?a m?u v?t:   <%#Eval("TT_TenMauVat")%></b>
                            </legend>
                            <table>
                                <tbody>
                                    <tr>
                                        <td>
                                            <table>
                                                <tbody>
                                                    <tr>
                                                        <td>
                                                            S? hi?u m?u v?t:
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="cityLabel" Text='<%#Bind("TT_SoHieuMauVat") %>' runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Tên m?u v?t:
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="Label2" Text='<%#Bind("TT_TenMauVat") %>' runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Noi luu tr? hi?n t?i:
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="Label3" Text='<%#Bind("TT_NoiLuuGiuHienTai") %>' runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Phuong th?c th?i di?m giao:
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="Label4" Text='<%#Bind("TT_PhuongThucThoiDiemGiao") %>' runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            S? lu?ng:
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="Label5" Text='<%#Bind("TT_SoLuong") %>' runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            S? hi?u b?o tàng:
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="Label6" Text='<%#Bind("TT_SoHieuBaoTang") %>' runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            Ð? b?o m?t:
                                                        </td>
                                                        <td>
                                                            <asp:Label ID="Label7" Text='<%#Bind("TT_DoBaoMat") %>' runat="server"></asp:Label>
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </td>
                                        <td>
                                            <img width="200px" height="200px" src='<%#Eval("TT_HinhDaiDien")%>' alt="Hình d?i di?n" />
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </fieldset>
                    </ItemTemplate>
                </telerik:GridTableView>
                 
                
     
     
               <telerik:GridTableView AllowSorting="false" AutoGenerateColumns="false" ShowHeader="false" OnPreRender="RadGrid3_PreRender"
                    DataSourceID="SqlDataSource3" Width="100%">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="Id" MasterKeyField="Id"></telerik:GridRelationFields>
                    </ParentTableRelation>
                     <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                    <Columns>
                        <telerik:GridImageColumn DataType="System.String" DataImageUrlFields="Url" Visible="false" AlternateText="Customer image"
                            DataAlternateTextField="Url" ImageAlign="Middle" ImageHeight="110px" ImageWidth="90px"
                            HeaderText="Image Column" FooterText="ImageColumn footer">
                        </telerik:GridImageColumn>
                    </Columns>
                     
                      <ItemTemplate>
                     <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>
                      <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'
                    runat="server">
                      <asp:Image runat="server" style="float:left" Width="200px" Height="200px" ImageUrl='<%# Eval("Url")%>' />
                        </asp:Panel>
                       </ItemTemplate>
                </telerik:GridTableView>
                 
                 
            </DetailTables>
        </mastertableview>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:CoVatConnectionString %>"
        SelectCommand="SELECT * FROM [MauVat]" runat="server"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:CoVatConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [MauVat] where Id=@Id"
        runat="server">
        <SelectParameters>
            <asp:Parameter Name="Id" Type="string"></asp:Parameter>
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:CoVatConnectionString %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [MauVatImage] where MauVatId=@Id "
        runat="server">
        <SelectParameters>
            <asp:Parameter Name="Id" Type="string"></asp:Parameter>
        </SelectParameters>
    </asp:SqlDataSource>
</body>


Could you help me ? thanks 

Angel Petrov
Telerik team
 answered on 06 Nov 2013
9 answers
260 views

Everything was working but all of a sudden I am getting the following error on a radgrid in batch edit mode.

Unhandled exception at line 148, column 38 in http://aspnet-scripts.telerikstatic.com/ajaxz/2013.2.717/Grid/GridBatchEditingScripts.js

0x800a138f - Microsoft JScript runtime error: Unable to get value of the property '_data': object is null or undefined

<telerik:RadGrid ID="dgCompGrid" runat="server" AllowAutomaticUpdates="True" AutoGenerateColumns="False" BorderStyle="Solid" CellSpacing="0" GridLines="None" Skin="Sitefinity" Width="100%">
                                                    <ExportSettings>
                                                        <Pdf>
                                                            <PageHeader>
                                                                <LeftCell Text="" />
                                                                <MiddleCell Text="" />
                                                                <RightCell Text="" />
                                                            </PageHeader>
                                                            <PageFooter>
                                                                <LeftCell Text="" />
                                                                <MiddleCell Text="" />
                                                                <RightCell Text="" />
                                                            </PageFooter>
                                                        </Pdf>
                                                    </ExportSettings>
                                                    <ClientSettings>
                                                        <Selecting AllowRowSelect="True" />
                                                    </ClientSettings>
                                                    <MasterTableView AllowNaturalSort="False" EditMode="Batch" BatchEditingSettings-OpenEditingEvent ="DblClick" >
                                                        <BatchEditingSettings EditType="Row"  />
                                                    </MasterTableView>
                                                    <MultiHeaderItemStyle Wrap="False" />
                                                    <ItemStyle Wrap="False" />
                                                </telerik:RadGrid>

VB CODE BEHIND ==========================================================

 

 

 

Public Sub Load_Component_NonGrid(ByVal iCompID As Int32, Init As Boolean)

 

 

 

If iCompID > 0 Then

 

 

 

 

 

 

 

With dgCompNonGrid

 

.Columns.Clear()

.DataSource =

 

Nothing

 

 

 

 

 

.DataSource = ippService.PlanDetails(iCompID)

.MasterTableView.DataKeyNames =

 

New String() {"ippComponentID", "ippComponentSeq"}

 

 

 

End With

 

 

 

 

 

 

 

End If

 

 

 

 

 

 

 

Dim boundColumn As GridBoundColumn

 

 

 

 

 

boundColumn =

 

New GridBoundColumn()

 

dgCompNonGrid.MasterTableView.Columns.Add(boundColumn)

 

 

With boundColumn

 

.DataField =

 

"ippComponentSrcValue"

 

 

 

 

 

.UniqueName =

 

"dgippComponentSrcValue"

 

 

 

 

 

.Display =

 

True

 

 

 

 

 

.HeaderText =

 

"Value"

 

 

 

 

 

.ItemStyle.Font.Size = 8

.HeaderStyle.Font.Bold =

 

True

 

 

 

 

 

.HeaderStyle.ForeColor =

 

Color.Black

 

.HeaderStyle.BackColor =

 

Color.White

 

.ReadOnly =

 

False

 

 

 

 

 

.ItemStyle.HorizontalAlign =

 

HorizontalAlign.Left

 

 

 

End With

 

 

 

 

 

boundColumn =

 

New GridBoundColumn()

 

dgCompNonGrid.MasterTableView.Columns.Add(boundColumn)

 

 

With boundColumn

 

.DataField =

 

"ippComponentBonusPct"

 

 

 

 

 

.UniqueName =

 

"dgippComponentBonusPct"

 

 

 

 

 

.Display =

 

True

 

 

 

 

 

.HeaderText =

 

"Bonus %"

 

 

 

 

 

.ItemStyle.Font.Size = 8

.HeaderStyle.Font.Bold =

 

True

 

 

 

 

 

.HeaderStyle.ForeColor =

 

Color.Black

 

.HeaderStyle.BackColor =

 

Color.White

 

.ReadOnly =

 

False

 

 

 

 

 

.ItemStyle.HorizontalAlign =

 

HorizontalAlign.Left

 

 

 

End With

 

 

 

 

 

 

 

Dim oDeleteColumn As New GridButtonColumn

 

 

 

 

 

dgCompNonGrid.MasterTableView.Columns.Add(oDeleteColumn)

 

 

With oDeleteColumn

 

.UniqueName =

 

"DeleteColumn"

 

 

 

 

 

.HeaderText =

 

"Remove"

 

 

 

 

 

.ItemStyle.Font.Size = 8

.HeaderStyle.Font.Bold =

 

True

 

 

 

 

 

.ButtonType =

 

GridButtonColumnType.ImageButton

 

.ImageUrl =

 

"~/Images/style7/cancel.gif"

 

 

 

 

 

.Display =

 

True

 

 

 

 

 

.CommandName =

 

"Delete"

 

 

 

 

 

.CommandArgument =

 

"Delete"

 

 

 

 

 

.ConfirmText =

 

"Delete this increment?"

 

 

 

 

 

.ConfirmDialogType =

 

GridConfirmDialogType.RadWindow

 

.ItemStyle.HorizontalAlign =

 

HorizontalAlign.Left

 

.HeaderStyle.Font.Bold =

 

True

 

 

 

 

 

.HeaderStyle.ForeColor =

 

Color.Black

 

.HeaderStyle.BackColor =

 

Color.White

 

 

 

End With

 

 

 

 

 

 

 

With dgCompNonGrid.MasterTableView

 

.CommandItemDisplay =

 

GridCommandItemDisplay.Bottom

 

.BatchEditingSettings.EditType =

 

GridBatchEditingType.Row

 

.CommandItemSettings.ShowRefreshButton =

 

False

 

 

 

 

 

 

 

End With

 

 

 

 

 

 

 

End Sub

 

 

 

 



If I set the <BatchEditingSettings EditType="Cell" /> then it works but when set to row I get the error above?  Soon as I doubleClick on the row to edit.  All the data loads just fine and even the Delete works.  The Edit and Add New causes the error.  Its like it is not putting the grid into EDIT mode when I BatchEditingSettings-OpenEditingEvent ="DblClick" ?

thanks.

Antonio Stoilkov
Telerik team
 answered on 06 Nov 2013
2 answers
603 views
Hi,

I want to open Radwindow while clicking on asp:Image within Templatecolumn in Radgrid.

I have pasted my code below.

please help me to get this done.

Thanks in advance.
aspx:
<
telerik:GridTemplateColumn HeaderText="Image" UniqueName="image_file_location"
<
ItemTemplate>
<
asp:Image ID="ImgSign" Width="70" Height="80" runat="server" ImageUrl="test.png" />
</
ItemTemplate>
</
telerik:GridTemplateColumn>

c#:
protected void RadGrid_tab1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            
            DataRowView drv = (DataRowView)e.Item.DataItem;
            GridDataItem item = (GridDataItem)e.Item;
            Image img = (Image)item.Controls[0].FindControl("ImgSign");
    string from=txt_test.Text;
            string url = "test.png_"+from;
            img.Attributes["onclick"] = "return ShowForm("+url+");";
        }
        
    }
Javascript:
<script type="text/javascript">
    function ShowForm(url) {
        alert(url);
        window.radopen(url, "");
    } 
</script> 

Regards,
AGM Raja
Agm
Top achievements
Rank 1
 answered on 05 Nov 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?