Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
669 views
Height of the Rad Grid increases when user resizes a column that has two or more words in the header text, since the header text is wrapped. This is evident in the demo provided by telerik:
http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/column-row-resize-reorder/defaultcs.aspx

Can we disable this wrapping for header texts through some css or anything? Wrapping can be disabled for cell data, but i didn't find anything for header text. Setting Wrap='false' in HeaderStyle does not work. I need to keep the height fixed during resize without explicitly mentioning grid height, so resizing should not result in wrapping in header or cell data.
Please help me out.

Thanks.
Kostadin
Telerik team
 answered on 24 Oct 2014
2 answers
132 views
I have added a very basic combobox to a simple page. When it renders, it has an extra item on the right as if it is trying to render twice side-by-side. When I hover over the dropdown arrow, the arrow disappears. I have used several skins, but the behavior is the same. The functionality is correct, but it is unpleasant for the users.

​
Magdalena
Telerik team
 answered on 24 Oct 2014
1 answer
241 views
Hi,

I have a very specific scenario when AutoCompleteBox does not work properly.

<telerik:RadAutoCompleteBox ID="TextBoxAutoCompleteEmployerName" runat="server"  
    MaxResultCount="10" MinFilterLength="3" InputType="Text" AllowCustomEntry="True" >
   <TextSettings SelectionMode="Single" />
   <WebServiceSettings Method="GetEmployerByName" Path="Employer.ascx" />
</telerik:RadAutoCompleteBox>

Steps to reproduce:

1. Open a page with an AutoCompleteBox
2. Input a filter until this filter matches an item on your list (case sensitive here)
3. Click on this item
4. Perform any postback operation
5. Note both AutoCompleteBox Text and Entries are empty in the code behind (although AutoCompleteBox was filled on the page itself)

On step 3, if instead of clicking the list item, I press tab or enter key, then I have no problem.

This is a really big problem! 

Has anyone experienced this before?
What did you do?
Boyan Dimitrov
Telerik team
 answered on 24 Oct 2014
1 answer
126 views
Is there a method to determine the number of masked characters in a RadMaskedTextBox.Mask?  For example, if the mask is defined as "###-###-#### (US)" the number of masks is 10 (whereas the length of the mask would be 17).

I've looked at the MaskParts collection, but don't see a simple way of determining the number of masks (vs. literals).

Any help would be appreciated so I don't recreate the wheel!
Konstantin Dikov
Telerik team
 answered on 24 Oct 2014
6 answers
262 views
Hi,
I have a RadGrid that's bound to EntityDataSource. A few of the columns are bound to navigation properties of the bound entity. When I try to delete a record, it gives the following error:

Error: Sys.WebForms.PageRequestManagerServerErrorException: A property named 'Vehicle.VehicleNo' was not found on the entity during an insert, update, or delete operation. Check to ensure that properties specified as binding expressions are available to the data source.

I know if I choose to use the plain foreign key IDs, instead of the navigation properties, everything works. I can easily get the delete to work if I handle it manually. But I"m just thinking there's got to be a way for the automatic delete to work too. Please advise.

