Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
641 views
How can I customise the inplace or form-based editor for a field so that it shows a combobox with records from a datasource? I've tried editing the grid template and putting a combo+datasource in various places but all I get is basic text boxes.
Marc Fearby
Top achievements
Rank 1
 answered on 16 Apr 2012
1 answer
96 views
Hello,

  We have a Radgrid in one of our web pages. The user can upload the documents here and they should be able to view the documents they have already uploaded. I have a image button as one of the columns in the RadGrid. Idea being, when the user clicks on that button, a RadWindow should open.  I have the byte array of the document. With this, how do i open the document in a new window.
One way is to pass the byte array(which is saved in the database) to the RadWindow. How do i do this?

Appreciate the help
Thanks
Jagat
Top achievements
Rank 1
 answered on 16 Apr 2012
2 answers
350 views
Hello!
I know that this is an odd question, but i had been searching the forums with no luck. Something really weird is happening in my web app. i have a form with several controls (comboboxes, labels, textboxes, buttons, a radgrid, a radpanel and a radwindow. All third party controls are from Telerik) to keep some sort of order i have them grouped inside divs (divLeftMenu, divMain, divDetails, divGrid and divbuttons)   all this inside an ajax panel.
I use to open the radwindow from code behind because most of the time i need to perform server side operations right before open the radwindow. 
The other form (the buggy one) keeps the same structure, and here comes the weird part. None of my javascript functions run from code behind. not even a simple alert window. Needless to say i can't open my radwindow. 
The working form:
In the working form i had to place the radwindow out of the ajaxpanel and place all the other controls inside that panel.
The code behind that trigger the javascript function is in the RadPanelBar itemclick event. where i set the page that the radwindow will display. To open the radwindow i use the following
Protected Sub mnuLifts_ItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadPanelBarEventArgs) Handles mnuLifts.ItemClick
        Dim intDay As Integer = Date.Today.Day - 1
        Dim strURL As String = String.Empty
 
        AllParams = New clsParameters
         
        With AllParams
            .CustomerID = Me.cboCustomer.SelectedValue
            .CustomerName = Me.cboCustomer.Text
 
            Select Case  Cint(e.Item.Value)
                Case  1
                    .qryBase = "uspStoredProc1"
                    .BDate = CDate(Today.Date)
                    .Edate = CDate(Today.Date)
                    strURL = "xxxxxxxx.aspx"
                    AllParams.Title = Me.cboCustomer.Text & "text here ommited"
                Case 2
                    .qryBase = "uspStoredProc2"
                    AllParams.BDate = String.Empty
                    AllParams.Edate = String.Empty
                    strURL = "yyyyyyyyyy.aspx"
                    AllParams.Title = Me.cboCustomer.Text & "text here ommited"
                Case "3" ' lifts per month
                    .qryBase = "uspStoredProc3"
                    AllParams.BDate = CDate(DateAdd(DateInterval.Day, -intDay, Today.Date))
                    AllParams.Edate = CDate(Today.Date)
                    strURL = "zzzzzz.aspx"
                    AllParams.Title = Me.cboCustomer.Text & ControlChars.CrLf & "text here ommited " & AllParams.BDate.ToString & " to " & AllParams.Edate.ToString
               End Select
        End With
        ScriptManager.RegisterStartupScript(Me.Page, Page.GetType(), "radWin", "MyFunction(); return false", True)
        
    End Sub
The JS Function
<script type="text/javascript">
 
       function OpenCommun() {
 
           var wnd = $find("<%=dlgCommun.ClientID%>");
           wnd.setUrl("xxxxxxxxxxxxxx.aspx");
           wnd.show();
       }
 
       function GetRadWindow() {
           var oWindow = null;
           if (window.radWindow) oWindow = window.radWindow;
           else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
           return oWindow;
       }
 
       function CloseCommun() {
           GetRadWindow().close();
       }
       
   </script>

