Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
662 views
Hi

I know we can create a argument assign the value we have to pass to the parent window from the modal popup, but is there a way where we can pass more than one values as arguments to the parent page?

Following is the code i am using now:

In the parent page:
function OnSelectCodePopUpClose(oWnd, args) {
        
            var arg = args.get_argument();
            if (arg) {
                var returnText = arg.returnText;
            }

In the rad window popup page:

 function closewin() {
        var oArg = new Object();
        oArg.returnText = document.getElementById("<%= HdnTxt.ClientID %>").value;
        // I want to pass two other values back to the other page.
// Is there a oArg array or something??
        GetRadWindow().close(oArg);
}

Thanks
Rishi

robertw102
Top achievements
Rank 1
 answered on 25 Mar 2010
1 answer
154 views
Is it possible to have a vertical menu that is hidden on the page unless custom menu image (in top left corner) clicked, then it would slide down where each menu item when hovered over would (potentially, not all items) expand to the right with more sub-menu items.
I'd also like to integrate it with Breadcrumb/ShowPath with it.
When each top menu item hovered - background image would change (different images for submenu items)
And I need all menu items to potentially have an icon of its own.

I'm debating to switch my JSF project to Telerik as too many problems occur with JSF, but I have highly customized menu I'd like to port without much trouble. It would probably also require to set width and height on each menu item to accommodate background images and icons. Also spacings/paddings.

Thank you!
Yana
Telerik team
 answered on 25 Mar 2010
2 answers
204 views
Forgive the length of this post, but I'm attempting to give all relevant details.

I am currently selecting a single row in a grid by using the ClientSettings-ClientEvents-OnRowClick event. I have linked up a JavaScript function that executes when the row is clicked. It saves an ID from the ClientDataKeys property into a hidden field on the page and then "clicks" a hidden button to load another grid with rows matching the ID. (Basically a master-detail situation, but in two separate grids). Here is the JavaScript and C# server-side code that gets executed:

JavaScript
    // Client-side event called by Rad grid when a row is selected.  
    // Gets the Id of the selected profile and saves it in hidden field.  
    function RowSelected(sender, eventArgs)  
    {  
        var hidden = $get("<%=selectedLocationRowId.ClientID %>");  
        hidden.value = eventArgs.getDataKeyValue("Id");  
        // Need to "press button" on page to initiate server-side code  
        var button = $get("<%=btnServerGrid.ClientID %>");  
        button.click();  
    } 

C# - Server-side - exeucted by the "button.click()" line above.
         protected void GetServerData(object sender, EventArgs e)  
         {  
             ServerController sc = new ServerController();  
             List<ServerModel> list = null;  
             string s = selectedLocationRowId.Value;  
             if(!string.IsNullOrEmpty(s))  
             {  
                 list = sc.ListServers(new Guid(s)).ToList();  
             }  
             else 
             {  
                 list = new List<ServerModel>();  
             }  
             rgrdServers.DataSource = list;  
             rgrdServers.Rebind();               
         } 

As you can see, the server-side code retrieves the value from the hidden field and then uses that to get the list from our business layer and then populates the grid.

I also have an Edit column in the primary grid that initiates in-place editing of the row. The user can have a row selected and then choose to press the "Edit" link in the edit column in a different row. This takes the highlight off of the currently selected row and puts the editable row into edit mode, but the secondary grid is not updated with the new "child" rows.

I've been trying to somehow execute the population of the secondary grid from the EditCommand (and a number of other places - like ItemCommand) but can't seem to get the secondary grid to refresh itself with new data. The list is retrieved successfully, but the grid does not update with the new data.

I am using "advanced" databinding with the OnNeedDataSource event. The editing and paging works fine - it's just that I seem to somehow have to execute the JavaScript event for ClientSettings-ClientEvents-OnRowClick in order to get this to work. (I'm guessing here as well. I'm just assuming that executing that client-side code from the server might solve this problem.)

I should also include the definition of the grid with appropriate defined events and such. here it is:
<telerik:RadGrid ID="rgrdLocations" runat="server" AllowPaging="true" 
    AllowFilteringByColumn="false" AllowMultiRowSelection="false" Height="260px" 
    ShowGroupPanel="false" GroupingEnabled="false" 
    ShowHeader="true" Skin="MSGridSkin" EnableEmbeddedSkins="false" 
    OnItemCreated="rgrdLocations_ItemCreated" AutoGenerateColumns="false"   
    Width="786px" onneeddatasource="RadNeedDataSource"   
    onitemdatabound="rgrdLocations_ItemDataBound"   
    AllowAutomaticUpdates="false" 
    onupdatecommand="rgrdLocations_UpdateCommand" 
    oncancelcommand="rgrdLocations_CancelCommand"   
    oneditcommand="rgrdLocations_EditCommand"   
    onitemcommand="rgrdLocations_ItemCommand" 
    ClientSettings-ClientEvents-OnRowClick="RowSelected">  
      
    <ClientSettings AllowDragToGroup="false" Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true">  
        <Selecting AllowRowSelect="true" /> 
        <Scrolling AllowScroll="false" /> 
        <Resizing AllowColumnResize="false" /> 
    </ClientSettings> 
      
    <PagerStyle Position=Top Mode="NextPrev" AlwaysVisible="true"/>  
    <MasterTableView AutoGenerateColumns="false" PageSize="9" GridLines="Vertical"   
        TableLayout="Fixed" EditMode="InPlace" DataKeyNames="Id" ClientDataKeyNames="Id">  
        <PagerTemplate>                                          
            <table width="100%" cellpadding="0" cellspacing="0" border="0" 
                style="border-top:0px; border-top-color:White;">  
                <tr style="background-color:#e1e6dc; border-top:0px;">  
                    <td align="left" style="height:26px; padding-left:10px;">  
                        <asp:Label ID="lblLocationsHead" runat="server" Text="System Locations" style="font-family:Verdana; font-weight:bold; font-size:11px; color:#666666;">  
                        </asp:Label> 
                    </td>                                                  
                    <td align="right" style="height:26px; padding-right:10px;">  
                        <asp:ImageButton ID="imgPrev" ImageUrl="~/Images/arr_left_cal.gif" runat="server">  
                        </asp:ImageButton> 
                        <asp:DropDownList ID="ddlPager" runat="server">  
                        </asp:DropDownList>                                                  
                        <asp:ImageButton ID="imgNext" runat="server" ImageUrl="~/Images/arr_right_cal.gif">  
                        </asp:ImageButton> 
                    </td> 
                </tr> 
            </table>                                          
        </PagerTemplate> 
 
        <Columns> 
            <telerik:GridTemplateColumn HeaderText="Actions" HeaderStyle-Width="13%" UniqueName="EditColumn">  
                <ItemTemplate> 
                    <asp:LinkButton ID="Edit" CommandName="Edit" runat="server">Edit</asp:LinkButton> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <table cellpadding="0" cellspacing="0" border="0">  
                        <tr style="padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;">  
                            <td style="padding:0px 0px 0px 0px;"><asp:LinkButton ID="Cancel" runat="server" CommandName="Cancel" style="font-size:11px;">Cancel</asp:LinkButton></td>  
                            <td style="color:#CCCCCC; padding:0px 0px 0px 0px;">&nbsp;|&nbsp;</td> 
                            <td style="padding:0px 0px 0px 0px;"><asp:LinkButton ID="Save" runat="server" CommandName="Update" style="font-size:11px;">Save</asp:LinkButton></td>  
                        </tr> 
                    </table> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
 
            <telerik:GridTemplateColumn HeaderText="Building Name" HeaderStyle-Width="38%">  
                <ItemTemplate> 
                    <asp:Label ID="BuildingName" runat="server" Font-Size="10px" Text='<%# Eval("BuildingName") %>'></asp:Label> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <asp:Label ID="BuildingNameEdit" runat="server" Font-Size="10px" Text='<%# Eval("BuildingName") %>'></asp:Label> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
 
            <telerik:GridTemplateColumn HeaderText="System Location" HeaderStyle-Width="23%">  
                <ItemTemplate> 
                    <asp:Label ID="Location" runat="server" Font-Size="10px" Text='<%# Eval("Location") %>'></asp:Label> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <asp:Label ID="LocationEdit" runat="server" Font-Size="10px" Text='<%# Eval("Location") %>'></asp:Label> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
                                                      
            <telerik:GridTemplateColumn HeaderText="Branch Office" HeaderStyle-Width="10%">  
                <ItemTemplate> 
                    <asp:CheckBox ID="BranchOffice" runat="server" Checked='<%# Eval("IsBranchOffice") %>' /> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <asp:CheckBox ID="BranchOfficeEdit" runat="server" Checked='<%# Eval("IsBranchOffice") %>' /> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridTemplateColumn HeaderText="Country Code" HeaderStyle-Width="7%">  
                <ItemTemplate> 
                    <asp:Label ID="CountryCode" runat="server" Font-Size="10px" Text='<%# Eval("CountryCode") %>'></asp:Label> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <asp:TextBox ID="CountryCodeEdit" runat="server" Font-Size="10px" Width="15" Text='<%# Eval("CountryCode") %>'></asp:TextBox> 
                </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridTemplateColumn HeaderText="Area Code" HeaderStyle-Width="9%">  
                <ItemTemplate> 
                    <asp:Label ID="AreaCode" runat="server" Font-Size="10px" Text='<%# Eval("AreaCode") %>'></asp:Label> 
                </ItemTemplate> 
                <EditItemTemplate> 
                    <asp:TextBox ID="AreaCodeEdit" runat="server" Width="45" Font-Size="10px" Text='<%# Eval("AreaCode") %>'></asp:TextBox> 
                </EditItemTemplate>                                              
            </telerik:GridTemplateColumn> 
            <telerik:GridBoundColumn DataField="Id" Visible=false ReadOnly="false"></telerik:GridBoundColumn>                                          
        </Columns> 
    </MasterTableView> 
      
</telerik:RadGrid> 


Once again, sorry about the length. Anyone willing to help?

Thanks.
Charles
Top achievements
Rank 2
 answered on 25 Mar 2010
3 answers
190 views
hello,

can i get the sample for telerik Like Search Box with results populated in grid

Regards,
Naga Sridhar madiraju
robertw102
Top achievements
Rank 1
 answered on 25 Mar 2010
17 answers
310 views
After updating my dll with the Q2 version, my custom skins are broken, particularly with the panelbar. On closer inspection, I see many new classes in the panelbar css for the newest versions of the embedable skins, and it looks like the new dll is looking for these new classes when rendering the controls. Is it possible that I can update to Q2 without recreating all of my custom skins (I have dozens)? Help! Help! Help!
Pero
Telerik team
 answered on 25 Mar 2010
9 answers
364 views
Hi everybody,
I want to change my mouse cursor from a beam into a pointing hand (or something like that) when i hover over the rows of the grid, so the user knows he can click on the row to get more info... Saw some C# code, but could not get it to work. I work in VB.NET.

Cheers, Peter.
peter
Top achievements
Rank 1
 answered on 25 Mar 2010
5 answers
71 views
I know the template is available
Yana
Telerik team
 answered on 25 Mar 2010
8 answers
212 views
Hi,
    I am having the Grid which has number of NestedGrid's. Each Nested grid has its own export button. When i tried to export the data of one of the nested grid. I am getting the following error. I cannot point out the following error.


The '*' character, hexadecimal value 0x2A, cannot be included in a name.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Xml.XmlException: The '*' character, hexadecimal value 0x2A, cannot be included in a name.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[XmlException: The '*' character, hexadecimal value 0x2A, cannot be included in a name.]
   System.Xml.ValidateNames.ThrowInvalidName(String s, Int32 offsetStartChar, Int32 offsetBadChar) +255
   System.Xml.ValidateNames.ParseQNameThrow(String s, String& prefix, String& localName) +49
   System.Xml.Xsl.Runtime.XmlQueryRuntime.ParseTagName(String tagName, Int32 idxPrefixMappings, String& prefix, String& localName, String& ns) +21
   System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStartComputed(XPathNodeType nodeType, String tagName, Int32 prefixMappingsIndex) +50
   System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStartAttributeComputed(String tagName, Int32 prefixMappingsIndex) +14
   <xsl:template name="process-style">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, IList`1 style) +1709
   <xsl:template match="html:div">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +566
   <xsl:template name="process-table-cell">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +6251
   <xsl:template match="html:td">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +114
   <xsl:template name="process-common-attributes-and-children">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +122
   <xsl:template match="html:tr">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +106
   <xsl:template name="process-common-attributes-and-children">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +122
   <xsl:template match="html:thead">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +114
   <xsl:template name="process-table">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +6994
   <xsl:template match="html:table">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +125
   <xsl:template match="html:body">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +2675
   <xsl:template match="html:html">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current) +186
   <xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator ) +12113
   Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) +91
   Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) +28
   System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) +88
   System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter) +121
   System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results) +47
   System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results) +46
   System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) +52
   Telerik.Web.UI.Grid.Export.TableViewExporter.PdfExportRenderForm(HtmlTextWriter nullWriter, Control form) +1678
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +8673113
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   Telerik.Web.UI.Grid.Export.TableViewExporter.PdfExportRenderPage(HtmlTextWriter nullWriter, Control page) +161
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +825
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


-Thanks
Bruno
Top achievements
Rank 2
 answered on 25 Mar 2010
3 answers
120 views
I could use a Telerik ASP.NET AJAX control that encapsulates functionality as described in Using ASP.NET to Prompt a User to Save When Leaving a Page.

The idea is to display a modal RADWindow when the user is about to navigate away from a page that's "dirty" (has unsaved data). It would be nice to have a mechanism that tracks the "dirty" status automatically. Most approaches seem to require handling the tracking manually which would be a pain on a busy page.

Ken
Georgi Tunev
Telerik team
 answered on 25 Mar 2010
1 answer
110 views
I have a very long list of XAxis items dynamically added to the chart at run time.  I am unable to find the correct setting to allow the chart to vertically resize to fit them all.  Please help.
private void UpdateChrtZipCodes(DataSet ds)

 

{

    chrtZipCode.Legend.Visible =

false;

 

     chrtZipCode.PlotArea.XAxis.Clear();

     

EmptySeriesMessage message = chrtZipCode.PlotArea.EmptySeriesMessage;

 

     message.TextBlock.Text =

"No Data Available.";

 

 

 

//if (ds.Tables[0].Rows.Count > 20)

 

 

// chrtZipCode.Height = (ds.Tables[0].Rows.Count * 20);  tried this and it made it too long

    

chrtZipCode.AutoLayout = true;

 

    chrtZipCode.PlotArea.XAxis.AutoScale =

false;

 

 

 

 

 

foreach (DataRow dbRow in ds.Tables[0].Rows)

{

    chrtZipCode.PlotArea.XAxis.AddItem(

new ChartAxisItem(dbRow["ZipCode"].ToString()));

 

 

 }

chrtZipCode.PlotArea.XAxis.LayoutMode =

ChartAxisLayoutMode.Between;

 

 

 

// Gets the one and the only series in the chart.

 

 

 

ChartSeries s0 = chrtZipCode.Series.GetSeries(0);

 

 

 

// If it doesn't exist - create and set it.

 

 

 

if (s0 == null)

 

 

 {

    s0 = chrtZipCode.CreateSeries(

string.Empty, Color.Empty, Color.Empty, ChartSeriesType.Bar);

 

 

}

s0.Type =

ChartSeriesType.Bar;

 

 

 s0.Appearance.ShowLabels =

true;

 

 

 s0.DefaultLabelValue =

"#Y";

 

 

 s0.DataYColumn =

"TheCount";

 

 

 s0.Appearance.LabelAppearance.FillStyle.MainColor =

Color.White;

 

 

 s0.Appearance.LabelAppearance.Border.Color =

Color.Black;

 

 

 s0.Appearance.TextAppearance.TextProperties.Color =

Color.Black;

 

 

 

// Clear series items.

 

s0.Clear();

 

 

// Set new items for the series.

 

foreach (DataRow dbRow in ds.Tables[0].Rows)

 

 

 {

     

ChartSeriesItem seriesItem = new ChartSeriesItem();

 

     seriesItem.YValue =

Convert.ToDouble(dbRow["TheCount"]);

 

     seriesItem.Appearance.Border.Color =

Color.Black;

 

     s0.Items.Add(seriesItem);

 

}

 

}

 

 

Ves
Telerik team
 answered on 25 Mar 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?