<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True"
                        AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                        DataSourceID="EntityDataSource1" GridLines="None" ShowGroupPanel="True" Skin="Hay"
                        OnItemUpdated="RadGrid1_ItemUpdated"
                        OnItemInserted="RadGrid1_ItemInserted" OnItemCommand="RadGrid1_ItemCommand"
                        Height="400px" Width="700px" CellSpacing="0">
                        <MasterTableView DataKeyNames="ADChecklistId" DataSourceID="EntityDataSource1" CommandItemDisplay="Top">
                            <CommandItemSettings AddNewRecordText="Add New Aerial Device Checklist" ShowRefreshButton="false"
                                ShowAddNewRecordButton="true"></CommandItemSettings>
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                <HeaderStyle Width="20px" />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                <HeaderStyle Width="20px" />
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                                    HeaderText="Edit">
                                </telerik:GridEditCommandColumn>
                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" UniqueName="DeleteCommandColumn" HeaderText="Delete" ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?">
                                </telerik:GridButtonColumn>
                                <telerik:GridBoundColumn DataField="Vehicle.VehicleNo" FilterControlAltText="Filter VehicleNo column"
                                    HeaderText="VehicleNo" SortExpression="Vehicle.VehicleNo" UniqueName="Vehicle.VehicleNo">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Employee.FirstName" FilterControlAltText="Filter FirstName column"
                                    HeaderText="FirstName" SortExpression="Employee.FirstName" UniqueName="Employee.FirstName">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Employee.LastName" FilterControlAltText="Filter LastName column"
                                    HeaderText="LastName" SortExpression="Employee.LastName" UniqueName="Employee.LastName">
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="Utility.UtilityName" HeaderText="Utility" SortExpression="Utility.UtilityName" UniqueName="Utility.UtilityName" >
                                </telerik:GridBoundColumn>                               
                                <telerik:GridDateTimeColumn DataField="CreatedOn" DataType="System.DateTime" FilterControlAltText="Filter CreatedOn column"
                                    HeaderText="CreatedOn" SortExpression="CreatedOn" UniqueName="CreatedOn" DataFormatString="{0:MM/dd/yy}">
                                </telerik:GridDateTimeColumn>
                                <telerik:GridBoundColumn DataField="CreatedBy" FilterControlAltText="Filter CreatedBy column"
                                    HeaderText="CreatedBy" SortExpression="CreatedBy" UniqueName="CreatedBy">
                                </telerik:GridBoundColumn>
                                <telerik:GridDateTimeColumn DataField="ModifiedOn" DataType="System.DateTime" FilterControlAltText="Filter ModifiedOn column"
                                    HeaderText="ModifiedOn" SortExpression="ModifiedOn" UniqueName="ModifiedOn" DataFormatString="{0:MM/dd/yy}">
                                </telerik:GridDateTimeColumn>
                                <telerik:GridBoundColumn DataField="ModifiedBy" FilterControlAltText="Filter ModifiedBy column"
                                    HeaderText="ModifiedBy" SortExpression="ModifiedBy" UniqueName="ModifiedBy">
                                </telerik:GridBoundColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings AllowDragToGroup="True" EnablePostBackOnRowClick="true">
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                            <Resizing AllowColumnResize="true" ClipCellContentOnResize="false" />
                        </ClientSettings>
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                        </HeaderContextMenu>
                    </telerik:RadGrid>
<asp:EntityDataSource ID="EntityDataSource1" runat="server" AutoGenerateWhereClause="True"
       ConnectionString="name=MSOpsEntities" DefaultContainerName="MSOpsEntities"
       EnableFlattening="False" EnableDelete="True" EntitySetName="ADChecklists"
       Include="Vehicle, Employee, Utility" OrderBy="it.CreatedOn DESC"
       OnSelecting="EntityDataSource1_Selecting"
       ondeleting="EntityDataSource1_Deleting">
       <WhereParameters>
           <asp:SessionParameter Name="UtilityId" SessionField="utilityId" Type="Int32" />
       </WhereParameters>
   </asp:EntityDataSource>

Kostadin
Telerik team
 answered on 24 Oct 2014
3 answers
113 views
I've started using more of the ASP.Net's built-in Profiles to store presistent user information and as a way to reduce the number of SQL calls needed to retrieve various peices of user information.

When I had the information stored in a SQL table, it was easy to load this into a grid.

How can I retrieve the profile information and populate a grid?

Thanks,
Joe
Kostadin
Telerik team
 answered on 24 Oct 2014
1 answer
87 views
Hi all,
I've this situation:

    <telerik:RadTextBox ID="txtTest" runat="server" Enabled="false" />
    <telerik:RadTextBox ID="RadTextBox1" runat="server" Enabled="true" />

    <telerik:RadContextMenu ID="cmTest" runat="server">
        <Targets>
            <telerik:ContextMenuControlTarget ControlID="txtTest" />
            <telerik:ContextMenuControlTarget ControlID="RadTextBox1" />
        </Targets>
        <Items>
            <telerik:RadMenuItem AccessKey="1" Text="Delete" />
            <telerik:RadMenuItem AccessKey="2" Text="Change Background Color" />
            <telerik:RadMenuItem AccessKey="2" Text="Change ForeColor" />
        </Items>
    </telerik:RadContextMenu>

