Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
207 views
I have a column in a grid that is a certain width but the text in the column could be longer than the specified width.  If that happens I wanted to cut off the overflowing text (instead of wrapping) and replace it with an ellipsis.  The only way I could get this to work with CSS was to add the following styles to my page:

<style type="text/css">
div.RadGrid_Vista .rgRow td div,
div.RadGrid_Vista .rgAltRow td div
{
    white-space         : nowrap !important;
    overflow            : hidden !important;
    text-overflow       : ellipsis !important;
}
</style>

Next, I set the width to 150px in the ItemStyle for my column.  This didn't work, so after a lot of trial and error, I realized that those styles would only work on a DIV...not the TD tag that was being created in from the grid control.  To fix this, I added the following DataFormatString value to the GridBoundColumn:   DataFormatString="<div style='width:150px'>{0}</div>"

I had to add the width or else it didn't wrap and ignored the overflow and text-overflow settings.

Ok, so I got all of that to work, but now the last problem I'm having is when I click on the Edit button (EditForms mode), the selected row then expands in height and ignores the styles I added.

I've attached two images.  One that shows what I it looks in view mode, and the other showing what it looks like in edit mode.  I want both to look like the one in view mode (truncated with ellipsis).

Thanks,
Aaron
Aaron
Top achievements
Rank 1
 answered on 20 Aug 2011
6 answers
269 views
Hi, I use the example from RadRibbonBar, and the images are not displaying at all. What do I miss here? How can I find those icons using Skin="Office2007"

 

 

<telerik:RibbonBarTab Text="Home">

 <telerik:RibbonBarGroup Text="Clipboard" EnableLauncher="true">

 <Items>

 <telerik:RibbonBarMenu Size="Large" Text="Paste" ImageUrl="icons/home/Paste.png">

 <Items>

 <telerik:RibbonBarMenuItem Text="Paste" ImageUrl="icons/home/Paste.png" />

 

<telerik:RibbonBarMenuItem Text="Paste Special..." ImageUrl="icons/home/Paste.png" />

 </Items>

</telerik:RibbonBarMenu> <telerik:RibbonBarButton Size="Medium" Text="Cut" ImageUrl="icons/home/Cut.png" /> <telerik:RibbonBarButton Size="Medium" Text="Copy" ImageUrl="icons/home/Copy.png" />

 <telerik:RibbonBarButton Size="Medium" Text="Format" ImageUrl="icons/home/Format_Painter.png" />

 </Items>

 </telerik:RibbonBarGroup>

1)Here is part of the code. I don't know where those images are located?

2) Is there any default image in this control? I just want to see if I can use this control and have a quick way to access those image.

Jesper
Top achievements
Rank 1
 answered on 20 Aug 2011
0 answers
41 views
Hi
   I am using one Hierarchy Grid to display data.
<telerik:RadGrid ID="Grdaccountdraftavail" runat="server" AllowPaging="True" AllowMultiRowSelection="True"
                            ShowFooter="true" Skin="Office2007">
                            <PagerStyle AlwaysVisible="true" />
                            <MasterTableView Caption="<table style='background-color:Silver; width:100%; color:Black;text-align:center;'><tr><td>Accountwise Draft Availability</td></tr></table>"
                                DataKeyNames="Accountid">
                                <Columns>
                                    <telerik:GridClientSelectColumn UniqueName="Grdaccountdraftavail_select">
                                        <HeaderStyle HorizontalAlign="Center" Width="20px" />
                                        <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    </telerik:GridClientSelectColumn>
                                </Columns>
                                <ExpandCollapseColumn Visible="True">
                                </ExpandCollapseColumn>
                                <DetailTables>
                                    <telerik:GridTableView Name="Providers" runat="server">
                                    </telerik:GridTableView>
                                </DetailTables>
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true">
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                        </telerik:RadGrid>

I am trying to Expand it is expanding first time only after that it's not working. it showing the message like this "Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object".

Can any body help me  to resolve this problem.

Thanks
Suresh K
Suresh K
Top achievements
Rank 1
 asked on 20 Aug 2011
1 answer
52 views
I want to combin two data fields into one column and want it to be sortable.

Can it be sortable and how?

 

 

<telerik:GridTemplateColumn DataField='company_id,order_no' DataType="System.Int32"

 

 

 

HeaderText="CompanyOrder" SortExpression='company_id,order_no' UniqueName="companyorder">

 

 

 

<EditItemTemplate>

 

 

 

<asp:TextBox ID="order_noTextBox" runat="server" Text='<%#Bind("company_id") +"-"+Bind("order_no") %>'></asp:TextBox>

 

 

 

</EditItemTemplate>

 

 

 

<ItemTemplate>

 

 

 

<asp:Label ID="order_noLabel" runat="server" Text='<%# Eval("company_id")+ "-"+ Eval("order_no") %>'></asp:Label>

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

Thanks for any advice.

Amy

 

Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Aug 2011
1 answer
82 views
I was evaluating the RadComboBox on a project and found that the value field is not being populated. I have tried both the manual process of adding items (RadComboBox1.Items.Add(new RadComboBoxItem(String, String));) as well as binding it to a traditional record set and setting the DataTextField and DataValueField properties. In both cases only the text is being set.
Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Aug 2011
1 answer
46 views
I have a RadCalendar control that I want to show up in an ItemTemplate of a grid.