The buggy form:
Nothing happens if i do as above. the radwindow wont open.
To make it work manually (i mean by manually open the radwindow with a button and the OnClientClick) i have to place everything inside the ajaxpanel. 
I have tried radscriptblock, radwindows manager, Me.Page.ClientScript.RegisterStartupScript, ScriptManager.RegisterStartupScript, place the radpanel inside and outside of ajaxpanel, place the radwindow inside and outside. Add simple js functions to test if the problem is just with the js functions related to the radwindow or all of them.
Weird behaviour 1.
If i try to test for the script registration in the load event, the whole form freezes, comboboxes doesn't open, textboxes become readonly.
Weird behaviour 2.
Implementing the radscriptblock control run once, freezing the form and displaying the script text in the middle of the page.
To sum up: 
trying several different ways and i still can't do something as trivial as open a radwindow in an ajaxifixied form. 
Please if anyone can shade some light on this, will be so much appreciated.
Thanks!
Jakub
Top achievements
Rank 1
 answered on 15 Apr 2012
1 answer
309 views
Hi,
I am able to create and bind columns at run time into radgrid. But when I click "Edit" link for any record, error message is displayed like this.

Please find below the code for ASP page and C# page.

Thanks,
Chocks

ASP Page

<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Matman.Master" 
    CodeBehind="MaterialView.aspx.vb" Inherits="Matman_WF.MaterialView" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="grdMaterial">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdMaterial" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <div>
        <div style="width:100%; background-color:transparent; font-family:Segoe UI; font-size:medium; font-weight:bold; padding-top:30px;
            margin-bottom:5px; margin-left:3px" >Material View</div>

        <telerik:RadGrid ID="grdMaterial" runat="server" AutoGenerateColumns="false" Height="600px"
            AllowPaging="true" AllowSorting="false" PageSize="200" ShowStatusBar="True" AlternatingItemStyle-BackColor="AliceBlue"
            CellSpacing="0" OnNeedDataSource="grdFieldConfig_NeedDataSource" 
                            OnItemDataBound="grdMaterial_OnItemDataBound" >
            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
            <GroupingSettings CaseSensitive="false" />
            <AlternatingItemStyle BackColor="AliceBlue"></AlternatingItemStyle>
            <MasterTableView Width="100%" TableLayout="Auto" DataKeyNames="material" 
                             EditMode="InPlace" AllowMultiColumnSorting="false" HeaderStyle-Wrap="true"  >
                <Columns>

                    <telerik:GridEditCommandColumn UniqueName="EditColumn" HeaderStyle-Width="50px" ItemStyle-Width="50px" ></telerik:GridEditCommandColumn>

                    <telerik:GridBoundColumn UniqueName="material" DataField="material"
                        HeaderText = "SAP Material / SKU">
                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" Width="120px" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>

                    <telerik:GridBoundColumn UniqueName="matDescription" DataField="matDescription"
                        HeaderText = "Material Desc">
                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" Width="250px" />
                        <ItemStyle HorizontalAlign="Left" />
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" >
                <Resizing AllowColumnResize="true" EnableRealTimeResize="false" AllowResizeToFit="false" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" EnableVirtualScrollPaging="false" SaveScrollPosition="false" />
                <Selecting AllowRowSelect="false" />
                <ClientEvents OnRowDblClick="RowDblClick"  />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
</asp:Content>

VB Code (Code Behind)

Imports Telerik.Web.UI

Public Class MaterialView
    Inherits System.Web.UI.Page

    Dim Lst_Columns As List(Of SP_MaterialView_ColumnList_Result) = New List(Of SP_MaterialView_ColumnList_Result)
    Dim Lst_MaterialView As List(Of SP_MaterialView_Result) = New List(Of SP_MaterialView_Result)

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            If Not (Page.IsPostBack) Then
                Dim oDB As New MATMAN_Entities()

                'Get list of columns from the database
                Lst_Columns = oDB.SP_MaterialView_ColumnList(1).ToList()

                'Get list of Materials from the database. This is the data the will be displayed in the grid.
                Lst_MaterialView = oDB.SP_MaterialView.ToList()
                Session.Add("Lst_MaterialView", Lst_MaterialView)

                'Bind the list to the grid.
                grdMaterial.DataSource = Lst_MaterialView
                grdMaterial.DataBind()

                If (oDB.Connection.State = ConnectionState.Open) Then
                    oDB.Connection.Close()
                End If

            End If
        Catch ex As Exception
            'Throw ex
        Finally

        End Try

    End Sub

    Protected Sub grdFieldConfig_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles grdMaterial.NeedDataSource
        Try

            Lst_MaterialView = Session("Lst_MaterialView")
            grdMaterial.DataSource = Lst_MaterialView
        Catch ex As Exception

        End Try
    End Sub

    Protected Sub grdMaterial_OnItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdMaterial.ItemDataBound
        Try

            For Each element As SP_MaterialView_ColumnList_Result In Lst_Columns

                Dim Column As GridBoundColumn = New GridBoundColumn()

                'Check for 1 value in IsEditable field. If present then display that column in grid
                If (element.IsEditable = 1) Then

                    Column.HeaderText = element.Column_DisplayName
                    Column.Display = True
                    Column.DataField = element.ColumnNames
                    Column.UniqueName = element.ColumnNames

                    'Get the value for width property and assign it to the radcolumn. 
                    If (element.Width Is Nothing = False) Then
                        Column.HeaderStyle.Width = Unit.Pixel(element.Width)
                        Column.ItemStyle.Width = Unit.Pixel(element.Width)

                        Column.HeaderStyle.VerticalAlign = VerticalAlign.Top
                        Column.ItemStyle.HorizontalAlign = HorizontalAlign.Left
                    End If

                    grdMaterial.MasterTableView.Columns.Add(Column)

                End If

            Next element

        Catch ex As Exception
            Throw ex
        End Try
    End Sub

