Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
154 views
Hi

How to apply the silk skin to the date picker and time picker as shown on the Telerik demos page. with silk skin(the icon, on hover highlighted in blue, rounded edges etc) as shown on Telerik demo page http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/custompopup/defaultcs.aspx

Thanks for your input.

A2H
Top achievements
Rank 1
 answered on 21 Nov 2013
1 answer
194 views

I am using a RadGrid and want to be able to show row specific details in another item (such as a TextBox) when a row is clicked.  This is similar to the example seen in this Grid Example.  Since the Grid Example does not have details I am using the example in Grid Row Selection.  I want the selection to work like the top example, not the bottom one.  I am trying to have the JavaScript call a method in the aspx.cs page that then updates a text box, but the PageMethods.RowClick method in the code behind is static so it does not have access to TextBox1.  Is it possible to have more control in the aspx.cs page?  The first example looks to be using previously generated items that are then hidden or exposed using JavaScript.  Is that what I need to be doing?   

I basically want the user to be able to click on a row in the RadGrid and have other things on the page update immediately based on the selected row.               


//radgrid.aspx
function RadGrid1_OnRowClick(sender,eventArgs)
{
       var MasterTable = sender.get_masterTableView();
       var Name = MasterTable.getCellByColumnUniqueName(row, "Server").innerHTML;
       PageMethods.RowClick(Name);
}
 
// radgrid.aspx.cs
   [System.Web.Services.WebMethod]
    public static void RowClick(string item)
    {
        TextBox1.Text += item;
    }
Steve Lassanske
Top achievements
Rank 1
 answered on 20 Nov 2013
1 answer
175 views
I have a screen that has numerous rag grids on it.
.RadGrid
{
    border-radius: 10px;
    overflow: hidden;
}

This code works great it rounds all the grids, but I would like to control which grids are rounded.  I have a few hierarchical grids and I do not ant the inner grid to have rounded corners

This code is in my main site.css and I want to keep it there.  I have tried #name but that is not the most ideal nor did it work.  I would like to add a cssclass name to the grids that I want the rounded corners on.
Eric Klein
Top achievements
Rank 1
 answered on 20 Nov 2013
0 answers
143 views
I am currently using windows 7 visual studio 2010 and telerik controls 2013.2.717.40.  I have created a custom skin but when I apply it I lose the Expand and Collapse icon on the grid.  I decided to use a stock skin outlook and then change the icons but when I add the icon url it still shows the standard right arrow.

Are you no longer able to alter the icon and if you use a custom screen whey does the icon disappear?
Eric Klein
Top achievements
Rank 1
 asked on 20 Nov 2013
3 answers
194 views
Hi,

