Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
89 views

Hi,

I have a multilevel grid and I want to export them out as Excel. I set

 

 

 

ExportSettings.ExportOnlyData = true;

 

 

ExportSettings.IgnorePaging = true;

 

 

ExportSettings.OpenInNewWindow = true;

It can popup downloading window and export the master grid if I haven't expanded any detail table. However, if I ever expand any detail table, the grid will just display the export table in current page. I checked my code, the OpenInNewWindow is always set to ture before it call ExportToExcel().

However, if I set HierarchyLoadMode="Client" in the MasterTableView, I won't get the above problem even if I expand any detail table.

I want to use server side hierarchy load mode and avoid the above problem.
Does any body know this trick??

Thanks a lot,
Joe

 

Yavor
Telerik team
 answered on 08 Jul 2009
1 answer
73 views
Hi!

After I upgraded from Version 2008.1.515.35 to 2008.3.1314.20 some of my Items now have a margin, or padding.

In particular this RadTree is now about 20px away from the left border of the RadPanelItem that contains the Tree:

<telerik:RadPane ID="rpTreeView" Runat="server" Width="300px"  Height="100%" 
                            OnClientResized="ResizeTabStrip" CssClass="treeview" Scrolling="Both">  
                            <telerik:RadMultiPage ID="rmpTabStrip" Runat="server" RadControlsDir="~/Img/Skins/"   
                                SelectedIndex="0" CssClass="treeview" Width="100%" Height="100%">  
                                <telerik:RadPageView ID="Operational" runat="server" Height="100%" Width="100%">  
                                    <telerik:RadPanelbar ID="rpbOperational" Runat="server" 
                                        Width="100%" Height="96%" 
                                        ExpandMode="FullExpandedItem"   
                                        SkinsPath="~/Img/Skins/Panelbar/Skins/" 
                                        RadControlsDir="~/Img/Skins/" 
                                        Skin="Office2007" style="background-color:#f0f0f0">  
                                        <Items> 
                                            <telerik:RadPanelItem Value="Geo" runat="server" meta:resourcekey="panel_geographic" Expanded="True" CssClass="treeview">  
                                                <Items> 
                                                    <telerik:RadPanelItem Value="GeoTree" runat="server" CssClass="treeview">  
                                                        <ItemTemplate> 
                                                            <telerik:RadTreeView ID="rtGeographic" Runat="server"   
                                                                    Skin="Vista" CssClass="treeview" 
                                                                    MultipleSelect="true" 
                                                                    onnodeexpand="rtGeographic_NodeExpand"   
                                                                    onClientNodeClicking="onClientNodeClick" 
                                                                    OnContextMenuItemClick="rtGeographic_ContextMenuItemClick" 
                                                                    meta:resourcekey="radTreeView" 
                                                                    OnClientContextMenuItemClicked="onClientCtxmOperationalClicked"                                   
                                                                    OnClientContextMenuShowing="onClientCtxmOperationalShowing">  
                                                                    <contextmenus> 

Are there any known issues with this? I wish I could attach images, it would clear up a lot. But the thing is that it also happened with PanelBar items, they are now longer than the designated area of the PanelBar and reach outside the visible scope. After I resize the Splitter the PanelBar is inside of the PanelBar gets displayed correctly, however, the Tree is still off to the right.

Thanks for any input!
Helmut Stelczenmayr
Top achievements
Rank 1
 answered on 08 Jul 2009