End Class


Tsvetina
Telerik team
 answered on 15 Apr 2012
1 answer
97 views

Hi,

For most of the grids in our project, there are more than 35 columns,to minimize the time taken to load the grid, we are trying to use the gridpersister to save the settings for individual user, so that the user can customize the number of columns they want to see everytime.
Saving the grid setting data works fine. While loading the settings data in grid, the column header and data gets wrapped  or clipped and sometimes some of the columns which is supposed to be visible are hidden and sometimes we cannot scroll to the end of grid and some columns at the end are clipped.

Below is the grid definition:

<telerik:RadGrid ID="RadReportGrid0" runat="server" AllowPaging="True" AutoSize="true"
 
        AllowSorting="True" DataSourceID="SqlDataSourceSearch" GridLines="None"
 
        Skin="Vista" AutoGenerateColumns="False"  Width="99%"
 
        onitemcreated="RadReportGrid0_ItemCreated" EnableHeaderContextMenu="True" PageSize="20"
 
        onitemdatabound="RadReportGrid0_ItemDataBound" OnPageSizeChanged="RadReportGrid0_PageSizeChanged"
 
                oninit="RadReportGrid0_Init"  AllowFilteringByColumn="false" GroupingEnabled = "false">
 
         <headercontextmenu skin="Vista">
 
             <collapseanimation duration="200" type="OutQuint">
 
             </collapseanimation>
 
         </headercontextmenu>
 
         <selecteditemstyle CssClass="SelectedItem"></selecteditemstyle>
 
  
 
         <PagerStyle AlwaysVisible="True" Position="TopAndBottom" NextPageText="Next" PrevPageText="Prev" Mode="NextPrevAndNumeric"/>
 
         <mastertableview  AutoGenerateColumns="False" datakeynames="key1,key14"
                  ClientDataKeyNames="Key1,Key14"
             datasourceid="SqlDataSourceSearch" AllowMultiColumnSorting="True">
             <norecordstemplate>
                 No record to display
 
             </norecordstemplate>
 
              <HeaderStyle HorizontalAlign="Left" VerticalAlign="Bottom" Wrap="False" />
 
              <ItemStyle Wrap="False" VerticalAlign="Top" HorizontalAlign="Left"/>
 
             <Columns>
 
                 <telerik:GridBoundColumn    DataField="Column1"  DataType="System.DateTime" FilterControlWidth="100px" FilterListOptions="VaryByDataType"
 
                     HeaderText="Upload Date" ReadOnly="True" SortExpression="Column1"   UniqueName="Column1" Groupable="False" >
 
                  </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column2" DataType="System.Decimal"
 
                     HeaderText="Column2" SortExpression="Column2" FilterControlWidth="50px"
 
                     UniqueName="Column2" Groupable="False" >
 
   
 
                 </telerik:GridBoundColumn>
 
                  <telerik:GridTemplateColumn AllowFiltering="false" Groupable="false"
 
                    <ItemTemplate>
 
                        <asp:ImageButton ID="imgActionButton" runat="server" src="_assets/img/AddRecord2.gif"></asp:ImageButton>
 
                    </ItemTemplate
 
   
 
                </telerik:GridTemplateColumn>
 
                 <telerik:GridBoundColumn   DataField="Column3" HeaderText="Column3" FilterControlWidth="50px"
 
                     ReadOnly="True" SortExpression="Column3" UniqueName="Column3"
 
                     Groupable="False" DataType="System.String"  >
 
   
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column4" HeaderText="Column4"  FilterControlWidth="50px"
 
                     SortExpression="Column4" UniqueName="Column4" Groupable="False" DataType="System.String" >
 
    
 
                 </telerik:GridBoundColumn>
 
                  <telerik:GridBoundColumn   DataField="Column5"
 
                     HeaderText="Column5" SortExpression="Column5" FilterControlWidth="50px"
 
                     UniqueName="Column5" Groupable="False" DataType="System.String"  >
 
  
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column6" HeaderText="Column6" FilterControlWidth="50px"
 
                     ReadOnly="True" SortExpression="Column6" UniqueName="Column6"
 
                     Groupable="False" DataType="System.String"  >
 
    
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column7"  FilterControlWidth="100px" DataType="System.DateTime"
 
                     HeaderText="Column7" SortExpression="Column7" FilterListOptions="VaryByDataType"
 
                     UniqueName="Column7" Groupable="False"  >
 
  
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column8" HeaderText="Column8" 
 
                     ReadOnly="True" SortExpression="Column8" UniqueName="Column8" DataType="System.String">
 
  
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridTemplateColumn UniqueName="Column9" DataField="Column9" Groupable="False" DataType="System.String"    FilterControlWidth="100px" >
 
                        <HeaderTemplate>
 
                            <asp:Label ID="LabelAccountName" runat="server" Text="Account"></asp:Label>
 
                        </HeaderTemplate>
 
                        <ItemTemplate>
 
                            <asp:hyperlink id="AccountNameColumn" runat="server"
 
                                text='<%# Eval("AccountName")%>'></asp:hyperlink>
 
                        </ItemTemplate>
 
  
 
                 </telerik:GridTemplateColumn>
 
                 <telerik:GridBoundColumn   DataField="Column10"   FilterControlWidth="100px"
 
                     HeaderText="Column10" SortExpression="Column10"
 
                     UniqueName="Column10" Groupable="False" DataType="System.String">
 
  
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column11" HeaderText="Column11"   FilterControlWidth="80px"
 
                     SortExpression="Column11" UniqueName="Column11" Groupable="False" DataType="System.String">
 
                   
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column12" HeaderText="Column12"   FilterControlWidth="80px"
 
                     SortExpression="Column12" UniqueName="Column12" Groupable="False" DataType="System.Int16">
 
                       
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridTemplateColumn UniqueName="Column13" DataField="Column13" Groupable="False" DataType="System.String" FilterControlWidth="100px" >
 
                        <HeaderTemplate>
 
                            <asp:Label ID="LabelSerialNumber" runat="server" Text="Serial Number"></asp:Label>
 
                        </HeaderTemplate>
 
                        <ItemTemplate>
 
                            <asp:hyperlink id="SerialNumberColumn" runat="server"
 
                                text='<%# Eval("SerialNumber")%>'></asp:hyperlink>
 
                        </ItemTemplate>
 
                       
 
        
 
                 </telerik:GridTemplateColumn>
 
                 <telerik:GridBoundColumn    DataField="Column14"     FilterControlWidth="100px" DataType="System.DateTime"
 
                     HeaderText="Column14" SortExpression="Column14" FilterListOptions="VaryByDataType"
 
                     UniqueName="Column14" DataFormatString="{0:d}" Groupable="False">
 
                      
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column15" HeaderText="Column15"
 
                     SortExpression="Column15" UniqueName="Column15" Groupable="False" DataType="System.String" FilterControlWidth="80px"  >
 
                     
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column16"
 
                     HeaderText="Column16" SortExpression="Column16"
 
                     UniqueName="Column16" Groupable="False"   >
 
                     
 
     
 
                 </telerik:GridBoundColumn>
 
                   <telerik:GridBoundColumn   DataField="Column17" HeaderText="Column17" 
 
                     SortExpression="Column17" UniqueName="Column17" >
 
                      
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column18"   FilterControlWidth="80px"
 
                     HeaderText="Column18" SortExpression="Column18"
 
                     UniqueName="Column18" Groupable="False" DataType="System.String">
 
                 
 
     
 
                 </telerik:GridBoundColumn>
 
                  
 
              
 
                 <telerik:GridBoundColumn   DataField="Column19"   FilterControlWidth="80px"
 
                     HeaderText="Column19" SortExpression="Column19" DataType="System.String"
 
                     UniqueName="Column19" Groupable="False">
 
                    
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column20" DataType="System.Decimal"   FilterControlWidth="80px"
 
                     HeaderText="Column20" ReadOnly="True" SortExpression="Column20"
 
                     UniqueName="Column20" Display="True" Groupable="False"
 
                     Visible="True">
 
                    
 
      
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column21" DataType="System.Decimal"   FilterControlWidth="80px"
 
                     HeaderText="Column21" ReadOnly="True" SortExpression="Column21"
 
                     UniqueName="Column21" Display="True" Groupable="False"
 
                     Visible="True">
 
                     
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column22" DataType="System.Decimal"   FilterControlWidth="80px" 
 
                     HeaderText="Column22" ReadOnly="True" SortExpression="Column22"
 
                     UniqueName="Column22" Display="True" Groupable="False"
 
                     Visible="True">
 
                  
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column23" DataType="System.Decimal"   FilterControlWidth="80px"
 
                     HeaderText="Column23" ReadOnly="True" SortExpression="Column23"
 
                     UniqueName="Column23" Display="True" Groupable="False"
 
                     Visible="True">
 
                     
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column24" DataType="System.Decimal"   FilterControlWidth="80px"  
 
                     HeaderText="Column23" ReadOnly="True" SortExpression="Column23"
 
                     UniqueName="Column23" Display="True" Groupable="False"
 
                     Visible="True">
 
                       
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column24" DataType="System.Decimal"   FilterControlWidth="80px"  
 
                     HeaderText="Column24" ReadOnly="True" SortExpression="Column24"
 
                     UniqueName="Column24" Display="True" Groupable="False"
 
                     Visible="True">
 
                     
 
    
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column25" DataType="System.Decimal"   FilterControlWidth="80px"
 
                     HeaderText="Column25" ReadOnly="True" SortExpression="Column25"
 
                     UniqueName="Column25" Display="True" Groupable="False" DataFormatString="{0:F2}hr"
 
                     Visible="True">
 
                     
 
    
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column26" DataType="System.Decimal"   FilterControlWidth="80px"
 
                     HeaderText="Column26" ReadOnly="True" SortExpression="Column26"
 
                     UniqueName="Column26" Display="True" Groupable="False" DataFormatString="{0:F2}%"
 
                     Visible="True">
 
                     
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridCalculatedColumn HeaderText="Column27" UniqueName="Column27" DataType="System.Double"  
 
                    DataFormatString="{0:F2}hr"
 
                   DataFields="Column27,Column26" Expression="{0}*100/{1}"
 
   
 
                 </telerik:GridCalculatedColumn>
 
                 <telerik:GridBoundColumn   DataField="Column28"
 
                     HeaderText="Column28" ReadOnly="True" SortExpression="Column28"
 
                     UniqueName="Column28" Display="True" Groupable="False"
 
                     Visible="True">
 
                      
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column29" 
 
                     HeaderText="Column29" ReadOnly="True" SortExpression="Column29"
 
                     UniqueName="Column29" Display="True" Groupable="False"
 
                     Visible="True">
 
                    
 
     
 
                 </telerik:GridBoundColumn>
 
                   
 
                 <telerik:GridBoundColumn   DataField="Column30" 
 
                     HeaderText="Column30" ReadOnly="True" SortExpression="Column30"
 
                     UniqueName="Column30" Display="True" Groupable="False"
 
                     Visible="True">
 
                     
 
     
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column31" 
 
                     HeaderText="Column31" ReadOnly="True" SortExpression="Column31"
 
                     UniqueName="Column31" Display="True" Groupable="False"
 
                     Visible="True">
 
                       
 
    
 
                 </telerik:GridBoundColumn>
 
                 <telerik:GridBoundColumn   DataField="Column32" 
 
                     HeaderText="Column32" ReadOnly="True" SortExpression="Column32"
 
                     UniqueName="Column32" Display="True" Groupable="False"
 
                     Visible="True">
 
                     
 
     
 
                 </telerik:GridBoundColumn>
 
                   
 
             </Columns>
 
         </mastertableview>
 
         <ClientSettings AllowDragToGroup="True" AllowColumnsReorder="True"
 
             ReorderColumnsOnClient="True">
 
             <Selecting AllowRowSelect="True" />
 
             <Scrolling AllowScroll="true" UseStaticHeaders="True" />
 
             <ClientEvents OnRowContextMenu="RowContextMenu"  />
 
         </ClientSettings>
 
         <filtermenu Skin="Vista"  >
 
             <collapseanimation duration="200" type="OutQuint">
 
             </collapseanimation>
 
         </filtermenu>
 
    </telerik:RadGrid>