I have placed a table in an edit form that contains validation on several textboxes. I'm trying to make the validation message to be right in the cell that contains the textbox.  It seems like if I'm doing soemthing like the code below in my ItemCommand event, the message would be in the "outer" table cell.  How do I access the table cell that's in the table within the <FormTemplate>?
<EditFormSettings EditFormType="Template">
    <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
    </EditColumn>
    <FormTemplate>
        <table class="auto-style1" border="2" >
            <tr>
                <td style="width:8%">Building Name:</td>
                <td style="width:8%">
                    <asp:TextBox ID="bldgname" runat="server" MaxLength="40" >                                 
                    </asp:TextBox>
                </td>
                <td style="width:8%">Column3</td>
                <td style="width:100%">Column4</td>
            </tr>
            <tr>
                <td>Address:</td>
                <td>
                    <asp:TextBox ID="address1" runat="server" Text='<%# Bind("bldgstreet1") %>'></asp:TextBox><br />
                    <asp:TextBox ID="address2" runat="server" Text='<%# Bind("bldgstreet2") %>'></asp:TextBox><br />
                </td>
                <td> </td>
                <td> </td>
            </tr>
            <tr>
                <td>City:</td>
                <td>
                    <asp:TextBox ID="bldgcity" runat="server" Text='<%# Bind("bldgcity") %>'></asp:TextBox><br />
                </td>
                <td> </td>
                <td> </td>
            </tr>
            <tr>
                <td>State:</td>
                <td>
                    <asp:TextBox ID="bldgstate" runat="server" Text='<%# Bind("bldgstate") %>'></asp:TextBox><br />
                </td>
                <td> </td>
                <td> </td>
            </tr>
            <tr style="width:5%; height:50px">
                <td>Zip:</td>
                <td>
                    <asp:TextBox ID="bldgzip" runat="server" Text='<%# Bind("bldgzip") %>'></asp:TextBox><br />
                </td>
                 
                <td>
                    <div>
                        <table width="100%">
                          <tr>
                            <td style="width:30%">
                                <asp:ImageButton ID="CertifyAddressImageButton" runat="server" ImageUrl="~/images/certificate32.png" OnClick="CertifyAddressImageButton_Click"/>
                            </td>
                            <td style="width:70%">
                                <asp:CheckBox ID="CheckBoxOverride" runat="server" Text="Override?" TextAlign="Left" Font-Size="Large" />
                            </td>      
                          </tr>
                         </table>
                     </div>
                </td>
                <td>
                   <telerik:RadComboBox ID="WireCenterRadComboBox" Runat="server" Height="200px" Width="200px" DropDownWidth="750px"
                        HighlightTemplatedItems="True" MarkFirstMatch="True"
                        EnableLoadOnDemand="True" Filter="StartsWith" EmptyMessage="Enter WireCenter Name..." ToolTip="Enter WireCenter Name to Filter list"
                        OnItemsRequested="WireCenterRadComboBox_ItemsRequested" OnLoad="WireCenterRadComboBox_Load">
                        <HeaderTemplate>
                            <table style="width: 700px" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td style="width: 80px;">WireCenter</td>
                                    <td style="width: 150px;">Name</td>
                                    <td style="width: 150px;">T1OrderMethod</td>
                                    <td style="width: 100px;">Vendor ACTL</td>
                                    <td style="width: 170px;">Logix ACTL</td>
                                </tr>
                            </table>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <table style="width:700px" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td style="width: 80px;"><%# DataBinder.Eval(Container, "Text")%></td>
                                    <td style="width: 150px;"><%# DataBinder.Eval(Container, "Attributes['wirecentername']")%></td>
                                    <td style="width: 150px;"><%# DataBinder.Eval(Container, "Attributes['t1ordermethod']")%></td>
                                    <td style="width: 100px;"><%# DataBinder.Eval(Container, "Attributes['vendoractl']")%></td>
                                    <td style="width: 170px;"><%# DataBinder.Eval(Container, "Attributes['logixactl']")%></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </telerik:RadComboBox>
                </td>
                 
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                    </asp:Button>
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
                </td>
                <td> </td>
                <td> </td>
                <td> </td>
            </tr>
        </table>
    </FormTemplate>
</EditFormSettings>

if (e.CommandName == RadGrid.UpdateCommandName ||
    e.CommandName == RadGrid.PerformInsertCommandName)
{
    GridEditableItem item = e.Item as GridEditableItem;
    // Validate Zip Code
    RegularExpressionValidator validZip = new RegularExpressionValidator();
     
 
    // for Accessing boundcolumn
    GridTextBoxColumnEditor editor;
 
    // Test zip
    TextBox txtbx;
    TableCell cell;
 
    txtbx = (TextBox)item.FindControl("bldgzip");
    cell = ((GridEditFormItem)txtbx.NamingContainer).EditFormCell;
    validZip.ControlToValidate = txtbx.ID;
    validZip.ErrorMessage = "only [0-9] and '-' are allowed";
    validZip.ValidationExpression = @"^\d{5}(-\d{4})?$";
    validZip.ForeColor = System.Drawing.Color.Red;
    cell.Controls.Add(validZip);
    // End Test Zip
 
    validZip.Validate();
  }

Helen
Top achievements
Rank 1
 answered on 20 Nov 2013
3 answers
166 views
When any PostBack occurs (in this case, I am using a RadAjaxManager) and the PivotGrid is inside a UserControl.  I can find no other explanation for this because as soon as I take off the PivotGrid (there is also another RadGrid in the UserControl) everything works just fine.  The other thing is that the PivotGrid is inside of a RadPageView.

The error is:
"Unable to get value of the property 'style': object is null or undefined"

The problem lies in the "_initializeHzScrollDiv" method which does not account for a null result from "this.get_hzScrollDiv":
var l=this.get_hzScrollDiv(); <-- Error occurs later becuase this returns Null...
var p=$telerik.isIE?a.PivotGrid.GetScrollBarWidth()+1:a.PivotGrid.GetScrollBarWidth();
l.style.width=q.clientWidth+"px";
l.style.height=p+"px";
l.style.overflowX="scroll";
l.style.overflowY="hidden";
Tim
Top achievements
Rank 1
 answered on 20 Nov 2013
1 answer
92 views
I am using RadEditor for content editing. I have set its content programmatically like 

RadEditor1.Content = Conversion.ToString(Cms.HtmlContent);

But it's not loading contents and the RadEditor also is disabled.

Any help will be appreciated.

Thanks
Ianko
Telerik team
 answered on 20 Nov 2013
11 answers
374 views
Hi,
I have a header control in my RadGrid set out as:

<

 

 