1 answer
492 views
Relevant code:
ASP: 
<telerik:GridBoundColumn DataField="TaskKey" UniqueName="colTaskKey" ReadOnly="true" Display="true" /> 
 
 
C#: 
protected void grdAssign_UpdateCommand(object sender, GridCommandEventArgs e) 
 { 
    GridDataItem item = (GridDataItem)e.Item; 
    int taskKey = Int32.Parse(item["colTaskKey"].Text); 

The column is being displayed only for debugging purposes, so I can verify that yes, it is being populated with the correct data.  When I run this, Int32.Parse throws a FormatException because the string being passed to it is "&nbsp;".  I have not been able to figure out why this is.


Princy
Top achievements
Rank 2
 answered on 08 Jul 2009
10 answers
453 views
Can anyone please help me with how to traverse and change the GroupHeaderItems in the PreRender event.  I know how to do this in the ItemDataBount event with the below code, but this won't work because everytime a user closes a grouping the changes I make to the groupheaderitem go away.

if (e.Item is GridGroupHeaderItem)  
        {  
            GridGroupHeaderItem item = e.Item as GridGroupHeaderItem;  
            string grpIndx = item.GroupIndex.ToString();  
 
            if (grpIndx.Length >= 5)  
            {  
                if (grpIndx.Substring(grpIndx.Length - 2) == "_0")  
                {  
                    DataRowView groupDataRow = (DataRowView)e.Item.DataItem;  
 
                    // Make sure a project exists by checking the Project Id group value  
                    if (string.IsNullOrEmpty(groupDataRow.Row["ProjectId"].ToString()))  
                    {  
                        // Hide the Project grouping  
                        item.Visible = false;  
                    }  
                    else  
                    {  
                        if (groupDataRow.Row["ReleasedByProject"].ToString().ToUpper() != "TRUE") // (!ois.ReleasedByProject)  
                        {  
                            HyperLink lnk = new HyperLink();  
                            lnk.ID = "btnProjRelease";  
                            lnk.Text = "Click To Release";  
                            lnk.ToolTip = "Project Release";  
                            lnk.NavigateUrl = "#";  
                            lnk.Attributes["onclick"] = string.Format("return RunProjectRelease('{0}');", groupDataRow.Row["ProductId"].ToString());  
                            lnk.Enabled = _isReleasedByAccounting && _canCompleteSteps;  
 
                            Label lbl = new Label();  
                            lbl.Text = string.Format("Project: {0}:&nbsp;&nbsp;", groupDataRow.Row["ProjectName"].ToString());  
 
                            item.DataCell.Controls.Add(lbl);  
                            item.DataCell.Controls.Add(lnk);  
                        }  
                    }  
                }  
            }  
        } 
Jason
Top achievements
Rank 1
 answered on 08 Jul 2009
5 answers
291 views
Hello

My page has 2 date pickers on it and I want to ensure that the second date is no more than 30 days after the first date. How would I do this? I have already looked at the validation demos on the website and they did not show me how to do it. If the information is in the demos and I have missed it, please don't refer me back to the demos without pinpointing where it is otherwise we'll be going round in circles as I can't see it. :)

Many thanks
andrea
andieje
Top achievements
Rank 1
 answered on 07 Jul 2009
2 answers
126 views
Hi! Right now I'm working with a Hierarchical Grid, so the thing is...I have two levels in the Grid, and in both of them I can edit the Items and the data of the child records have influence on one field of the parent, I mean, if one or more child records have values in certain field, the status of the parent will be "O", and if there are any record have value, the status will be "A", and finally if all the child have values, then the status will be "C".....so the problem is that when I edit the child records, the status of the parent dont change after I refresh the window or call RadGrid1.DataSource = Nothing....but when I do that the parent Item collapse....and I want to keep it expanded....

And another thing is that I open a window when I double clicked any row...but I want that this function only works on the parent items and not on the child records....because it throw me an error when I clicked the child.

Thanks in advance!!! =)
Daniel
Dany V
Top achievements
Rank 1
 answered on 07 Jul 2009
1 answer
84 views
Hi,

I have implemented autogenerated columns grid. For loading only it is taking approx 1 min.
Can anybody help in improving the performance of autogenerated columns grid?

Regards,
Medac
Pavlina
Telerik team
 answered on 07 Jul 2009
0 answers
180 views

I have used Telerik's example http://demos.telerik.com/aspnet-ajax/menu/examples/programming/showpath/defaultcs.aspx method to include a hyperlinked showpath / breadcrumb and wish to apply css styling to eg the last item
these are in the last row of a repeater
root > sub1 > sub2 >
sub3

Protected void BreadCrumbRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)  

{ 

if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType == ListItemType.AlternatingItem)

                {

     this.ItemCount.Text = Convert.ToString(this.BreadCrumbRepeater.Items.Count); //show item count in a label on asp page

 HyperLink BreadCrumbHyperLink = ((HyperLink)(e.Item.FindControl("BreadCrumbHyperLink")));

 if (e.Item.ItemIndex == BreadCrumbRepeater.Items.Count) // I found the item count returns the correct index so need for -1

        {
                 

BreadCrumbHyperLink.CssClass = "last";

         }

    else

        {

             BreadCrumbHyperLink.CssClass = "middle";

         }

    }
}

Which dosn't work, if I manually set if (e.Item.ItemIndex == 1) then this will show 0 and 2 as css middle and 1 as css last.

I then thought ok I'll never have more than 5-10 levels deep so I can just manually set it in a nested if statement.

Something along the lines of

 

                            if (BreadCrumbRepeater.Items.Count == 2)

                            {

                                

 

                                if (e.Item.ItemIndex == 2)

                                {

                                    BreadCrumbHyperLink.CssClass = "last";

                                }

                                else

                                {

                                    BreadCrumbHyperLink.CssClass = "middle";

                                }
                             }
 
                            else if (BreadCrumbRepeater.Items.Count == 1)

                            {

                                

 

                                if (e.Item.ItemIndex == 1)

                                {

                                    BreadCrumbHyperLink.CssClass = "last";

                                }

                                else

                                {

                                    BreadCrumbHyperLink.CssClass = "middle";

                                }
                             } 

                            else if (BreadCrumbRepeater.Items.Count == 0)

                            {

                                

 

                                if (e.Item.ItemIndex == 0)

                                {

                                    BreadCrumbHyperLink.CssClass = "last";

                                }

                             } 

Which again didn't work

