Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
274 views
how would i turn the cell value red when the value in that cell is a negative number. thanks.
Daniel
Telerik team
 answered on 08 Oct 2009
1 answer
114 views
Hi,

 Am using rad chart.i want to export my image in local system.

Am using following code


           
                System.IO.MemoryStream ms1 = new System.IO.MemoryStream();
                this.chartPie.Save(ms1, System.Drawing.Imaging.ImageFormat.Png);
                this.Page.Response.Clear();
                this.Page.Response.ClearHeaders();
                this.Page.Response.AddHeader("Content-disposition", "attachment; filename=PieChart.png");
                this.Page.Response.AddHeader("Content-type", "image/png");
                this.Page.Response.BinaryWrite(ms1.ToArray());
                this.Page.Response.End();
          
    

The chart is getting saved while running in local.while running my project through IIS, i am getting "object reference error".
I gave all permissions to folders and also IIS.Even setting all permissions, i am getting the same error.

Thanks for any help,


Giuseppe
Telerik team
 answered on 08 Oct 2009
1 answer
100 views
Is there a way to selectively draw line graph connector lines? In other words, to draw some lines between data points, and not draw others?
Giuseppe
Telerik team
 answered on 08 Oct 2009
1 answer
93 views
I'm not even sure this is possible, but here it goes...

I have a rad splitter with 3 panes in it (A, B and C). Pane "A" gets a treeview loaded into it dynamically, with handlers assigned to it at runtime, etc during the pageload. Pane "B" has a panel in it that loads user controls based on which node in the treeview you click.

I add at runtime the ajax setting to update the panel in pane "B" when the tree is interacted with, like this:

        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Tree, UPanel) 
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Tree, Tree) 

It's cool and everything works, HOWEVER -

I don't really want to update the Tree every time. I only really want to update it on certain events (like selecting an item from a tree context menu) but not on others (selecting a node), however I do want update the "UPanel" control when I select a node.

How could I implement this? I'm familiar with the RequestStart and RequestEnd handlers of the AjaxManager, but I'm not seeing a clear strategy to get to where I want.

Any suggestions would be appreciated!

Sebastian
Telerik team
 answered on 08 Oct 2009
2 answers
67 views
Dear's
I use in my page RadAjaxLoadingPanel control
and this page contain user controls, these user control when run the RadAjaxLoadingPanel
does not declare the javascript variables.

how I can fix this problem ??
Jihad
Top achievements
Rank 1
 answered on 08 Oct 2009
1 answer
80 views

Requirements

RadControls  version     2009Q2 Trial

 

.NET version 3.5 SP1

 

Visual Studio version    2008 SP1

 

programming language    C#

 

browser support

all browsers supported by RadControls


PROJECT DESCRIPTION
Example SharePoint 2007 SP2 webpart using RadAjaxTreeView, context menu, RadAjaxPanel, and loading panel. 

Requires use of VSeWSS 1.3 March 2009 CTP to facilitate rapid development/deployment.  Just click Build/Deploy menu item after making any changes and it will deploy automatically to your SharePoint environment.

Best used in a SharePoint development virtual machine envrionment.  Tested with Windows Server 2003 R2 SP2, SQL Server 2008 SP1, Office SharePoint Server 2007 SP2, IE 8 using Virtual PC 2007 SP1 on Windows Vista SP2 (all 32-bit).

Pay close attention to the post-build event since it seems to be a reasonable work-around to an error known to exist in VSeWSS 1.3 March 2009 CTP.

Pay close attention to the notes at the top of the main .cs file which explains some strange things I had to do to get this all to work correctly.

Being new to Telerik controls, I found I had to may be overkill or unnecessary, but perhaps you can improve on things I coded incorrectly or inefficiently.

Since SharePoint webparts require a Document Library, I would suggest creating one in the site where you plan to test rather than rely on a default one, such as Shared Documents.  In my development environment, I created a Document Library named "Webparts", then created a Webpart Page called WebPartTesting based on the single web part on one page template.  Its on that page that I added my web part to test.  If the web part won't add, try attaching to the correct instance of w3wp.exe just before you click the Add button to see where in your code things might be going wrong.
Yavor
Telerik team
 answered on 08 Oct 2009
4 answers
153 views
Hi, I can't figure out why the checkboxes doesn't align correct. Can you help me?
See printscreen