telerik:GridBoundColumn DataField="RaisingFactor" HeaderText="Raising Factor" UniqueName="RaisingFactor" ReadOnly="true" Visible="true" DataFormatString="{0:N2}"></telerik:GridBoundColumn>

 


I wish to re-set the value of the text of this control after the Update has been made on the row that it belongs to.

Its a field that is calculated based on the values of 3 other fields. I wish the new value of this header to display straight after Update.

Any advice?

Thank you.
Kostadin
Telerik team
 answered on 20 Nov 2013
5 answers
156 views
Hi there,

I have a single instance of RadEditor on a page which I am using for text entry of multiple fields by moving in the DOM.
All works fine except when I have EnableTrackChanges set to false I notice a significant delay between text entry and text appearance on the screen. I don't think I can have EnableTrackChanges flag on for my requirement. Can you please assist me to avoid that delay without setting EnableTrackChanges flag?

Thank you.
Ianko
Telerik team
 answered on 20 Nov 2013
1 answer
118 views
Assuming "Date" is of type DateTime, I know it's possible to do the following:

<telerik:GridGroupByExpression>
     <SelectFields>
         <telerik:GridGroupByField FieldName="Date" />
     </SelectFields>
     <GroupByFields>
         <telerik:GridGroupByField FieldName="Date" SortOrder="Ascending" />
     </GroupByFields>
 </telerik:GridGroupByExpression>

I've replaced my DateTime property with a new custom class called MonthAndYear.

[Serializable]
protected class MonthAndYear : IComparable<MonthAndYear>
{
    public int Month { get; set; }
    public int Year { get; set; }
 
    public string monthString
    {
        get
        {
            return CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Month);
        }
    }
 
    public MonthAndYear(int month, int year)
    {
        Month = month;
        Year = year;
    }
 
    public MonthAndYear(DateTime dateTime)
    {
        Month = dateTime.Month;
        Year = dateTime.Year;
    }
 
    public static MonthAndYear Now
    {
        get
        {
            return new MonthAndYear(DateTime.Now.Month, DateTime.Now.Year);
        }
    }
 
    public static MonthAndYear FromDate(DateTime date)
    {
        return new MonthAndYear(date.Month, date.Year);
    }
 
    public MonthAndYear AddMonths(int num)
    {
        DateTime tempDate = new DateTime(Year, Month, 1);
        tempDate = tempDate.AddMonths(num);
        return new MonthAndYear(tempDate.Month, tempDate.Year);
    }
 
    public MonthAndYear AddYears(int num)
    {
        int newYear = Year + num;
        return new MonthAndYear(Month, newYear);
    }
 
    public static bool operator >(MonthAndYear a, MonthAndYear b)
    {
        if (a.Year == b.Year)
            return a.Month > b.Month;
        else if (a.Year > b.Year)
            return true;
        else
            return false;
    }
 
    public static bool operator <(MonthAndYear a, MonthAndYear b)
    {
        if (a.Year == b.Year)
            return a.Month < b.Month;
        else if (a.Year < b.Year)
            return true;
        else
            return false;
    }
 
    public static bool operator >=(MonthAndYear a, MonthAndYear b)
    {
        return a > b || a == b;
    }
 
    public static bool operator <=(MonthAndYear a, MonthAndYear b)
    {
        return a < b || a == b;
    }
 
    public static bool operator ==(MonthAndYear a, MonthAndYear b)
    {
        return a.Month == b.Month && a.Year == b.Year;
    }
 
    public static bool operator !=(MonthAndYear a, MonthAndYear b)
    {
        return !(a.Month == b.Month && a.Year == b.Year);
    }
 
    public override bool Equals(object obj)
    {
        if (obj == null)
        {
            return false;
        }
        MonthAndYear m = obj as MonthAndYear;
        if ((System.Object)m == null)
        {
            return false;
        }
 
        return this.Month == m.Month && this.Year == m.Year;;
    }
 
    public override string ToString()
    {
        return new DateTime(Year, Month, 1).ToString();
    }
 
    public override int GetHashCode()
    {
        int hash = 23;
        hash = hash * 31 + Month.GetHashCode();
        hash = hash * 31 + Year.GetHashCode();
        return hash;
    }
 
    public int CompareTo(MonthAndYear other)
    {
        if (this < other) return -1;
        if (this == other) return 0;
        return 1;
    }
}

Now when I try to group by Date, I get an IndexOutOfRange exception that says "Cannot find column Date." If I remove the GridGroupByExpression, everything works just fine minus the fact that my data isn't grouped by Date. Is there a way to use custom objects in RadGrid's grouping functionality? Or at least a way to mimic grouping by DateTime?   
Konstantin Dikov
Telerik team
 answered on 20 Nov 2013
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?