I then look ed at using a switch case statment

                        switch (Convert.ToString(BreadCrumbRepeater.Items.Count))

                {

                    case "2":

 

                        gredy.Text = "two";

 

                        if (e.Item.ItemIndex == 0)

                        {

                            BreadCrumbHyperLink.CssClass = "middle";

                        }

                        else if (e.Item.ItemIndex == 1)

                        {

                            BreadCrumbHyperLink.CssClass = "middle";

                        }

                        else if (e.Item.ItemIndex == 2)

                        {

                            BreadCrumbHyperLink.CssClass = "last";

                        }

                        break;

 

                    case "1":

 

                       

 

                        if (e.Item.ItemIndex == 1)

                        {

                            BreadCrumbHyperLink.CssClass = "last";

                        }

                        else if (e.Item.ItemIndex == 0)

                        {

                            BreadCrumbHyperLink.CssClass = "middle";

                        }

                        break;

 

                    case "0":

 

                       

 

                        if (e.Item.ItemIndex == 0)

                        {

                            BreadCrumbHyperLink.CssClass = "last";

                        }

                        break;

Which again doesn’t work I know the logic for the switch if statements works because I can use it to set labels values for a test.

So the problem seems to be just applying the style to the correct hyperlink item.

Any suggestions would be helpful

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ian Turvey
Top achievements
Rank 1
 asked on 07 Jul 2009
3 answers
255 views
Hello, I've created a sharepoint web part with rad ajax manager and a grid. the grid has a couple of image buttons which on clicking need to do a full post back (this is to refresh the whole page so that a grid in another webpart gets updated).
RadGrid oGrid = new RadGrid();  
            oGrid.ID = "ProjectGrid";  
            oGrid.Skin = "WebBlue";  
            //oGrid.Width = new Unit(100, UnitType.Percentage);  
            oGrid.AutoGenerateColumns = false;  
            oGrid.AllowPaging = true;  
            oGrid.AllowSorting = true;  
            oGrid.ClientSettings.Resizing.AllowColumnResize = true;  
            oGrid.ClientSettings.AllowColumnsReorder = true;  
            //oGrid.MasterTableView.allow  
           oGrid.NeedDataSource += new GridNeedDataSourceEventHandler(oGrid_NeedDataSource);  
            oGrid.MasterTableView.Columns.Clear();  
            GridButtonColumn Print = new GridButtonColumn();  
            Print.ButtonType = GridButtonColumnType.ImageButton;  
            Print.ImageUrl = @"\_layouts\wpresources\images\print.gif";  
            Print.UniqueName = "Print";  
            Print.CommandName = "Print";  
            Print.ItemStyle.Width = new Unit(10, UnitType.Pixel);  
            oGrid.MasterTableView.Columns.Add(Print);  
oGrid.ItemCommand += new GridCommandEventHandler(oGrid_ItemCommand);  
            oGrid.ItemCreated += new GridItemEventHandler(oGrid_ItemCreated); 

I then used the itemCreatedEvent to call the __dopostback function
void oGrid_ItemCreated(object sender, GridItemEventArgs e)  
        {  
              
            if (e.Item is GridDataItem)  
            {  
                GridDataItem dataItem = e.Item as GridDataItem;  
                ImageButton imgbtn1 = dataItem["Print"].Controls[0] as ImageButton;  
                ImageButton imgbtn2 = dataItem["CreateNew"].Controls[0] as ImageButton;  
                ImageButton imgbtn3 = dataItem["MakeActive"].Controls[0] as ImageButton;  
                ImageButton imgbtn4 = dataItem["CopyToClipboard"].Controls[0] as ImageButton;  
                imgbtn1.OnClientClick = String.Format(@"{0}.__doPostBack(""{1}"",""{2}"");return false;", ((RadAjaxManager)FindControl("RadAjaxManager1")), imgbtn1.UniqueID, imgbtn1.CommandArgument);  
            }  
        }  
 
Im creating the RadAjaxManager1 in CreateChildControls() method and ive added the grid to be ajaxified to the ajaxsettings of the radAjaxManager on OnLoad Event.
I'm getting the following javascript error when trying to click on the print icon.

Error: ctl00_m_g_c8e8aeac_14ee_41bf_ad30_478d4ab3f78b_RadAjaxManager1 is undefined.

Any idea what i'm missing. I would appreciate any help. Thank you.

Phani
Iana Tsolova
Telerik team
 answered on 07 Jul 2009
4 answers
129 views
I have my tabstrip wokring well as a control within my site but my site has a sub folder and when in that sub folder i want change the selected index to the correct index (in this case 1) but it remains as 0.

I have tried the following

Partial Class usercontrols_mainNav 
    Inherits System.Web.UI.UserControl 
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
 
        If System.IO.Path.GetDirectoryName(HttpContext.Current.Request.FilePath).ToLower = "score_selector/Default.aspx" Then 
            RadTabStrip1.SelectedIndex = 1 
        Else 
            RadTabStrip1.SelectedIndex = 0 
        End If 
 
    End Sub 
End Class 

But this does not seem to have any effect, any ideas?

Regards,

S
stevied
Top achievements
Rank 2
 answered on 07 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?