Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
153 views
I have a RadGrid that contains a template column like the following:

<rad:GridTemplateColumn UniqueName="Name" SortExpression="Name">  
    <ItemTemplate> 
        <asp:Repeater ID="rptClientName" runat="server" > 
            <HeaderTemplate> 
                <table> 
            </HeaderTemplate> 
            <ItemTemplate> 
                <tr> 
                    <td><asp:Label ID="lblClientName" runat="server" /></td>  
                </tr> 
            </ItemTemplate> 
            <FooterTemplate> 
                </table> 
            </FooterTemplate> 
        </asp:Repeater> 
    </ItemTemplate>                                      
</rad:GridTemplateColumn> 

Everything looks fine but if I try want to select the row (and have it highlighted), the row will only be selected if I select any other part of the row except for the table that is created within the repeater.

Any suggestions?

Thanks
Konstantin Petkov
Telerik team
 answered on 30 Apr 2008
1 answer
51 views
I'm using RadGrid with templated columns, some of the them contain fairly complicated user controls. Everything worked perfectly before we started to apply skins... (The actual layout gets set before view state state is created, so everything worked like a charm).

Skinned grid doesn't seem to be capable of managing its viewstate properly i.e: any postback on a form containing such a grid wipes its layout leaving me with just a nice gradient painting....

The skin (ICE) is set in design time and the grid displays  it ok, unfortunately unitl first postback.

What's even worse is even after setting that skin to "" (which affects UI allright) the grid still acts weird, loosing it viewstate.

It's an urgent issue so any help is higky appreciated!

Thanks,
Dmitry
Yavor
Telerik team
 answered on 30 Apr 2008
2 answers
148 views
Hi there,

I have a Splitter control, with two RadPane controls inside. The first one (left) contains a tree control, the second one (right) another Splitter (right/top) with a RadGrid and (right/bottom) an empty pane which ContentUrl should be updated. There is also an AjaxManager in the page. Both the tree and grid are subscribed to this RadAjaxManager control. My questions are:

  • Which control should I add to the AjaxManager if I want the (right/bottom) RadPane updated? Everything is connected in an Ajax scenario so if I don't mention this Pane, nothing happens, but no errors occur either. I can see, debugging my code, that the ContentURL property is updated, but I see no changes. I guess it is because of Ajax.
  • I have tried to add the main Splitter, the splitter in the right side, and the (right/bottom) Pane. The results are errors. Firefox says "Invalid JSON primitive: undefined". IE 7 says: "htmlfile: unknown runtime error", and it stops in this code line:

    function Sys$WebForms$PageRequestManager$_updatePanel(updatePanelElement, rendering) {  

 

        for (var updatePanelID in this._scriptDisposes) {  

            if (this._elementContains(updatePanelElement, document.getElementById(updatePanelID))) {  

                                var disposeScripts = this._scriptDisposes[updatePanelID];  

                for (var i = 0; i < disposeScripts.length; i++) {  

                    eval(disposeScripts[i]);  

                }  

 

                                delete this._scriptDisposes[updatePanelID];  

            }  

        }  

 

        this._destroyTree(updatePanelElement);  

 

                

updatePanelElement.innerHTML = rendering;  /* <-- ERROR */

    }  

 


Before using the ContentUrl protery of the RadPane showing a external page, I was using an IFrame tag, with runat="server", and I was updating its SRC attribute. The IFrame control was added to the AjaxManager and it worked perfectly. But I also had resizing problems and if I could use the same RadPane to show a page it'd be awesome.

If anyone has found a solution for this or has a clue on what's going on, it'd be much appreciated.

Thank you in advance!
Tsvetie
Telerik team
 answered on 30 Apr 2008
1 answer
153 views
Hi, my client would like the edit/update experience to be similar to the following:
  1. Click on a single row, edit
  2. Click on another row, last row is updated, edit
  3. And so on

