Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
66 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
100 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
65 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
900 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
412 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
523 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
109 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
1 answer
95 views
Hi,

I am using selectedIndexChanged to select a single row of a RadGrid and in CustomGrid_SelectedIndexChange some code is written (say to populate one or more radgrid), so when  I doubleclick on the row it causes Postback. How can I getrid of the postback.

Is there anyway to get rid of postback? Or any alternate for selectedindexchanged?

Thanks,
Rory
Top achievements
Rank 1
 answered on 19 Aug 2011
3 answers
114 views
I have dropdown list edit template column

<EditFormSettings

 

 

EditFormType="Template">

 

 

 

<FormTemplate>

 

 

 

<table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"

 

 

 

style="border-collapse: collapse; background: white;">

 

 

 

<tr class="EditFormHeader">

 

 

 

<td colspan="2" style="font-size: small">

 

 

 

<b>Act</b>

 

 

 

</td>

 

 

 

<td>

 

 

 

<asp:DropDownList ID="ddlAct" AutoPostBack="true" runat="server" DataValueField="Id" OnSelectedIndexChanged="ddlAct_SelectedIndexChanged"

 

 

 

DataTextField="Act" SelectedValue='<%# Bind("Id") %>' TabIndex="7" AppendDataBoundItems="True" >

 

 

 

<asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem>

 

 

 

</asp:DropDownList>

 

 

 

 

</td>

 

 

 

</tr>

 

 

 

<tr class="EditFormHeader">

 

 

 

<td colspan="2" style="font-size: small">

 

 

 

<b>42 CFR</b>

 

 

 

</td>

 

 

 

<td>

In itemdatabound, it doesn't hit the

 

if ((e.Item is GridDataItem) && e.Item.IsInEditMode)

 

 

 

here is the code

 

 

 

protected void rd_ItemDataBound(object sender, GridItemEventArgs e)

 

{

// if (e.Item is GridEditableItem && e.Item.IsInEditMode)

 

 

if ((e.Item is GridDataItem) && e.Item.IsInEditMode)

 

{

 

 

GridEditableItem edititem = (GridEditableItem)e.It


What i'm missing here?

 

Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Aug 2011
2 answers
198 views
Hello all.

Im working with DNN and I need show notifications but, my page is a *.ascx (user control) and this control doesn't works correctly, always appear in bottom area of my page; regardless of the value of the position that I have assigned.

I hope you can help me.

Thankyou!
Hugo
Top achievements
Rank 1
 answered on 19 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?