Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
98 views
Hi,

I'm so close to getting this control to look exactly how I need it but am stuck on one final element.

When I mouse over and click on the radcombo box input I get the required styles (I have set a new skin and image)

Then, when I move away from the input and mouse over the list items, the style of the input reverts back to default (ie. not selected)
Is there anyway of scripting this so that whilst the mouse is over the list items that the main input retains its hover state?

Thanks, in desparation.
Kalina
Telerik team
 answered on 27 May 2010
1 answer
94 views

Hi!

Radeditor  setFocus doesn't work in chrome..
plz help me....

 

Rumen
Telerik team
 answered on 27 May 2010
1 answer
123 views
Hello,

Version: 2010 Q1

By using a GridHTMLEditorColumnEditor without giving a tools property in design page mode, ie <tools> empty, GridHTMLEditorColumn displays, in Edit and Insert mode, the editor with a default toolbar, which includes Bold, Italic and so on.

How to remove this default toolbar directly in design page mode?
(example: <tools><EditorToolGroup Tag="...">)

If not possible, how to remove it in code behind?

Thank you,
Alain
Iana Tsolova
Telerik team
 answered on 27 May 2010
2 answers
121 views

While the grid is insert mode , I need to disable some controls in this mode. I found the code for disabling in edit mode but not in insert mode , can someone help me


protected void DropDownparamType_SelectedIndexChanged(object sender, EventArgs e) { 
            DropDownList DDL = (DropDownList)sender; 
            GridIndexCollection EditItems = RadGrid1.EditIndexes; 
            if (EditItems.Count > 0) { 
                GridDataItem Item = (GridDataItem)RadGrid1.Items[EditItems[0]]; 
                GridEditFormItem ItemEdit = (GridEditFormItem)Item.EditFormItem; 
 
                /*Habilitar el campo de valores aceptados Ãºnicamente cuando el tipo de parámetro es LIST*/ 
                if ((object)ItemEdit["acceptedValues"].FindControl("txtacceptedValues") != null) { 
                    TextBox acceptedValues = (TextBox)ItemEdit["paramType"].FindControl("txtacceptedValues"); 
                    if (DDL.SelectedValue == "3") {//Tipo Lista 
                        acceptedValues.Enabled = true
                        acceptedValues.BackColor = System.Drawing.Color.White; 
                    } 
                    else { 
                        acceptedValues.Enabled = false
                        acceptedValues.BackColor = System.Drawing.Color.FromArgb(204, 204, 204);//#CCCCCC 
                    } 
                } 
            } 
 
        } 


Thanks in advance
Gerardo
Top achievements
Rank 1
 answered on 27 May 2010
1 answer
144 views
Greetings,
    Sometime after closing a login RadWindow, in IE, upon calling a logout function, an exception occurs in the JQuery lib which says:
Microsoft JScript runtime error: 'undefined' is null or not an object
var events = jQuery.data(this, "events"), handlers = events[ event.type ];

Also, Firebug shows the following error:
this._iframe.contentWindow.document is null.
when running in FireFox.

However, when I added the following links to Microsoft's Ajax scripts,

 

<script src="<%= Url.Content("~/Scripts/MicrosoftAjax.debug.js")%>" type="text/javascript"></script>

 

 

<script src="<%= Url.Content("~/Scripts/MicrosoftMvcAjax.debug.js")%>" type="text/javascript"></script>

 

the Error: 'Sys.WebForms.PageContentRequestManager' is null or not an object appeared, instead of the other crash.

Could something in RadWindow be causing this error or do you know the cause of the PageContentRequestManager error?

Respectively,
Eugene

Fiko
Telerik team
 answered on 27 May 2010
2 answers
117 views
I have a simple grid that is using UseStaticHeaders="true".

It works fine in IE8, but when I switch to compatibility mode (spoof IE7), the headers are always a few pixels wider than the columns.  Since there are many columns, the alignment is way off for the farthest right column.

Here is the grid and a temp datasource. (I stripped down the grid so it was easier to deal with - it still displays this behavior)
Note: you have to be in compatibility mode to see the mis-alignment.