how can I force to show contextmenu on the disabled radTextBox txtTest??
Thanks in advance
Peter Filipov
Telerik team
 answered on 24 Oct 2014
4 answers
799 views
Hello,

I'm looking for help on exporting data from a RadGrid to a PDF file, via the ExportToPDF control button.  I've read a handful of threads on this, but none are working.  I'm trying to get the cell alignment to be correct for text (left-aligned) and numeric values (right-aligned).  Part of my difficulty is the fact the visible columns is dynamic, so I don't have a unique name to look for.  This also causes a possible issue with too many columns to fit onto the page without manually formatting the output.

Because I cannot effect the client's experience (the UI layout), I've moved my code from the 'ItemCommand' event to the 'ItemCreated' event.  This allows me to get all the column to fit on the page, but I'm still having issues with setting the text cell alignment left and the numeric alignment right.  I'm able to set them all to either: left, right, center, none.  Another issue I have, is that by doing this in the ItemCreated event, there's no data to determine what type of text is going to be in the cell.
protected void RadGrid_AssetList_ItemCreated( object sender, GridItemEventArgs e )
{
 if(IsExportButtonClicked){
  FormatPdfOutput(RadGrid_AssetList);
 
  var item = e.Item as GridDataItem;
 
  if(item != null){
   var dataItem = item;
 
   foreach(TableCell cell in dataItem.Cells){
    cell.Style["text-align"] = "center";
   }
  }
  else{
   var gridHeaderItem = e.Item as GridHeaderItem;
 
   if(gridHeaderItem != null){
    var headerItem = gridHeaderItem;
 
    foreach(TableCell cell in headerItem.Cells){
     cell.Style["text-align"] = "center";
    }
   }
   else{
    var gridFooterItem = e.Item as GridFooterItem;
 
    if(gridFooterItem != null){
     var footerItem = gridFooterItem;
 
     foreach(TableCell cell in footerItem.Cells){
      cell.Style["text-align"] = "center";
     }
    }
   }
  }
 }
}


private void FormatPdfOutput(RadGrid radGrid){
 radGrid.ExportSettings.IgnorePaging = true;
 radGrid.ExportSettings.ExportOnlyData = true;
 radGrid.ExportSettings.HideStructureColumns = true;
 
 double marginWidth = radGrid.ExportSettings.Pdf.PageLeftMargin.Value
               + radGrid.ExportSettings.Pdf.PageRightMargin.Value;
 
 double printArea = radGrid.ExportSettings.Pdf.PageWidth.Value - marginWidth;
 
 //if the print area of the page is smaller than the RadGrid width (total column width), change to
 //percent based widths and evenly break up the columns.
 if(printArea < radGrid.Width.Value){
  //count the number of columns that are both visible and have header text.
  var visibleColumnCount = radGrid.Columns.Cast<GridColumn>().Count(column => column.Visible);
 
  //calculate the percentage to evenly display all the columns
  var tempWidth = 1.0 / (double)visibleColumnCount;
 
  foreach(GridColumn column in radGrid.Columns){
   if(column.Visible){
    column.Visible = column.HeaderText.Length > 0;
   }
 
   column.HeaderStyle.Width = column.Visible
                      ? Unit.Percentage(tempWidth)
                      : Unit.Percentage(0);
 
   column.HeaderStyle.Wrap = true;
 
  if(column.Visible){
   column.HeaderStyle.HorizontalAlign = column as GridNumericColumn == null
                              ? HorizontalAlign.Left
                              : HorizontalAlign.Right;           
   }
  }
 }
}
Randel
Top achievements
Rank 1
 answered on 24 Oct 2014
3 answers
160 views
Hello,

I've noticed that some of your controls (like Scheduler) has gotten client side binding options via WebApi.

Does the Gantt controller also have this?
Will it get it in the near future?

Best regards
Aleksander Spro
Xledger - Senior Developer 
Bozhidar
Telerik team
 answered on 24 Oct 2014
4 answers
381 views
Hello all. I'm attempting to call focus for a radeditor control during the that's contained within a radwindow popup during the page load event. The focus() call works correctly for IE & Firefox, but in Safari & Chrome, it doesn't, requiring our users to click within the content area before they can start typing. Is there a way to correct this?
Ianko
Telerik team
 answered on 24 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?