Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
458 views

Actually I have taken one RadGrid and in that I have taken one RadUpLoad control in that.

And I want to find out the file name of Uploaded File along with pathname separately. Here I am sending the code which I tried to Implement….

<telerik:RadGrid ID="rgSubmenus" runat="server" AllowPaging="True" GridLines="Horizontal"

                    Skin="Default" OnNeedDataSource="rgSubmenus_NeedDataSource" PageSize="10" Width="70%"

                    OnInsertCommand="rgSubmenus_InsertCommand" OnItemDataBound="rgSubmenus_ItemDataBound"

                    OnUpdateCommand="rgSubmenus_UpdateCommand" >

                    <PagerStyle Mode="Slider" />

                    <MasterTableView CommandItemDisplay="TopAndBottom" AutoGenerateColumns="false" DataKeyNames="submenuid"

                        EditMode="EditForms" CommandItemSettings-AddNewRecordText="Add Submenu">

                        <Columns>

                            <telerik:GridBoundColumn DataField="submenuid" HeaderText="SubMenu ID" HeaderStyle-HorizontalAlign="Center"

                                ItemStyle-HorizontalAlign="Left" Visible="false">

                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn DataField="mainmenuid" HeaderText="MainMenu ID" HeaderStyle-HorizontalAlign="Center"

                                ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="15%" Visible="false">

                            </telerik:GridBoundColumn>

So On…

                            <telerik:GridBoundColumn DataField="url" HeaderText="URL" HeaderStyle-HorizontalAlign="Center"

                                ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="25%">

                            </telerik:GridBoundColumn>

                           

                            <FormTemplate>

                                <table width="100%" cellpadding="0" cellspacing="0" border="0" bordercolor="red">

                                    <tr>

                                        <td width="49%" align="right">

                                            Select MainMenu

                                        </td>

                                        <td width="2%">

                                            :

                                        </td>

                                        So On…..

                                                <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

                                            </telerik:RadComboBox>

                                        </td>

                                    </tr>

                                    <tr>

                                        <td width="49%" align="right">

                                            Submenu Name

                                        </td>

                                        <td width="2%">

                                            :

                                        </td>

                                    <tr>

                                        <td width="49%" align="right">

                                            Submenu URL

                                        </td>

                                        <td width="2%">

                                            :

                                        </td>

                                        <td width="49%" align="left">

                                            <telerik:RadUpload ID="rdSubmenuUpload" runat="server" Skin="Default" ControlObjectsVisibility="None"                                         Width="150px" InputSize="25" AllowedFileExtensions=".aspx" />

                                        </td>

                                    </tr>

                                    <tr>

 

So On…

            <td width="49%" align="left">

                                            <asp:Button runat="server" ID="btnAddRoles" Text='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "Insert" : "Update" %>'

                                                CommandName='<%# (Container as GridItem).OwnerTableView.IsItemInserted ? "PerformInsert" : "Update" %>'

                                                CssClass="btn1" />&nbsp;&nbsp;

                                            <asp:Button runat="server" ID="btnCancel" Text="Cancel" CssClass="btn1" CausesValidation="false"

                                                CommandName="Cancel" />

                                        </td>

                                    </tr>

                                   

                            </FormTemplate>

                        </EditFormSettings>

                    </MasterTableView>

                </telerik:RadGrid>

 

 

 

 

 

 

I tried C# in the following ways

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)

    {

        if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))

        {

            GridEditableItem formItem = (GridEditableItem)e.Item;

            RadUpload rdUload = (RadUpload)formItem.FindControl("rdSubmenuUpload");

 

            int a = rdUload.UploadedFiles.Count;

        }

 

    }

 

protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)

    {

        //Get the GridEditFormInsertItem of the RadGrid

         //GridEditFormInsertItem insertedItem = e.Item as GridEditFormInsertItem;

        

        //RadComboBox ddlMainmenu = (insertedItem.FindControl("ddlMainmenus") as RadComboBox);

 

        GridEditFormInsertItem insertedItem = (GridEditFormInsertItem)e.Item;

        RadUpload ruld = (insertedItem.FindControl("rdSubmenuUpload") as RadUpload);

        int a = ruld.UploadedFiles.Count;

...

 

}

Veli
Telerik team
 answered on 24 Jul 2008