The problem is the object I am binding to (web service) returns the date in a string format, so when the bind executes, I get an invalid cast error.

Is there a way to convert the string to a datetime so that the Bind operation can be used within the selectedDate property?

Here is what I want to be able to write
<telerik:GridTemplateColumn DataField="PositionStartDate.Value" HeaderText="Position Start Date" DataType="System.DateTime">
    <ItemTemplate>
        <telerik:RadCalendar ID="uxPositionStart" runat="server" 
            SelectedDate='<%# Bind("PositionStartDate") %>'>
        </telerik:RadCalendar>
    </ItemTemplate>
</telerik:GridTemplateColumn>


But, I get the invalid cast.   This there another way to do this?
Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Aug 2011
9 answers
845 views
I would like to be able to change one column value to an editable text box with a save/cancel button on click is there any way to do this? See my image for further explanation.
Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Aug 2011
7 answers
383 views
I've been trying to set a style on today's date, but the style isn't applying until I have mouse over the date.

Here is the code i'm using to apply the style:

  <calendar ShowRowHeaders="false">
    <SpecialDays>
      <telerik:RadCalendarDay Repeatable="Today" Date="" IsToday="true">
        <ItemStyle BackColor="#eafd9e" />
      </telerik:RadCalendarDay>
     </SpecialDays>
  </calendar>

I'm using asp.net 2.0 with vs 2005.

My current version of telerik is : 2008.1.512.20 - v2.0.50727

Thank you and have a nice day.



Phil
Top achievements
Rank 1
 answered on 20 Aug 2011
5 answers
467 views
** Disclaimer **
The Telerik product was just purchased by us less than 2 weeks ago and therefore as a Newbie, I may have posted this to the wrong forum, and I may be overlooking an obvious resolution.

** Problem **
Unable to set the font-size of the column headings when exporting a grid to PDF.

** Things Tried **
I have tried many things, including some samples directly from Telerik demos. For example:

    bool isPdfExport = false;

    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) {
        if (isPdfExport && e.Item is GridDataItem) {
            /// <ColumnHeadings>
            if (e.Item is GridHeaderItem) {
                GridHeaderItem headerItem = (GridHeaderItem)e.Item;

                headerItem.Style["font-size"] = "6pt";

                foreach (TableCell cell in headerItem.Cells) {
                    cell.Style["font-size"] = "6pt";
                }
            }
            /// </ColumnHeadings>

            /// <ColumnData>
            if (e.Item is GridItem) {
                GridItem gridItem = (GridItem)e.Item;

                gridItem.Style["font-size"] = "6pt";

                foreach (TableCell cell in gridItem.Cells) {
                    cell.Style["font-size"] = "6pt";
                }
            /// </ColumnData>
            }
        } //End if (isPdfExport && e.Item is GridDataItem)
    } //End protected void RadGrid1_ItemCreated()

    protected void btnExport_Click(object sender, EventArgs e) {
        isPdfExport = true;

        this.RadGrid1.Visible = true;
        this.RadGrid1.MasterTableView.ExportToPdf();
    }

Within the above event, the ColumnHeadings section fails to resize the font. However, the ColumnData section *will* successfully resize the font. If I change the ColumnData section from 6pt to 12pt font, the data that appears under the column headings (after exporting to PDF) will be resized according. Change it back to 6pt and re-export, and the data is formatted properly.

When making the same change from 6pt to 12pt (or whatever) in the ColumnHeading section, there is no impact on the headings that appear in the PDF. The font size of the column headings remain unchanged. I have no success using "x-small" or "x-large" either (instead of a point size).

I have tried using similiar code in RadGrid1_ColumnCreated() as well as other grid events, but with no luck. BTW, here is the grid schema if interested:

    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="true"
                     GridLines="Both" BorderWidth="0.5" Visible="false" 
                     OnNeedDataSource="RadGrid1_NeedDataSource"
                     OnItemCreated="RadGrid1_ItemCreated"
                     OnDataBound="RadGrid1_DataBound"
                     OnColumnCreated="RadGrid1_ColumnCreated">
        <ClientSettings>
            <Resizing AllowColumnResize="true" />
        </ClientSettings>
        <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
            <Pdf AllowPrinting="true" PaperSize="Legal" PageHeight="8.5in" PageWidth="14in"
                 PageBottomMargin="10mm" PageTopMargin="20mm" PageLeftMargin="8mm" PageRightMargin="8mm" />
        </ExportSettings>
    </telerik:RadGrid>

** Resolution **
Unable to determine. Can someone please provide the proper way to resize Column Headings when exporting a grid to PDF?

Thank you,
Steven
Brian
Top achievements
Rank 1
 answered on 19 Aug 2011
1 answer
97 views
OK after hours of failing code. I created a new project and went step by step through your example on http://www.telerik.com/help/aspnet-ajax/window-getting-started.html and it worked just fine.

What would prevent this from working on a website that I need to look for? The only difference from the example and my project is that I am trying to add this functionality to a user control called ucDocumentAccess.ascx and trying to open a web form called DocComments.aspx. Is there something special I need to do for a UC.

Thanks,
Chuck
KawaUser
Top achievements
Rank 2
 answered on 19 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?