Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
548 views
I'm having a couple problems with NestedViewTemplates in RadGrid.  I have enabled PostbackOnRowClick for the grid and assigned an OnItemCommand to the RadGrid so that I can execute code when the row is expanded.  The problem is, the command seems to execute twice when the user clicks on the ExpandCollapse button.  Once for "ExpandCollapse" command and once for "RowClick".  What I'd like is for either an ExpandCollapse OR a RowClick to execute the ItemCommand method, and then stop, rather than executing it again.  Is there a way to do this? 

Also, how do I capture the "Expand" event on the client side?  And is it possible to hide the ExpandCollapse column in a NetsedViewTemplate?  As you can see from my code, I've tried just about everything to hide it but nothing seems to work...

Here's a code sample of what I'm doing:
<telerik:RadGrid runat="server" ID="radGridWts" GridLines="Horizontal"      
    AutoGenerateColumns="false" EnableAjaxSkinRendering="True" Skin="Office2007"      
    ClientSettings-EnableRowHoverStyle="true" OnItemCommand="radGridWts_ItemCommand"    
    OnItemDataBound="radGridWts_ItemDataBound" ShowDesignTimeSmartTagMessage="true">     
    <ClientSettings EnablePostBackOnRowClick="True" AllowExpandCollapse="false">     
        <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="false" EnableRealTimeResize="true" />    
    </ClientSettings>    
    <MasterTableView DataKeyNames="WtID,WtRid">  
        <ExpandCollapseColumn Display="false" Visible="false">     
            <HeaderStyle Width="0px" />    
            <ItemStyle Width="0px" />    
        </ExpandCollapseColumn>    
        <RowIndicatorColumn Visible="False">     
            <HeaderStyle Width="20px" />    
        </RowIndicatorColumn>    
        <Columns> 
            <telerik:GridBoundColumn HeaderText="WtID" Visible="False" HeaderStyle-HorizontalAlign="Left" DataField="WtID" UniqueName="colWtId"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Sev" HeaderStyle-HorizontalAlign="Left" DataField="Severity"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="RID" DataField="WtRid"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Wt Number" DataField="WtNumber" ></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Date" DataField="DateIssued" DataFormatString="{0:d}"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Type" DataField="WtType"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Section" DataField="WtCode"></telerik:GridBoundColumn>    
            <telerik:GridBoundColumn HeaderText="Bail Amount" DataField="BailAmount" DataFormatString="{0:C}" UniqueName="colBailAmt"></telerik:GridBoundColumn>    
        </Columns>    
        <NestedViewTemplate>    
            <div style="padding:5px;">     
                <div id="buttons">     
                    <style="float:right; margin-left:-155px; margin-top:5px; position:absolute"      
                        href="" tabindex="32" onmouseup="javascript:window.focus()"      
                        onclick="javascript:CopyWtDetails('<%= strCopyWtDetails %>');return false;" class="copy"></a>    
                </div>    
                <asp:Label runat="server" ID="lblWtDetail"></asp:Label>    
                <div style="border-top: 1px solid #ccc; padding-top: 5px;">     
                    <telerik:RadPanelBar runat="server" ID="rPanelBarDdVisits" Width="100%" EnableEmbeddedSkins="false"    
                        Skin="Hay" ExpandAnimation-Type="InBounce" OnClientItemClicking="OnClientItemClicking">     
                        <Items>    
                            <telerik:RadPanelItem runat="server" Text="Due Diligence" Expanded="false" ExpandedImageUrl="../images/submenu_dn.gif"    
                                ImageUrl="../images/submenu.gif">     
                                <Items>    
                                    <telerik:RadPanelItem runat="server">     
                                        <ItemTemplate>    
                                            <div style="margin: 3px 0px 1px 0px;">     
                                                <telerik:RadGrid runat="server" ID="rGridDdVisits" Skin="Office2007" AutoGenerateColumns="false">  
                                                    <MasterTableView>    
                                                        <Columns>    
                                                            <telerik:GridBoundColumn HeaderText="DATE" DataField="CommentDate" DataFormatString="{0:d}">  
                                                            </telerik:GridBoundColumn>    
                                                            <telerik:GridBoundColumn HeaderText="DESCRIPTION" DataField="Comment">  
                                                            </telerik:GridBoundColumn>    
                                                            <telerik:GridBoundColumn HeaderText="LEA" DataField="Lea">  
                                                            </telerik:GridBoundColumn>    
                                                            <telerik:GridBoundColumn HeaderText="OFFICER" DataField="Officer">  
                                                            </telerik:GridBoundColumn>    
                                                        </Columns>    
                                                    </MasterTableView>    
                                                </telerik:RadGrid>    
                                            </div>    
                                        </ItemTemplate>    
                                    </telerik:RadPanelItem>    
                                </Items>    
                            </telerik:RadPanelItem>    
                        </Items>    
                    </telerik:RadPanelBar>    
                </div>    
            </div>                                             
        </NestedViewTemplate>    
    </MasterTableView>    
</telerik:RadGrid>   
 