0 answers
101 views
Problem Statement :

I have a Radscheduler in my page.
there is a linkButton in one of the dates.on this date clickevent i need to open a new window,this window will show some data based on a querystring..
How do i go about this problem? is there an event which i can use to open a new window,withouthaving to postback to the server?


Sudheep
Top achievements
Rank 1
 asked on 24 Jul 2008
4 answers
101 views
Hi,

I am using RadDateTimePicker control. I want to control the pop up window that opens when we select calender/Time view. I mean i need to control the height & width.

Currently if the RadDateTimePicker is at the bottom of the page & if we select the calender button/Time View then the pop up is chopped off.

Any help is really appreciated.

Thanks,
Mallikarjun
Maria Ilieva
Telerik team
 answered on 24 Jul 2008
2 answers
154 views
hi,

I have created one usercontrol. On that usercontrol, I have RadToolBar, Label and RadAjaxManager. Following is desing of RadAjaxManager.

<

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <AjaxSettings>
             <telerik:AjaxSetting AjaxControlID="RadToolBar1">
                     <UpdatedControls>
             <telerik:AjaxUpdatedControl ControlID="Label1"     LoadingPanelID="RadAjaxLoadingPanel1" />
                      </UpdatedControls>
             </telerik:AjaxSetting>
       </AjaxSettings>
</
telerik:RadAjaxManager>

<

telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"Width="75px">
<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'style="border: 0px;" />
</
telerik:RadAjaxLoadingPanel>

Now if I put this control on simple .aspx page, it's working fine.

But if I put this control on MOSS .aspx page, when my page is loading first time and if I click RadToolBar1, it's giving regular postback. And after the postback, it's ajaxifying my control..so after first post, it working fine. But first postback , it's doing as regular postback.

I have also tried it programatically.

protected

void Page_Load(object sender, EventArgs e)
{
   try
{
               RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadToolBar1, lblClick);
          }
   catch(Exception
ex) {
          Label1.Text = ex.Message;
         }
}

This is too working fine on simple .aspx page.

But on MOSS .aspx page,it's giving following error.

Object reference not set to an instance of an object.

I am using smartpart with AJAX for hosting my usercontrol on MOSS .aspx page.

Do I need to register something on MOSS .aspx page?

Please reply ASAP.

Regards
Pratik.

pratik
Top achievements
Rank 1
 answered on 24 Jul 2008
2 answers
84 views
I m using radcalendar and in day render event i m programmatically change the color of dates like 5,10,15 etc of all month of all years so it shows me different color but after that when I move mouse over that dates which r in different color(5,10,15) I lose the color for that dates so its worthless for me could u just help me out soon its very urgent.

Thanks
Bonny
bonny
Top achievements
Rank 1
 answered on 24 Jul 2008
2 answers
154 views
Hello,

I have a problem when firing an event on clicking a button in a grid. What I want to do is visualize a asp panel when clicking the button. My Rad Grid looks like this

            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" Width="100%" Skin="Default2006"  
            AllowSorting="True" PageSize="5" ShowStatusBar="true" ShowFooter="True"  
            AllowPaging="True" GridLines="None" OnSortCommand="RadGrid1_SortCommand"  
            OnPageIndexChanged="RadGrid1_PageIndexChanged" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCommand="RadGrid1_ItemCommand"> 
                 
                <PagerStyle Mode="NextPrevAndNumeric" /> 
                <MasterTableView Width="100%" AutoGenerateColumns="false" ShowFooter="True" TableLayout="Auto"> 
                      
                     <Columns> 
                         
                        <telerik:GridTemplateColumn> 
                            <HeaderTemplate> 
                                <asp:LinkButton runat="server" ID="lbParentDir" CommandName="_parent" CommandArgument='<%# ViewState["parentId"] %>' Text="^..." /> 
                            </HeaderTemplate> 
                            <ItemTemplate> 
                                <asp:LinkButton runat="server" ID="lbTitle" CommandName="_children" Text='<%# Bind("title") %>' CommandArgument='<%# Bind("id") %>' /> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn>  
                        
                        (...) 
 
                        <telerik:GridTemplateColumn > 
                            <ItemTemplate> 
                               <asp:Button runat="server" CssClass="button" ID="btView" CommandArgument='<%# Bind("id") %>' CommandName="_view" Text="View"/> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                    </Columns>  
 
               </MasterTableView> 
            </telerik:RadGrid> 