<telerik:RadGrid ID="radGridDivisions" runat="server" AllowPaging="false" 
            AllowSorting="false" AutoGenerateColumns="False" GridLines="Horizontal"   
            oninsertcommand="radGridDivisions_InsertCommand"  
            onupdatecommand="radGridDivisions_UpdateCommand"  
            ondeletecommand="radGridDivisions_DeleteCommand" 
            onitemdatabound="radGridDivisions_ItemDataBound"  
            onneeddatasource="radGridDivisions_NeedDataSource" 
            OnColumnCreated="radGridDivisions_ColumnCreated" 
            OnItemCreated="radGridDivisions_ItemCreated" 
            Skin="Default" ShowHeader="true"> 
            <ClientSettings AllowExpandCollapse="true" /> 
            <mastertableview commanditemdisplay="Top" datakeynames="ID, ParentID"  
                editmode="EditForms" name="Master" nomasterrecordstext="Det finns inga divisioner" 
                HierarchyDefaultExpanded="true" HierarchyLoadMode="Client"> 
                <SelfHierarchySettings ParentKeyName="ParentID" KeyName="ID" /> 
                  
            <commanditemsettings addnewrecordtext="Lägg till" refreshtext="Uppdatera" /> 
            <Columns> 
                <telerik:GridBoundColumn UniqueName="ID" DataField="ID" HeaderText="Id" Visible="false" /> 
                <telerik:GridBoundColumn UniqueName="ParentID" DataField="ParentID" HeaderText="Parent Id" Visible="false" /> 
                <telerik:GridBoundColumn UniqueName="Name" Headertext="Division" DataField="Name" /> 
                <telerik:GridCheckBoxColumn UniqueName="IsEnabled" HeaderText="Aktiverad" DataField="IsEnabled" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" /> 
                <telerik:GridDateTimeColumn DataField="CreateDate" DataFormatString="{0:g}" 
                    HeaderStyle-HorizontalAlign="Right" HeaderText="Skapad"  
                    ItemStyle-HorizontalAlign="Right" ReadOnly="true" UniqueName="CreateDate" SortExpression="e.CreateDate"> 
                    <HeaderStyle HorizontalAlign="Right" /> 
                    <ItemStyle HorizontalAlign="Right" /> 
                </telerik:GridDateTimeColumn> 
 
                <telerik:GridEditCommandColumn CancelText="Avbryt" EditText="Ändra" InsertText="Spara" UpdateText="Spara" ButtonType="ImageButton" UniqueName="EditCommandColumn"> 
                    <HeaderStyle HorizontalAlign="Right" Width="20" /> 
                    <ItemStyle HorizontalAlign="Right" Width="20" /> 
                </telerik:GridEditCommandColumn> 
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete"  
                ConfirmText="Är du säker pÃ¥ att du vill radera denna division?"  
                ConfirmTitle="Delete" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="20px"  
                Text="Radera" UniqueName="DeleteColumn"> 
                    <ItemStyle HorizontalAlign="Right" Width="20px" /> 
                </telerik:GridButtonColumn> 
            </Columns> 
            </mastertableview> 
        </telerik:RadGrid> 

