Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
183 views
Hello,

If a GridClientSelectColumn column is included in a RadGrid that is bound client side, and the number of rows bound on the client exceeds the initial PageSize value, the check boxes are rendered in that column for the additional rows using a naming convention for the ids that can cause conflicts if multiple grids are included on the page and are bound in the same manner.  The problem is compounded if RadFormDecorator is used after data binding to ensure that the new check boxes have a style that is consistent with the other controls on the page, in that clicking a check box on one grid may result in the check box of the same ordinal row of another grid to be checked, instead, because they share the same id.

Specifically, the naming convention used for the ids of the new check boxes is "[row number]_SelectCheckBox" which means that two grids that have both bound data client side may each have check boxes with the same id.  The rendered id should include another component, such as the id of the grid, itself, to ensure the uniqueness of the id of each check box.

To replicate this issue, add two RadGrid controls to a page and include a GridClientSelectColumn in each.  Set the "PageSize" to 1 to minimize the amount of unnecessary HTML rendered on the server and transmitted to the client, and set "AllowPaging" to false.  Now, include logic to bind data to each of these grids, client side, where the number of items bound is greater than one.  View the IDs of the rendered check boxes using something like FireBug and note that the ids of new check boxes are the same in both grids.

To exacerbate the example, set "AllowScroll" to true and "ScrollHeight" to 200px, bind 100 rows to each grid client side (simulating a list box, effectively), and then call RadFormDecorator's decorate client method, passing the grid's element as the element parameter.  As a user of the page, don't touch the first grid, but instead scroll to the bottom of the second grid and click a check box.  What you will encounter is that after clicking the check box the screen scrolls down REALLY FAR to where the check box of the same id in the first grid resides, but which is not visible since the clipping overflow is hidden.  If you then go back to the first grid and scroll to the bottom of the list, you will find that the last check box of the first grid is now checked, while the check box you attempted to check in the second grid is not checked.

Please note that I don't want to set the initial "PageSize" arbitrarily high as a work around, because that will render too much HTML initially.  I am using several RadGrid controls on a single page as list boxes, since the client side API of RadGrid is so beautifully robust and flexible allowing me to do some really nice things that would be very challenging to do with RadListBox.  I'm sure I can get around the issue by rendering my own check boxes in a template column and forcing a special "check all" check box to be rendered in the header cell for that column, but I would like to avoid that hassle if possible.
Bradford
Top achievements
Rank 2
 answered on 02 Nov 2011
6 answers
229 views
Hello,
I need to make the AccessKey cause a click event on the tab associated with the key.  It does put a focus line around the tab, but it doesn't appear that any of the events fire for that.  I currently have to then hit the Enter key to cause a click event to occur.  How can I accomplish this using the RadTabStrip client API without resorting to some global keyboard code to catch the AccessKeys?  My current code is below (sorry, but the Format Code Block button put in some extra stuff).  I am using Q2 2011 sp1.  Thanks!
Michael

<P><script language="javascript" type="text/javascript"><BR
function mainTabSelected(sender, args) {<BR>    var tab =
eventArgs.get_tab();<BR>    tab.click();<BR
}<BR></script></P>
<P><telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0"
AutoPostBack="true" CausesValidation="false" ClickSelectedTab="true"
OnClientTabSelected="mainTabSelected"><BR
<Tabs><BR>    <telerik:RadTab ID="TabCampaignSetup"
Value="CampaignEdit" Text="<u>C</u>ampaign Setup" runat="server"
AccessKey="C" SelectedIndex="0"  /><BR>   
<telerik:RadTab ID="TabMassSubscription" Value="CampaignMassSubscriptions"
Text="<u>A</u>dd Subscriptions" runat="server" AccessKey="A"
SelectedIndex="1" /><BR>    <telerik:RadTab
ID="TabRemoveSubscriptions" Value="CampaignRemoveSubscriptions"
Text="<u>S</u>ubscriptions" runat="server" AccessKey="S"
SelectedIndex="2" /><BR>    <telerik:RadTab
ID="TabContactHistory" Value="CampaignContactHistory"
Text="C<u>o</u>ntacts" runat="server" AccessKey="O"
SelectedIndex="4" /><BR>    <telerik:RadTab
ID="TabCampaignHistory" Value="CampaignHistory"
Text="<u>H</u>istory" runat="server" AccessKey="H" SelectedIndex="3"
/><BR>  </Tabs><BR></telerik:RadTabStrip><BR></P>
Michael
Top achievements
Rank 1
 answered on 02 Nov 2011
5 answers
109 views
Hi,

Background:
in my asp.net 4.0 app (ajaxified) I reload content of tree on every postback.

Scenario:
2 users load same tree. First two items are ItemA and ItemB, so, user1 right clicks and deletes ItemA, his view is refreshed and he can see that there is no more ItemA. User2 thinks that he doesn't like ItemA he sees (in his already outdated view), right clicks -> Delete and instead of deleting nonexistent ItemA, ItemB gets deleted, because underneath tree was reloaded in Page_Load and context menu's index remained same, but node changed.