<telerik:RadGrid ID="theGrid" runat="server" Height="200px" OnNeedDataSource="theGrid_NeedDataSource">  
            <ClientSettings> 
                <Scrolling AllowScroll="true" UseStaticHeaders="true"/>  
            </ClientSettings> 
            <ItemStyle CssClass="editableGridCell"  /> 
            <AlternatingItemStyle CssClass="editableGridCell" BackColor="#ffffff" /> 
            <HeaderStyle CssClass="editableGridHeader" BorderWidth="1px" BorderColor="LightGray" BorderStyle="Solid" /> 
            <MasterTableView DataKeyNames="Code" AutoGenerateColumns="false" TableLayout="Fixed" Width="180px">  
                  
                <Columns> 
                    <telerik:GridBoundColumn DataField="Code" HeaderText="Code Sequence">  
                        <ItemStyle Width="90px" /> 
                        <HeaderStyle Width="90px" /> 
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Code Name">  
                        <ItemStyle Width="90px" /> 
                        <HeaderStyle Width="90px" /> 
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView>                 
        </telerik:RadGrid> 

And the code behind:
protected void theGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            DataTable table = new DataTable();  
            table.Columns.Add("Code"typeof(String));  
            table.Columns.Add("Name"typeof(String));  
 
            table.Rows.Add("asdfasdf""asdfasdfasdfasdf");  
 
            theGrid.DataSource = table;  
        } 


Let me know what I have to do.

Thanks,
Justin
Justin Lee
Top achievements
Rank 1
 answered on 27 May 2010
2 answers
401 views
I'm trying to use the RadGrid to do in-place editing and I am having an issue.

When press the "+ Add" button, I can enter the fields and when I press save, everything is working fine.  When I try to edit the same record with the "Edit" button below it can't find any of the templated controls. (It's a template column here, but the same thing happens when I use GridEditCommandColumn)

This is the ASCX code:

    <telerik:RadGrid ID="gridNotes" AutoGenerateColumns="False" Skin="Web20" runat="server">  
        <MasterTableView AutoGenerateColumns="False" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" CommandItemDisplay="Top" DataKeyNames="NoteID" 
            TableLayout="Fixed" EditMode="EditForms">  
            <Columns> 
                <telerik:GridBoundColumn UniqueName="ID" DataField="NoteID" Display="false">  
                </telerik:GridBoundColumn> 
                <telerik:GridDateTimeColumn HeaderText="Date" UniqueName="Date" DataField="Date" 
                    DataType="System.DateTime" HeaderStyle-Width="170px" EmptyDataText=" ">  
                </telerik:GridDateTimeColumn> 
                <telerik:GridBoundColumn HeaderText="Owner" UniqueName="Owner" DataField="Author" 
                    HeaderStyle-Width="180px" ColumnEditorID="ownerEditor">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn HeaderText="Notes" UniqueName="Body" HeaderStyle-Width="250px" DataField="Body">  
                </telerik:GridBoundColumn> 
                <telerik:GridTemplateColumn HeaderText="Attachments" UniqueName="Attachments" ItemStyle-Width="250px">  
                    <ItemTemplate> 
                        <table style="border:0px; height:10px;">  
                            <tr> 
                                <td valign="middle">  
                                    <asp:ImageButton ID="btnAddAttachments" ImageUrl="~/Images/ic_attachments_add.png" runat="server" /> 
                                </td> 
                                <td valign="middle" style="width:49%">  
                                    Add&nbsp;>>  
                                </td> 
                                <td valign="middle">  
                                    <asp:ImageButton ID="btnViewAttachments" ImageUrl="~/Images/ic_attachments_view.png" runat="server" /> 
                                </td> 
                                <td valign="middle" style="width:49%">  
                                    View&nbsp;>>  
                                </td> 
                            </tr> 
                        </table> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn HeaderText="Save" UniqueName="EditCommand" ItemStyle-Width="135px" ItemStyle-HorizontalAlign="Center">  
                    <ItemTemplate> 
                        <asp:Button ID="btnEdit" CssClass="miniButton" Width="60px" Text="Edit" CommandName="Edit" runat="server" /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
            <EditFormSettings EditFormType="Template">  
                <FormTemplate> 
                    <table cellpadding="0" cellspacing="0" width="100%">  
                        <tr> 
                            <td style="width:170px; text-align:center;">  
                                <telerik:RadDatePicker ID="dateNote" runat="server"></telerik:RadDatePicker> 
                            </td> 
                            <td style="width:180px; text-align:center;">  
                                <asp:TextBox ID="txtOwner" Width="170px" Text='<%# Bind("Author") %>' runat="server"></asp:TextBox> 
                            </td> 
                            <td style="width:250px; text-align:center;">  
                                <asp:TextBox ID="txtBody" TextMode="MultiLine" Height="60px" Width="240px" Text='<%# Bind("Body") %>' Font-Names="Helvetica" runat="server"></asp:TextBox> 
                            </td> 
                            <td style="width:250px; text-align:center;">  
                                <telerik:RadAsyncUpload ID="attachmentNotes" Width="240px" Skin="Web20" runat="server"></telerik:RadAsyncUpload> 
                            </td> 
                            <td style="width:65px; text-align:center;">  
                                <asp:Button ID="btnSave" CssClass="miniButton" Width="60px" Text="Save" CommandName="Save" runat="server" /> 
                            </td> 
                            <td style="width:70px; text-align:center;">  
                                <asp:Button ID="btnCancel" CssClass="miniButton" Width="60px" Text="Cancel" CommandName="Cancel" runat="server" /> 
                            </td> 
                        </tr> 
                    </table> 
                </FormTemplate> 
            </EditFormSettings> 
        </MasterTableView> 
        <ClientSettings> 
        </ClientSettings> 
    </telerik:RadGrid> 
    <asp:HiddenField ID="txtNote" runat="server" /> 
 