Any of these wrapping or clipping problem happens if any one of the column is unchecked from the Header Context Menu, if we check all the visible columns and save the settings, the grid alignment comes back to normal.

Thanks.
Tsvetina
Telerik team
 answered on 15 Apr 2012
0 answers
93 views
Hi,
I need a controller for select special hour in a day. I need it to select special time in a day to send an SMS. Can I use Scheduler control?
If yes: how? Current Data-time is not necessary. Scheduler shows the 24 hours and exist checkbox in each hour to check special hour.
shahab
Top achievements
Rank 1
 asked on 15 Apr 2012
1 answer
110 views
Hello,
I need the data from the row which i will delete. I need this data for a log file. How can i do that?
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
    AutoGenerateColumns="False" CellSpacing="0" Culture="de-DE"
    DataSourceID="ObjectDataSource1" GridLines="None" Width="450px"
    AllowSorting="True" ShowFooter="True"
    ondeletecommand="RadGrid1_DeleteCommand"
    oninsertcommand="RadGrid1_InsertCommand" onitemcommand="RadGrid1_ItemCommand"
    onitemdatabound="RadGrid1_ItemDataBound"
    onupdatecommand="RadGrid1_UpdateCommand">
    <ClientSettings>
        <Selecting CellSelectionMode="None" />
    </ClientSettings>
    <MasterTableView AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
        AllowAutomaticUpdates="True" CommandItemDisplay="TopAndBottom"
        DataKeyNames="ResID" DataSourceID="ObjectDataSource1">
        <CommandItemSettings ExportToPdfText="Export to PDF" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"
            Visible="True">
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"
            Visible="True">
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridTemplateColumn DataField="ResWidth" DataType="System.Int32"
                FilterControlAltText="Filter ResWidth column"
                HeaderText="<%$ Resources:BasicSettings, Width %>" SortExpression="ResWidth"
                UniqueName="ResWidth">
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="RadNumericTextBox1" Runat="server"
                        Culture="de-DE" DbValue='<%# Bind("ResWidth") %>' LabelWidth="" MinValue="0"
                        Width="125px">
                        <NumberFormat DecimalDigits="0" ZeroPattern="n" />
                    </telerik:RadNumericTextBox>
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                        ControlToValidate="RadNumericTextBox1" Display="Dynamic"
                        ErrorMessage="<%$ Resources:BasicSettings, RequiredValidation %>"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="ResWidthLabel" runat="server" Text='<%# Eval("ResWidth") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn DataField="ResHeight" DataType="System.Int32"
                FilterControlAltText="Filter ResHeight column"
                HeaderText="<%$ Resources:BasicSettings, Height %>" SortExpression="ResHeight"
                UniqueName="ResHeight">
                <EditItemTemplate>
                    <telerik:RadNumericTextBox ID="RadNumericTextBox2" Runat="server"
                        Culture="de-DE" DbValue='<%# Bind("ResHeight") %>' LabelWidth="" MinValue="0"
                        Width="125px">
                        <NumberFormat DecimalDigits="0" ZeroPattern="n" />
                    </telerik:RadNumericTextBox>
                     <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                        ControlToValidate="RadNumericTextBox2" Display="Dynamic"
                        ErrorMessage="<%$ Resources:BasicSettings, RequiredValidation %>"></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="ResHeightLabel" runat="server" Text='<%# Eval("ResHeight") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridEditCommandColumn ButtonType="ImageButton"
                FilterControlAltText="Filter EditCommandColumn column"
                HeaderText="<%$ Resources:BasicSettings, Edit %>">
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"
                ConfirmText="<%$ Resources:BasicSettings, ConfirmDelete %>"
                HeaderText="<%$ Resources:BasicSettings, Delete %>" Text="Delete"
                UniqueName="DeleteColumn">
            </telerik:GridButtonColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
                UniqueName="EditCommandColumn1">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>                           
 
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
    TypeName="ResolutionsBLL"
    InsertMethod="InsertResolutions"
    SelectMethod="GetResolutions" 
    DeleteMethod="DeleteResolution"
    UpdateMethod="UpdateResolution" >
    <DeleteParameters>
        <asp:Parameter Name="resID" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="ResWidth" Type="Int32" />
        <asp:Parameter Name="ResHeight" Type="Int32" />
    </InsertParameters>
    <SelectParameters>
        <asp:Parameter DefaultValue="1" Name="resArt" Type="Int32" />
    </SelectParameters>
    <UpdateParameters>
        <asp:Parameter Name="resArt" Type="Int32" />
        <asp:Parameter Name="resWidth" Type="Int32" />
        <asp:Parameter Name="resHeight" Type="Int32" />
        <asp:Parameter Name="resID" Type="Int32" />
    </UpdateParameters>
