Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
149 views
How is it possible to remove a filter from server side? For example I need to use combined filtering of columns.
if we have 5 columns and we filter 3 of them initially, this is fine however if the user changes the filter for one of the columns, the filter expression is incorrect (understandbly why because I am concatinating the existing expression along with the new one)

is there a way to remove a specific filter and then apply the new filter?

If (String.IsNullOrEmpty(Me.grdShiftObservation.MasterTableView.FilterExpression)) Then
   Me.grdShiftObservation.MasterTableView.FilterExpression = dtFromString
Else
   Me.grdShiftObservation.MasterTableView.FilterExpression =  Me.grdShiftObservation.MasterTableView.FilterExpression & " AND " & dtFromString
end if


so the initial expression maybe "DateTime >= #...#"
Then if the user selects a different filter then the expression will be:

"DateTime >= #...# AND DateTime <= #...#"

which is not what I want. In this case it would be DateTime <= #...#

so I just want to remove from the FilterExpression the related column filter completely
Tsvetina
Telerik team
 answered on 16 Apr 2012
1 answer
172 views
Hi!

I'm using Telerik RadControls for ASP.NET AJAX 2011 Q3 SP1 and I'm looking for a way to add rounded borders to RadTextBox WITHOUT CSS3, since this should also work specifically in IE8. RadDecorator is NOT an option and it seems to use the CSS3 border-radius property.

Are there any other ways to have rounded borders on the TextBoxes AND TextAreas of RadTextBox?

Thanks.
Tsvetina
Telerik team
 answered on 16 Apr 2012
1 answer
221 views
Hi,  I'm facing very weird problem with the column header and item alignment.
I need to use the UseStaticHeader ="true" and AllowcolumnResize ="true" for requirements point.
I also need to fix the size of each column header which depend on the data.
The problem i'm facing now is If the grid got a lot rows , the alignment issue not occur.
once the grid row have a few data(two or three rows) the header and item alignment got problem.
By the way ,i using version - 2012.1.215.40
Do you have any idea what happening in my grid.
Can i get an answer as soon as possible. I need an urgent solution :(
Please see my attach code and screen capture.
========================== Exception.ascx.cs=====================================================
protected void grdFatal_PreRender(object sender, EventArgs e)
      {
          if (grdFatal.Items.Count != 0)
          {
              GridColumn grdCellTower = grdFatal.MasterTableView.GetColumn("CellTowerId");
              grdCellTower.HeaderStyle.Width = Unit.Pixel(80);
 
              GridColumn grdDate = grdFatal.MasterTableView.GetColumn("Date");
              grdDate.HeaderStyle.Width = Unit.Pixel(80);
 
              GridColumn grdFWVer = grdFatal.MasterTableView.GetColumn("FWVer");
              grdFWVer.HeaderStyle.Width = Unit.Pixel(55);
 
              GridColumn grdLastStatus = grdFatal.MasterTableView.GetColumn("LastStatus");
              grdLastStatus.HeaderStyle.Width = Unit.Pixel(65);
 
              GridColumn grdMeterType = grdFatal.MasterTableView.GetColumn("MeterType");
              grdMeterType.HeaderStyle.Width = Unit.Pixel(95);
 
              GridColumn grdModemFWVer = grdFatal.MasterTableView.GetColumn("ModemFWVer");
              grdModemFWVer.HeaderStyle.Width = Unit.Pixel(120);
 
              GridColumn grdSerialNumber = grdFatal.MasterTableView.GetColumn("SerialNumber");
              grdSerialNumber.HeaderStyle.Width = Unit.Pixel(120);
 
              GridColumn grdStatusId = grdFatal.MasterTableView.GetColumn("StatusId");
              grdStatusId.HeaderStyle.Width = Unit.Pixel(55);
 
              GridColumn grdStatusName = grdFatal.MasterTableView.GetColumn("StatusName");
              grdStatusName.HeaderStyle.Width = Unit.Pixel(90);
 
              GridColumn grdTxJobId = grdFatal.MasterTableView.GetColumn("TxJobId");
              grdTxJobId.HeaderStyle.Width = Unit.Pixel(58);
          }
      }


========================== Exception.ascx=====================================================
function ColumnResizing(sender, args) {
 
                if (args._gridColumn._data.UniqueName == "CellTowerId" && args._gridColumn._columnResizer._currentWidth < 80)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "Date" && args._gridColumn._columnResizer._currentWidth < 80)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "FWVer" && args._gridColumn._columnResizer._currentWidth < 55)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "LastStatus" && args._gridColumn._columnResizer._currentWidth < 65)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "MeterType" && args._gridColumn._columnResizer._currentWidth < 95)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "ModemFWVer" && args._gridColumn._columnResizer._currentWidth < 120)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "SerialNumber" && args._gridColumn._columnResizer._currentWidth < 120)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "StatusId" && args._gridColumn._columnResizer._currentWidth < 55)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "StatusName" && args._gridColumn._columnResizer._currentWidth < 108)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "TxJobId" && args._gridColumn._columnResizer._currentWidth < 90)
                { args._cancel = true; }
                else if (args._gridColumn._data.UniqueName == "Error" && args._gridColumn._columnResizer._currentWidth < 600)
                { args._cancel = true; }     
    }
</script>
 
 
 <div id="divGrid" style="margin-left:5px;">
                <telerik:RadGrid ID="grdFatal" AllowMultiRowSelection="True" runat="server"
                        AllowPaging="True" OnSelectedIndexChanged="grdFatal_OnSelectedIndexChanged"
                        ShowStatusBar="True" Width="99%" onprerender="grdFatal_PreRender"
                        onitemcreated="grdFatal_ItemCreated"
                        onneeddatasource="grdFatal_NeedDataSource" CellSpacing="0"
                        GridLines="Horizontal" Skin="WebBlue" AllowSorting="True" >
                  <MasterTableView PageSize="10" TableLayout="Fixed">
                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column" />
                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" />
                    <Columns>
                        <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="30px"
                            Resizable="False" >                       
                    <HeaderStyle Width="30px"></HeaderStyle>
                        </telerik:GridClientSelectColumn>
                    </Columns>
     
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column" />
                    </EditFormSettings>
                </MasterTableView>
                    <HeaderStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Middle" />
                    <ItemStyle Wrap="true" HorizontalAlign="Left" VerticalAlign="Middle" />
                <PagerStyle Mode="NumericPages" />           
                   
                 
                <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" >
                <Selecting CellSelectionMode="None" AllowRowSelect="True" />                
                <Selecting AllowRowSelect="True" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true"></Scrolling>
                    <Resizing AllowColumnResize="true"  AllowRowResize="false" ResizeGridOnColumnResize="false"
                    ClipCellContentOnResize="true" EnableRealTimeResize="false" AllowResizeToFit="true"/>
                    <ClientEvents OnColumnResizing="ColumnResizing"/>
                </ClientSettings>  
 
            <FilterMenu EnableImageSprites="False"></FilterMenu>
            </telerik:RadGrid
                
        </div>
Tsvetina
Telerik team
 answered on 16 Apr 2012
6 answers
589 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
81 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
291 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
289 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
78 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
70 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
93 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?