protected void radGridWts_ItemCommand(object sender, GridCommandEventArgs e)  
{  
    if (e.Item is GridDataItem)  
    {                  
        string strWtID = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["WtID"].ToString();  
        string strRid = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["WtRid"].ToString();  
 
        if (e.CommandName == "RowClick" || e.CommandName == "ExpandCollapse")  
            if (!e.Item.Expanded)  
            {  
                e.Item.Expanded = true;  
                e.Item.Selected = true;  
 
                Wt w = Wt.getWtDetails(strWtID, strRid);  
                if (w != null)  
                {  
                    strCopyWtDetails = BuildCopyWtDetails(w);  
                    Label lblWtDetail;  
                    GridNestedViewItem nviWtDetails =  
                        ((GridTableView)e.Item.Parent.Parent).Items[e.Item.ItemIndex].ChildItem;  
                    lblWtDetail = nviWtDetails.FindControl("lblWtDetail"as Label;  
                    RadPanelBar rpb = nviWtDetails.FindControl("rPanelBarDueDiligence"as RadPanelBar;  
 
                    if (w.DdVisits != null && w.DdVisits.Count > 0)  
                    {  
                        if (rpb != null)  
                            if (rpb.Items[0].Text.IndexOf("(") < 0)  
                                rpb.Items[0].Text += " (" + w.DdVisits.Count + ")";  
 
                        RadGrid rGridDdVisits =  
                            nviWtDetails.FindControl("rPanelBarDueDiligence").Controls[0].Controls[0].  
                                FindControl("rGridDueDiligence"as RadGrid;  
                        if (rGridDdVisits != null)  
                        {  
                            rGridDdVisits.DataSource = w.DdVisits;  
                            rGridDdVisits.DataBind();  
                        }  
                    }  
                    else if (w.DdVisits == null || w.DdVisits.Count < 1) if (rpb != null) rpb.Visible = false;  
 
                    if (lblWtDetail != null)  
                        lblWtDetail.Text = WriteWtDetails(w).ToString();  
                }  
            }  
            else 
                e.Item.Expanded = false;  
    }  

Thanks for the help!
Eddie
Antonio Stoilkov
Telerik team
 answered on 13 Feb 2013
5 answers
179 views
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'Telerik.Web.UI   201'. Can Any tell me why this error occurs


Thanks & Regards
Princia
Radoslav
Telerik team
 answered on 13 Feb 2013
1 answer
165 views
Hi,

I am using telerik version 2009.02.0701.35 in my project.
We have a requirement to make the existing stacked bar chart to display in 3D format.
Please suggest me on how to achieve this feature.

Regards,
Meenakshi
MasterChiefMasterChef
Top achievements
Rank 2
 answered on 13 Feb 2013
3 answers
187 views
Hello,
I have a height problem for combobox as well. I have tried the solution in
http://http//www.telerik.com/community/forums/aspnet-ajax/combobox/how-to-set-the-height-of-the-textbox-of-the-radcombobox.aspx
But it doesn't work.

Could you please help me?
Elif
Top achievements
Rank 1
 answered on 13 Feb 2013
5 answers
250 views
I notice that on the telerik demos as well as in my own apps, when I click the outside border of my grid, the border changes from solid to dotted. Is there a workaround for this?
Radoslav
Telerik team
 answered on 13 Feb 2013
1 answer
76 views
I have used Raddockzone in my page but it is not getting rounded corner. I have attached the screenshot for the same.  Let me know if I have missed anything in the below code. Thanks in advance.
<telerik:RadDockLayout ID="RadDockLayout1" runat="server">

 

 

 

<telerik:RadDockZone ID="radDockZoneDefectDashboard" runat="server" Width="1320"
Orientation="Horizontal" BorderStyle="None">

 

 

 

 

 

 

 

<telerik:RadDock ID="radDockOpenAging" runat="server" Title="Open Defect Aging (Severity 1 and 2 only)"

 

 

 

 

 

 

 

EnableRoundedCorners="true" DockMode="Docked" Width="423" CssClass="RedTitle"

 

 

 

 

 

 

 

EnableDrag="false" DefaultCommands="ExpandCollapse" Height="350px" AllowedZones="radDockZoneDefectDashboard">

 

 

 

 

 

 

 

<ContentTemplate>

 

 

 

 

 

 

 

<table runat="server">

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

<div id="divChartOpenAging" runat="server" visible="false">

 

 

 

 

 

 

 

<asp:Image ID="imgChartOpenAging1" runat="server" ImageUrl="../PPI/Images/ChartImages/NoDataSeries_Black_300.png" />

 

 

 

 

 

 

 

</div>

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

 

<td>

 

 

 

 

 

 

 

<telerik:RadHtmlChart ID="radHtmlChartOpenAging" runat="server" Width="350px" Height="300px">

 

 

 

 

 

 

 

<Legend>

 

 

 

 

 

 

 

<Appearance Position="Bottom" Visible="true" BackgroundColor="white" />

 

 

 

 

 

 

 

</Legend>

 

 

 

 

 

 

 

<PlotArea>

 

 

 

 

 

 

 

<XAxis>

 

 

 

 

 

 

 

<MajorGridLines Visible="false" />

 

 

 

 

 

 

 

<MinorGridLines Visible="false" />

 

 

 

 

 

 

 

</XAxis>

 

 

 

 

 

 

 

<YAxis>

 

 

 

 

 

 

 

<MajorGridLines Visible="false" />

 

 

 

 

 

 

 

<MinorGridLines Visible="false" />

 

 

 

 

 

 

 

</YAxis>

 

 

 

 

 

 

 

</PlotArea>

 

 

 

 

 

 

 

</telerik:RadHtmlChart>

 

 

 

 

 

 

 

</td>

 

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

 

</table>

 

 

 

 

 

 

 

</ContentTemplate>

 

 

 

 

 

 

 

</telerik:RadDock>

 

 

 

</telerik:RadDockZone>

 

 

 

 

 

 

 

</telerik:RadDockLayout>

 

Slav
Telerik team
 answered on 13 Feb 2013
3 answers
46 views
I have a radListBox with one item in it (loaded on the server side). That item is checked.

When I insert another item above it on the client side, the new item becomes the only checked item, and the existing checked item loses it's checked status, even though it still APPEARS to be checked. I AM using trackChanges and commitChanges.

To verify this:
Before inserting, display the value of rlbTest.get_checkedItems()[0].get_text(). It will display the text of the initial item.
After inserting a new item (not yet checked) at the same index as the existing item using itemList.insert(itemList.indexOf(oldItem), newItem) display the value of get_checkedItems()[0].get_text() again. It displays the value of the NEW item, even though that item is not yet checked! If you display get_checkedItems.length it will show 1.
Now set the new item checked, and commit the changes. Display the two values again. length is still only 1, and value is the value of the new item.
The old item still appears to be checked. Both items will return .get_checked() == true. But when posted back to the server, .GetCheckedIndices returns just ONE index - 0 (the new item).

Just found that the same problem appies to selected items!
Nencho
Telerik team
 answered on 13 Feb 2013
1 answer
38 views
Good Morning,

I am having problems using Radwindows in IE. I have set width and height of my radwindow and I have also set the dimmensions of a  DIV within the new page I need to open. This works perfect in only one page. I copied and pasted this working code to other areas of the same page. I made sure that they are identical. However, these other ones will open a radwindow showing the right page but will not show in the correct modal mode and correct dimmensions as I need to.
I have read different blogs referring to situtations similar to mine but I still have this issue where only one works. Would you please help me? Thanks.


Marin Bratanov
Telerik team
 answered on 13 Feb 2013
1 answer
169 views
I have a radgrid, click a hyperlink column on the radgrid opens a rad window, after I edit the text field on the rad window, I need to close the radwindow and refresh the grid to show the text change. The grid has mutiple  pages. If I was on page 5 before open the radwinow, after close radwindow, grid gets refreshed and goes to page 1. Is there anyway that I can let the grid stays on page 5 after radwindow close?


<telerik:GridHyperLinkColumn DataNavigateUrlFields="TagID, LanguageID2" SortExpression="TagName"  ShowFilterIcon="false"
                                       DataTextField="TagName" HeaderText="Tag Name" FilterControlWidth="100px" UniqueName="TagName"
                                       AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"  
                                       DataNavigateUrlFormatString="javascript:function anon(){{window.radopen('MyPopUp.aspx?TID={0}&LID={1}','TranslationView');}};anon();">
                                       <HeaderStyle Width="100px" />
                                   </telerik:GridHyperLinkColumn>
<
script type="text/javascript">
      function OnClientClose(sender, args) {
               top.location.href = top.location.href;
      }
  </script>
Thanks!
Vasil
Telerik team
 answered on 13 Feb 2013
3 answers
698 views

I have a web form with several RadTextBoxes.  One is shown here.

                <telerik:RadNumericTextBox ID="tbHospitalPerVisit" runat="server" MaxLength="8" Width="115px"
                ReadOnlyStyle-CssClass="ReadonlyDataEntry" EnabledStyle-HorizontalAlign="Right"
                DisabledStyle-HorizontalAlign="Right">
                <NumberFormat ZeroPattern="n"></NumberFormat>
                <ReadOnlyStyle CssClass="ReadonlyDataEntry"></ReadOnlyStyle>
            </telerik:RadNumericTextBox>

The EnabledStyle-HorizontalAlign property right aligns the text in the control.  When the page first loads I see the control formatted with the text right aligned.  On postback, however, the control is visible for a brief moment without the right alignment and then the text jumps to the right as the alignment is applied.

My form has about 50 controls for collecting financial information.  Immagine seing data in all these controls jump from the left to the right when you save.

How do I get the styling to be applied so that I do not see the control first displayed without the right alignment and then the alignment is applied?

Thanks!

Sean Severson

Angel Petrov
Telerik team
 answered on 13 Feb 2013
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
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
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?