I get referenced node id to delete in
protected void tvProjectElements_ContextMenuItemClick(object sender, RadTreeViewContextMenuEventArgs e) {    }
from e.Node.Value

Suggestion:
Maybe for current (or in general) use case context menus should reference to nodes not by index, but by some internal "node-context menu (item) key"? Or this could be configurable, like setting custom key (most likely same as using custom attributes) or fetch node's DataValueField, anyway, to make them correspond to each other.

Possible workaround:
When I will get back to solving this issue, probably I will give a try to fix this using custom attributes (e.MenuItem.Attributes), setting those in data bound event for each nodes' context menu and checking in ContextMenuItemClick by comparing to e.Node.Value value.

Thanks :)
Plamen
Telerik team
 answered on 02 Nov 2011
1 answer
51 views
When double click into an appointment and edit the description, if the text contain "<text>" then the controller isn'ta able to save anything due to an error.  This seems like a bug.  I'm using the latest version of the dll.  This even happens on your demo site.  Is there a way around it?  Basically try putting "<xxx>" where xxx can be any letter.  Interestingly, if xxx is a number, it will work.

Thanks,
Eddie
Plamen
Telerik team
 answered on 02 Nov 2011
1 answer
119 views
Hi

I have a combobox that displays a longer description of the TextField when open than it displays when collapsed. I achieve this using an Item Template as below:

<telerik:RadComboBox ID="cmbP9" Runat="server" DataTextField="Code" DataValueField="P9CodeID" 
                ToolTip="P9" Width="200" DropDownWidth="400px" HighlightTemplatedItems="true">
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
   <ItemTemplate>
       <span>
       <asp:Literal runat="server" ID="litCode" Text='<%# Eval( "Code" )%>'></asp:Literal>
                     - 
      <asp:Literal runat="server" ID="litTitle" Text='<%# Eval( "Title" )%>'></asp:Literal>                    
       </span>
       <br />
   </ItemTemplate>
</telerik:RadComboBox>

I want to now be able to create a combobox like this entirely from code. How can I create an Item Template as above from code or is there another way of achieving the same thing?

Cheers

Stewart
Kalina
Telerik team
 answered on 02 Nov 2011
8 answers
175 views
I try to export a simple grid without any success

to excel - it only give me the current page when ignorpaging = false and none when ignorepaging = true

to pdf - it give me an error of unsupported file type.

How do I resolve this?
Lan
Top achievements
Rank 1
 answered on 02 Nov 2011
1 answer
71 views
Combobox selected values are not persisting on pressing Browser "Back" button.Is there any work around for this?
Kalina
Telerik team
 answered on 02 Nov 2011
2 answers
84 views

We have a text element on the left hand side, and a button on the right hand side of the treeview row.   We want to use a context menu which only gets activated when the blue image button is clicked.   What actually happens is the context menu is activated when we click anywhere on the treeview row (see picture attached).

We are using this nodetemplate in the RadTreeView with a context menu.

<NodeTemplate>
    <div style="width:100%;height:22px;">
        <span style="float:left;font-family:Arial;font-weight:bold;font-size:13px;">
        <%# DataBinder.Eval(Container, "Text") %>
        </span>
    <img class="treeGear" src="../img/gearsbluebtn.png" alt="Options" width="38px" height="22px" />
    </div>
</NodeTemplate>

 

How can we limit the context menu to only activate when the blue button is clicked? 

Marcus
Top achievements
Rank 1
 answered on 02 Nov 2011
5 answers
110 views
If I add a textbox or radtextbox to a template, you can't set focus to the textbox to enter text..  This work with IE7.  Testing failed with FF 3.6.1 and FF 4.01.

easy to reproduce:

<telerik:RibbonBarTemplateItem ID="templatetextbox">
    <Template>
        <asp:TextBox runat="server" ID="txtTest"></asp:TextBox>
    </Template>
</telerik:RibbonBarTemplateItem>
Kate
Telerik team
 answered on 02 Nov 2011
10 answers
450 views
Hi!
  I am using Telerik ASP.NET Ajax Controls  2011.2.712.40 on .NET 4.0 framework. In that I am facing an issue while using new feature of RadComboBox as Checkbox for multiple selection. It doesnt work fine on many browsers as I am unable to check check boxes. Below is the code snippet.


(In .aspx Page)

<telerik:RadComboBox ID="rdcmb" CheckBoxes="true" runat="server"
 EmptyMessage="Status"  DropDownWidth="200px"
 MaxHeight="140px"  Width="200px">
 </telerik:RadComboBox>

(In .aspx.cs)

if (rdcmb.CheckedItems != null)
            {
                status = string.Empty;
                var sb = new StringBuilder();
                var collection = rdcmb.CheckedItems;
                foreach (var item in collection)
                    sb.Append(item.Value + ",");
                String ApplicationVariable= sb.ToString();
            }
Kalina
Telerik team
 answered on 02 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?