</asp:ObjectDataSource>

I need the Id, ResWidth and ResHeight Data for the log file.
protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
{
    try
    {
        int ID = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ResID"].ToString());
 
        string logtext = string.Format("Delete {0} x {1}",
            oldWidth, oldHeight); // I need this here
 
        UserEventsBLL uev = new UserEventsBLL();
        uev.AddUserEvent(thisUser.UserName, "deleteRes", logtext, Request.Url.AbsolutePath, null, ID, null);
    }
    catch (Exception ex)
    {
        ErrorsBLL errors = new ErrorsBLL();
        errors.AddErrors(203, Request.Url.AbsolutePath, ex.Message, thisUser.UserName, "");
    }
}

I need the data in the line "string logtext = string.Formate ...".

Best regards

Reiner






Mario
Top achievements
Rank 1
 answered on 15 Apr 2012
0 answers
99 views
IHello,

I am trying to insert a preslected set of values into a table (Activity)  trough the check box list. however I am getting nothing inserted. I have got 3 tables which are.     Job,      |        Activity,                |  ActivityDetails
                                            ========================================
                                                              |        JobId                   |
                                                              |       ActivityDetailIdI     |

the preselected values are coming from the ActivityDetails table (5 values).

I am folling the example from the demo." Control Insert with ToolTip"


