Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
122 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
80 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
176 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
249 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
123 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
2 answers
110 views
Hi

I am developing scheduler application, when i insert an appointment, i need two condition
1) insert appointment using single click
2)when insert click it show the Day view

can you please give the appropriate suggesions

regards

imtiyaz
imtiyaz mohammed
Top achievements
Rank 1
 answered on 07 Jul 2009
1 answer
152 views
Hi,

We are using RadControls "Prometheus", with a version of 2007.3.1425.35 for Telerik.Web.UI.dll.  I am using the RadEditor, and adding a custom toolbar button via modifying the ToolsFile.xml file.  I would like to use a custom image for the custom toolbar button.

I can get everything to work when the Skin of the RadEditor is set to Web20.  I do the following:

1) Set up my ToolsFile.xml file as follows:

 

 

<root> 
  <tools> 
  <tool type="custom" name="NewCustomButton" Text="Add Premium Image"/>  
  </tools> 
</root> 
 

2) Add the following style to the ASPX page:
    <style>  
        .retoolbar.Web20 .NewCustomButton  
        {  
           background-imageurl(../../images/icons/flag-g.gif);  
        }  
 
    </style> 
(I also have tried naming the style .rade_toolbar.Web20 .NewCustomButton, and that works also.  Your documentation seems to suggest that you can name it either way.)

3) And finally, add the control to the page:
                 <telerik:radeditor ID="RadEditor1" runat="server"   
                    ToolsFile="~/XMLConfigFiles/ToolsFileDemo.xml" EditModes="All" Height="400px"   
                    Skin="Web20" ToolbarMode="ShowOnFocus" Width="670px">  
                      
                 </telerik:radeditor> 

This works fine for the Web20 skin.  However, when I change to a different theme, such as WebBlue, and rename the css style to .retoolbar.WebBlue .NewCustomButton, the image does not appear on the toolbar.  When I look at the HTML that gets generated by the radEditor, it seems that if the Web20 code works, the WebBlue code should work also.

Please let me know how I can get the custom button to appear for the WebBlue skin.

If you need any more information from me or if you'd a more complete code sample, please just let me know.

Thanks so much for the assistance!

Joe

Joseph Alfano
Top achievements
Rank 1
 answered on 07 Jul 2009
4 answers
755 views
Hi All,
I have a radgrid with a gridbuttoncolumn that l use to let users download excel files.
Its straight-forward:
 
<telerik:GridButtonColumn HeaderText="Download" Text="Get Report"  
                                UniqueName="dldReportColumn" CommandName="PullReport"
                            </telerik:GridButtonColumn> 

On the click event, I am trying to send the generated file, but its giving a wierd error: 


But thats not the solution I want. In my earlier project, we used to be able to send the file directly to the user using Response.Write() and IE would open a dialog asking users to Open, Save or Cancel the file...

How do I achieve the file download ability using teleric:GridButtonColumn?

My code for the command handler is:
Protected Sub BatchGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles BatchGrid.ItemCommand 
        If e.CommandName = "PullReport" Then 
            Dim chosen As GridDataItem = DirectCast(e.Item, GridDataItem) 
            Dim folder As String = chosen("folder").Text 
            Dim file As String = chosen("file").Text 
 
            'The first task is to ensure that the file exists. 
            Dim fullPath As String = Path.Combine(folder, file) 
            Dim fi As FileInfo = New FileInfo(fullPath) 
            If fi.Exists() Then 
                Dim id As String = chosen("BatchID").Text 
                 
                Response.ClearContent() 
                Response.AddHeader("Content-disposition", "attachment; filename=" & file) 
                Response.AddHeader("Content-Length", fi.Length) 
                Response.ContentType = "application/octet-stream" 
                Response.TransmitFile(fullPath) 
                Response.Flush() 
                Response.End() 
            End If 
        End If 
    End Sub 


This is a common scenario ... how do I get the download functionality?
S
Top achievements
Rank 1
 answered on 07 Jul 2009
1 answer
124 views
I am trying to add a new editorTool  to a n instance of the rad editor. When I run the project with the below code, the editor displays without any tools except the one i have added manualy. When i remove the below and re-run the project all the tools are available.

EditorToolGroup main = new EditorToolGroup();
RadEditor1.Tools.Add(main);

EditorTool insertContentLink = new EditorTool();
insertContentLink.Name = "InsertContentLink";
insertContentLink.Text = "Insert Content Link";
insertContentLink.ShortCut = "CTRL+B";
main.Tools.Add(insertContentLink);

I have based my code on the demo here http://demos.telerik.com/aspnet-ajax/editor/examples/customtools/defaultcs.aspx

Rumen
Telerik team
 answered on 07 Jul 2009
1 answer
165 views
Hi,

Actually I did it but wonder if there is another way. Here is my code. Any improvements are appreciated.

        protected void RadSkinManager1_PreRender(object sender, EventArgs e) 
        { 
            DataTable table = new DataTable(); 
            DataRow row; 
 
            table.Columns.Add("ImgUrl"); 
            table.Columns.Add("val"); 
            table.Columns.Add("txt"); 
 
            row = table.NewRow(); 
            row.ItemArray = new string[] { "images/default.gif""Default""Default" }; 
            table.Rows.Add(row); 
 
            row = table.NewRow(); 
            row.ItemArray = new string[] { "images/black.gif""Black""Black" }; 
            table.Rows.Add(row); 
 
            row = table.NewRow(); 
            row.ItemArray = new string[] { "images/forest.gif""Forest""Forest" }; 
            table.Rows.Add(row); 
 
            RadComboBox skinChooser = RadSkinManager1.FindControl("SkinChooser"as RadComboBox; 
 
            skinChooser.DataSource = table; 
            skinChooser.ItemTemplate = new IMGTemplate("ImgUrl"); 
            skinChooser.DataTextField = "txt"
            skinChooser.DataValueField = "val"
            skinChooser.Width = 240; 
            skinChooser.Height = 202; 
            skinChooser.DataBind(); 
             
            skinChooser.SelectedValue = RadSkinManager1.Skin; 
 
         } 

class IMGTemplate : ITemplate 
    { 
     string pathColumn; 
 
     public IMGTemplate(string imgPathColumn) 
        { 
            pathColumn = imgPathColumn; 
        } 
 
        public void InstantiateIn(Control c) 
        { 
            Image imgt = new Image(); 
            imgt.DataBinding += new EventHandler(imgDataBinding); 
            c.Controls.Add(imgt); 
        } 
 
        void imgDataBinding(object sender, EventArgs e) 
        { 
            Image img_ = (Image)sender; 
            RadComboBoxItem item = (RadComboBoxItem)img_.BindingContainer; 
            DataRowView drv = ((DataRowView)item.DataItem); 
            img_.ImageUrl = drv[pathColumn].ToString(); 
        } 
    } 
Sebastian
Telerik team
 answered on 07 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?