I've attempted to update the previous row but the newly changed values are not available anywhere I can see after the selectedindexchanged event is fired for the next row. If I understand the problem correctly, I need the equivalent of a "Row_FinishedEditing" event, which, I'm pretty sure, doesn't exist.

I've also tried a suggested architecture where all rows are in "edit mode" and regurlar updates take place in the background via ajax timer. However, when the timer is fired (although there is no postback) the focus is removed from the cell one is editing.

Any suggestions or best practices?

Thanks, Rodney

Shinu
Top achievements
Rank 2
 answered on 30 Apr 2008
1 answer
1.5K+ views

When I check the 'chkSelectAll' checkbox in the HeaderTemplate, the checkboxes in the entire column are not all checked.  Please help.

<rad:RadGrid ID="StatesGrid" runat="server" ClientSettings-Scrolling-AllowScroll="true"

AllowSorting="True" ShowGroupPanel="True" AutoGenerateColumns="False" GridLines="None"

Skin="Outlook2007" AllowMultiRowSelection="True" OnNeedDataSource="StatesGrid_NeedDataSource"

EnableAJAX="True" EnableAJAXLoadingTemplate="True" BorderStyle="None" Height="300px">

<ClientSettings ReorderColumnsOnClient="True" EnableClientKeyValues="True">

<Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />

<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="false">

</Scrolling>

</ClientSettings>

<MasterTableView>

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px"></HeaderStyle>

</RowIndicatorColumn>

<ExpandCollapseColumn Visible="False" Resizable="False">

<HeaderStyle Width="20px"></HeaderStyle>

</ExpandCollapseColumn>

<Columns>

<rad:GridTemplateColumn UniqueName="chkItem">

<HeaderStyle Width="22px" />

<HeaderStyle Width="22px" HorizontalAlign="Left" />

<HeaderTemplate>

<asp:CheckBox ID="chkSelectAll" runat="server" />

</HeaderTemplate>

<ItemStyle Width="22px" />

<ItemTemplate>

<asp:CheckBox ID="chkItem" runat="server" />

<asp:HiddenField ID="hdnState" Value='<%# Eval("StateAbbreviation") %>' runat="server" />

</ItemTemplate>

</rad:GridTemplateColumn>

<rad:GridBoundColumn DataField="StateAbbreviation" HeaderText="StateAbbreviation"

UniqueName="column" Visible="False">

</rad:GridBoundColumn>

<rad:GridBoundColumn DataField="StateName" HeaderText="StateName" UniqueName="column1"

Visible="False">

</rad:GridBoundColumn>

<rad:GridTemplateColumn HeaderText="Select State(s)" UniqueName="TemplateColumnTotalAmount">

<ItemTemplate>

<asp:Label ID="Label1" Text='<%# DisplayStateNames(Container) %>' runat="server"></asp:Label>

</ItemTemplate>

</rad:GridTemplateColumn>

</Columns>

</MasterTableView>

</rad:RadGrid>



Princy
Top achievements
Rank 2
 answered on 30 Apr 2008
2 answers
153 views
Hi:
  I find the radeditor for moss have a problem with the special html characters, for example:
"
  <html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta content="Microsoft SafeHTML" name="Generator" />
    </head>
    <body>
        &amp;
    </body>
</html>
"
in the radeditor's html mode textbox (use radeditor sharepoint for store page content) and check in or publish this page, the pagecontent's html code will change to
"
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta content="Microsoft SafeHTML" name="Generator" />
    </head>
    <body>
        &amp;amp;
    </body>
</html>
"
automaticly add "amp;" in this content, is anyone know why? thanks very much!
gao
Top achievements
Rank 1
 answered on 30 Apr 2008
2 answers
242 views
I need to make some columns ReadOnly conditionally in Item_DataBound
How to I reference the ReadOnly attributeof the column properly here?
I can't do it in Item_Created because I need the bound DataItem.