and the code behind where the event fires is:

    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "_view") 
        { 
            int id = Convert.ToInt32(e.CommandArgument); 
            ViewState["id"] = id; 
 
            panelNodeView.Visible = true; 
        } 
    } 
 

The problem is that the paneNodeView does not appear on postback. While debbuging everything looks fine. The paneNodeView.Visible is set to true, but it doesn't show. This worked well when using the MS Grid. Is there a difference in the RadGrid behaviour that I'm not aware of. Please fill me in.

Thanks,
Chris
Veli
Telerik team
 answered on 24 Jul 2008
2 answers
271 views
Hi there,

I have just created a custom skin for the RadPanelBar and spent the last few hours trying to override the default "width: 250px;" property in the top-level PanelBar.css file.  Finally I remembered the "!important" marker and now it is working.  However, a few questions:

1)  Why is there a default width in pixels in the first place?  Won't this almost always need to be overridden?

2)  In which directory is the file where this is being set?  I tracked down the PanelBar.css file in my D:\Program Files (x86)\telerik\RadControls for ASPNET AJAX Q1 2008\Skins directory as well as the local version I was using for the project, and set each to be different from the default; but every time the default width was restored (after emptying the browser's cache, too).  Firebug shows that the the CSS is coming from a WebResource.axd style-sheet file -- is this hard-coded in the DLL somehow?

3)  The WebResource.axd style-sheet file seems to be linked in at the end of the <head> section, after my custom-skin CSS files.  If I could somehow have my custom CSS linked in after the default CSS, my styles would naturally override the defaults -- is this possible somehow?

Thanks in advance,

Ed Graham
Ed
Top achievements
Rank 1
 answered on 24 Jul 2008
1 answer
111 views
In another thread (http://www.telerik.com/community/forums/thread/b311D-hhmmg.aspx) there was a response from telerik stating that there would be a way to specify an alternate resource file location (other than the App_GlobalResources folder). This post was on 6/16.

The latest release of RadControls for ASP.NET AJAX was released on 6/19. Did this make it into the release? I need to find a way to share the localization files across multiple websites without using a custom Resource Provider.
Rumen
Telerik team
 answered on 24 Jul 2008
1 answer
116 views
Hi All,

I need to know how to dynamically access table in a detail table collection on client side using Javascript.

Please help thanks
Veli
Telerik team
 answered on 24 Jul 2008
3 answers
170 views
Hello,

I am using the RadUpload control to add multiple files to the server this was working fine until I added the Progress Area.

Everything works fine the first time around e.g. I can upload multiple files and the progress area displays.  However in the same session, when I navigate  back to my upload page and try to upload more files, the HttpFileCollection does not detected that I have selected any (the size of the collection is zero).  Here is the code in adding files to the server:

        public bool UploadFilesToServer() 
        { 
            bool validPost = false; 
            if (Page.IsPostBack) 
            { 
                DirectoryInfo parentDir = new DirectoryInfo(Page.Server.MapPath("./SessionFolders/") + UniqueIndentifier + "/"); 
                 
                if (parentDir.Exists) 
                { 
                    foreach (FileInfo oldfile in parentDir.GetFiles()) 
                        oldfile.Delete(); 
                } 
                HttpFileCollection uploadFilCol = Page.Request.Files; 
                for (int i = 0; i < uploadFilCol.Count; i++) 
                { 
 
                    HttpPostedFile file = uploadFilCol[i]; 
                    string fileName = Path.GetFileName(file.FileName); 
                    if (fileName != string.Empty) 
                    { 
                        //Create Folder if neccesary 
                        if (!parentDir.Exists) 
                            parentDir.Create(); 
 
                        try 
                        { 
                            file.SaveAs(parentDir.ToString() + fileName); 
                            validPost = true; 
                        } 
                        catch (Exception) { } 
                    } 
                } 
 
                if (!validPost)                 
                    MessageBox("Please select at least one file."); 
                 
            } 
 
            return validPost; 
        } 

Thanks,
David
Erjan Gavalji
Telerik team
 answered on 24 Jul 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?