This is in the code-behind.

 

void gridNotes_ItemCommand(object source, GridCommandEventArgs e)

 

{
    

switch (e.CommandName)

 

    {

 

        case RadGrid.InitInsertCommandName:

 

 

            if (gridNotes.EditItems.Count > 0)

 

                gridNotes.MasterTableView.ClearEditItems();

            NoteID = 0;

 

            break;

 

 

        case RadGrid.EditCommandName:

 

            _gridItem = (

GridEditableItem)e.Item;

 

            NoteID =

Convert.ToDouble(_gridItem.GetDataKeyValue("NoteID"));

 

            e.Item.OwnerTableView.IsItemInserted =

false;

 

 

            break;

 

 

        case "Save":

 

            e.Item.Edit =

false;

 

            _gridItem = (

GridEditableItem)e.Item;

 

            _presenter.SaveNote();

            gridNotes.MasterTableView.ClearEditItems();

 

            break;

 

 

        case "Cancel":

 

            gridNotes.MasterTableView.ClearEditItems();

 

            break;

 

 

        default:

 

            gridNotes.MasterTableView.ClearEditItems();

 

            break;

 

    }

}

In the SaveNote() method, the controls are accessed through properties that look like this:

((RadDatePicker)_gridItem.FindControl("dateNote")).SelectedDate;
((TextBox)_gridItem.FindControl("txtOwner")).Text;

 

 

etc.

I get "Object reference not set to an instance of an object.", because although _gridItem exists, the FindControl() returns null.

 

johnv
Top achievements
Rank 2
 answered on 27 May 2010
3 answers
110 views
Hi,
Should the form decorator be able to apply styles to menu items? from my tests it does not seeem to work (Q1 2010 release)
Rumen
Telerik team
 answered on 27 May 2010
1 answer
134 views

I am using a commandItem Template.
In this row I have added a Show Inactive Checkbox. 
I need the check box to maintain view state when users filter items (see pic) and such. 
The story:

  1. A user has a list of sites, some have been set to inactive. 
  2. They need to see the inactive sites only.  Why-- to view some of the historical data for that inactive site.
  3. In the commandItem Template row I have a checkbox. 
  4. They click the check box and it autopostback and tells the datasource (linq to sql datasource) to only show inactive sites.
  5. They filter the list and the grid rebinds.
  6. The PROBLEM, everytime the grid rebinds the checkbox loses it viewstate.

I search the various online demos and I have not seen this type of example.. Anyone have an idea?

Warren LaFrance, Jr.
Hayes Software Systems, Inc.

Iana Tsolova
Telerik team
 answered on 27 May 2010
2 answers
119 views
I have a radGrid that shows data from an ObjetDataSource (a query with a join between multiple tables). I have defined on the grid the DataKeyValues (IdCultura, IdMaschera, Nome) and I want to catch a text field inserted by user:

protected void RadGridNomiMaschere_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    { 
        switch (e.CommandName) 
        { 
            case "Update"
 
                long idCultura = (long)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IdCultura"]; 
                long idMaschera = (long)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IdMaschera"]; 
                string nome = (string)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Nome"]; 
                 
                break
        } 
    } 

In particular I want to retrieve the edited "Nome" field in grid. In this event I catch correctle the IdCultura and IdMaschera but always the old value and not the new one inserted by user. Why?


archimede
Top achievements
Rank 1
 answered on 27 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?