The following code is setting the wrong item...
        If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then  
            'switch the Item to Allow Edits of ListName if it is UserDefined  
            If DirectCast(e.Item.DataItem, InvoiceItem).ItemTypeID = "U" Then  
                'switching wrong row?  
                DirectCast(e.Item.OwnerTableView.GetColumnSafe("ListName"), GridBoundColumn).ReadOnly = False 
                DirectCast(e.Item.OwnerTableView.GetColumnSafe("Amount"), GridBoundColumn).ReadOnly = False 
            End If  
 

The above code sets only the first item in the grid, not the item I am referencing.
I can't seem to access the ReadOnly attribute with anything else.

Shinu
Top achievements
Rank 2
 answered on 30 Apr 2008
3 answers
169 views

I have been registering controls like the following:

<%@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadToolbar.NET2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.WebControls" Assembly="RadComboBox.Net2" %>
<%@ Register Assembly="RadInput.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

Telerik online demos instead use one register for all controls:
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

1. How do you set up a Visual Studio project to use this type registration?
2. Is the way I am doing it, registering individual controls, bad?
3. Using my current scheme, now I want to use RadTooltip but I don't know how to register it.
Because I cannot find a dll for RadTooltip in:

C:\Program Files\telerik\RadControls for ASP.NET Q1 2008\NET2\bin

So how may I register it?  And how may I add it to my Visual Studio toolbox?

John Davis
Top achievements
Rank 2
 answered on 30 Apr 2008
1 answer
169 views
I have a comboBox inside the EditItemTemplate for a Grid.
I am using the EnableLoadonDemand="true" for combo.

<

EditItemTemplate>
<telerik:RadComboBox ID="ddlDeviceAW" runat="server" EnableEmbeddedSkins="false" Skin="UTC" ImagesPath="../RadControls/UTC/ComboBox" EnableLoadOnDemand="true" LoadingMessage="Loading Device..." MarkFirstMatch="True" ToolTip="Select a Device" EnableVirtualScrolling="true" Width="150px" AllowCustomText="true" OnItemsRequested="ddlDeviceAW_ItemsRequested"></telerik:RadComboBox>
</EditItemTemplate>

The way I am loading the combo is:

protected

void ddlDeviceAW_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
RadComboBox ddlDevice = (RadComboBox)sender;
ddlDevice.DataSource = ds;
ddlDevice.DataMember = TableName;
ddlDevice .DataTextField = textFieldName;
ddlDevice .DataValueField = valueFieldName;
ddlDevice .DataBind();
}

It gives me an error at the DataBind() statement saying 
"Selection out of range
Parameter name: Value"

I have some more combos outside of the grid which loads fine with this approach.
Am I doing something wrong here.
The error comes only when I load data for the combo in edit mode. For Insert mode the comboBox behaves correctly.

I also have the GridItemBound event handler where I do this:

protected

void grdActiveWarning_ItemDataBound(object source, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
{
GridEditableItem editItem = e.Item as GridEditableItem;
RadComboBox ddlDirection = (RadComboBox)(editItem.FindControl("ddlDirectionAW"));

ddlDirection.Text = DataBinder.Eval(e.Item.DataItem, "DirectionValue").ToString();
ddlDirection.SelectedValue =
DataBinder.Eval(e.Item.DataItem, "DirectionValue").ToString();

RadComboBox ddlDevice = (RadComboBox)(editItem.FindControl("ddlDeviceAW"));
ddlDevice.Text = DataBinder.Eval(e.Item.DataItem, "DeviceValue").ToString();
ddlDevice.SelectedValue =
DataBinder.Eval(e.Item.DataItem, "DeviceValue").ToString();
}

}

Is there something I need to set which I am not doing for the grid?

newbie
Top achievements
Rank 1
 answered on 30 Apr 2008
2 answers
104 views
if i purchase the RadControls for AJAX can i use them on a non-ajax enabled asp.net site?

TIA,
mcm
mike
Top achievements
Rank 1
 answered on 29 Apr 2008
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?