Jason
Top achievements
Rank 1
 asked on 14 Apr 2012
0 answers
109 views
Thanks I have done it
Varun
Top achievements
Rank 2
 asked on 14 Apr 2012
2 answers
434 views

Hi everyone

First of all, I'm aware of another existing thread that has the almost same title; I've read it, and it didn't solve my problem; therefore I decided to write a new thread.

My problem goes as follows:

I have an UpdatePanel placed in a page, which is defined as follows:

1.<asp:UpdatePanel ID="up" runat="server" Visible="false"
2. <ContentTemplate
3.  <asp:Label runat="server" Visible="false" ID="myLabel"></asp:Label
4. </ContentTemplate
5.</asp:UpdatePanel>

I need the Label and the Label's type to invoke some JavaScript with the ScriptManager.RegisterStartupScript method, which we will see later; both the UpdatePanel and Label are only needed for this purpose, and the RadComboBox is not placed in there!

The following is the JavaScript method I need to invoke using the ScriptManager.RegisterStartupScript:

1.function MyFunc(){
2. var combo = $find("MyRadComboBox.ClientID");
3. combo.get_text();
4.}

And the following is the RegisterStartupScript method I use in the code-behind file:

1.ScriptManager.RegisterStartupScript(myLabel, myLabel.GetType(), "MyKey", "MyFunc();", true);

Everytime the JavaScript method gets invoked by the RegisterStartupScript method from the code-behind, I get the following error on the client-side:

Uncaught TypeError: Cannot call method 'get_text' of null

The RadComboBox can't be found on the client-side using $find in this special situation. If I try to access it from Chrome's JS Console using the $find method, I'll get the object, and the invocation of a method on it works perfectly. 

What am I doing wrong here? How can I fix this? It's a pretty annoying little problem, and I hope somebody can point me to the right direction.

Thanks very much in advance guys!

Jakub
Top achievements
Rank 1
 answered on 14 Apr 2012
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?