protected void Page_Load(object sender, EventArgs e) 
        { 
            radGridDivisions.MasterTableView.FilterExpression = "ParentID.Equals(Guid.Empty)"; 
 
        } 
 
 
        public void Page_PreRenderComplete(object sender, EventArgs e) 
        { 
            HideExpandColumnRecursive(radGridDivisions.MasterTableView); 
        } 
 
        public void HideExpandColumnRecursive(GridTableView tableView) 
        { 
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView); 
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems) 
            { 
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews) 
                { 
                    nestedView.Style["border"] = "0"; 
 
                    Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton"); 
                    if (nestedView.Items.Count == 0) 
                    { 
                        if (MyExpandCollapseButton != null) 
                        { 
                            MyExpandCollapseButton.Style["visibility"] = "hidden"; 
                        } 
                        nestedViewItem.Visible = false; 
                    } 
                    else 
                    { 
                        if (MyExpandCollapseButton != null) 
                        { 
                            MyExpandCollapseButton.Style.Remove("visibility"); 
                        } 
                    } 
 
                    if (nestedView.HasDetailTables) 
                    { 
                        HideExpandColumnRecursive(nestedView); 
                    } 
                } 
            } 
        } 
 
 
        protected void radGridDivisions_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        { 
            //int recordCount; 
            string search = textBoxSearch.Text.Trim(); 
 
            //foreach (Division d in DivisionService.GetDivisions()) 
              //  Response.Write(d.Name); 
 
            radGridDivisions.DataSource = DivisionService.GetDivisions();//.GetDivisions(null, search, "", 0, 0, out recordCount); 
            //radGridDivisions.VirtualItemCount = recordCount; 
        } 
 
 
        protected void radGridDivisions_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
        { 
            if (e.Column is GridExpandColumn) 
            { 
                e.Column.Visible = false; 
            } 
            else if (e.Column is GridBoundColumn) 
            { 
                //e.Column.HeaderStyle.Width = Unit.Pixel(100); 
            } 
        } 
 
        protected void radGridDivisions_ItemCreated(object sender, GridItemEventArgs e) 
        { 
            //CreateExpandCollapseButton(e.Item, "Name"); 
 
            //Response.Write(e.Item.GetType().ToString() + "<br />"); 
            if ((e.Item is GridHeaderItem || e.Item is GridCommandItem) && e.Item.OwnerTableView != radGridDivisions.MasterTableView) 
            { 
                e.Item.Style["display"] = "none"; 
            } 
            /*
            if (e.Item is GridHeaderItem && e.Item.OwnerTableView != radGridDivisions.MasterTableView)
            {
                e.Item.Style["display"] = "none";
            }
            */ 
            if (e.Item is GridNestedViewItem) 
            { 
                e.Item.Cells[0].Visible = false; 
            } 
 
            
 
 
        } 
 
 
        public void CreateExpandCollapseButton(GridItem item, string columnUniqueName) 
        { 
            if (item is GridDataItem) 
            { 
                if (item.FindControl("MyExpandCollapseButton") == null) 
                { 
                    Division division = (Division)item.DataItem; 
 
                    Button button = new Button(); 
                    button.Click += new EventHandler(button_Click); 
                    button.CommandName = "ExpandCollapse"; 
                    button.CssClass = (item.Expanded) ? "rgCollapse" : "rgExpand"; 
                    button.ID = "MyExpandCollapseButton"; 
 
                    if (item.OwnerTableView.HierarchyLoadMode == GridChildLoadMode.Client) 
                    { 
                        string script = String.Format(@"$find(""{0}"")._toggleExpand(this, event); return false;", item.Parent.Parent.ClientID); 
 
                        button.OnClientClick = script; 
                    } 
 
                    int level = item.ItemIndexHierarchical.Split(':').Length; 
                    if (level > 1) 
                    { 
                        button.Style["margin-left"] = level + 10 + "px"; 
                    } 
 
                    TableCell cell = ((GridDataItem)item)[columnUniqueName]; 
                    cell.Controls.Add(button); 
                    cell.Controls.Add(new LiteralControl("&nbsp;")); 
                    cell.Controls.Add(new LiteralControl(division.Name)); 
                    //cell.Controls.Add(new LiteralControl(((GridDataItem)item).GetDataKeyValue("ID").ToString())); 
                } 
            } 
        } 
 
        void button_Click(object sender, EventArgs e) 
        { 
            ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand"; 
        } 
 
 
        protected void radGridDivisions_ItemDataBound(object sender, GridItemEventArgs e) 
        { 
 
            CreateExpandCollapseButton(e.Item, "Name"); 
 
            GridDataItem gridItem; 
            GridEditFormItem gridEditItem; 
            Division division; 
 
 
            switch (e.Item.OwnerTableView.Name) 
            { 
                case "Master": 
 
                    if (e.Item is GridDataItem) 
                    { 
                        gridItem = (GridDataItem)e.Item; 
                        division = (Division)gridItem.DataItem; 
 
                    } 
 
                    break; 
            } 
 
             
        } 



Mattias
Top achievements
Rank 1
 answered on 08 Oct 2009
1 answer
191 views
Hello,

I need to retrieve the currently selected row index from the data source point of view.

I have grouped/sorted grid, and I need to know the selected row data source index in order to compute some action on this row.
This should be done 100% client-side, in order then to send a request to the valid data row index.

I just met the "GridClientDeleteColumn" that seems to use this kind of information to delete the proper row on the data source. I didn't got time to test it in grouped or sorted context in order to see if this control works properly but I hope so :)

Unfortunately my use case is different and I can't use this control, but need to handle it manually using the data source row index.

Any clue on how to get this original data index from client-side code ?!

Thanks in advance for your answer.

Regards.

Seb.
Yavor
Telerik team
 answered on 08 Oct 2009
1 answer
106 views
I am using the scrolling option with my bar chart and everything is working fine except that I am using the DeepBlue skin and the ajax loading circle is visible through the background. Is there anything I can do so that once the chart is loaded the circle will not be visible?
Vladimir Milev
Telerik team
 answered on 08 Oct 2009
4 answers
187 views

I previously had a RadGrd nested like so:

RadSplitter => RadSplitter => RadGrid  (i.e. RadGrid nested 2 Splitters deep)

Then on the AjaxManager's ClientEvents-OnResponseEnd, my Javascript looked like so:

function setDimensions(sender, args) {  
    var splitter = $find(PageControls.RadSplitter1.id);  
 
    if (splitter != null)  
        splitter.resize(contentPaneWidth - 60, contentPaneHeight - 80);  
   
} 

This worked perfect for resizing the 2nd level Splitter pane to the contentPane's width and height and thus the Grid to match.

Now, I've removed the 2nd Splitter and moved the Grid up one level.  I can get the pane's width and height still.  But how do I resize the grid?

Thanks.
Yavor
Telerik team
 answered on 08 Oct 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?