Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
191 views
We noticed the following issue with IE9 RC.

When a RadGrid is in a table and with UseStaticHeaders set to true the rows are not displayed at all.

<table style="width:100%">
    <tr>
        <td>
            <telerik:RadGrid ID="grd" runat="server" Skin="Windows7" Width="100%" Height="120px"
                AutoGenerateColumns="false">
                <MasterTableView Width="100%" TableLayout="Fixed">
                    <Columns>
                        <telerik:GridTemplateColumn>
                            <HeaderStyle Width="50%" />
                            <HeaderTemplate>
                                <asp:Label ID="lblNameHeader" runat="server" Text="Name"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblName" runat="server" Text='<%#Eval("Name")%>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn>
                            <HeaderStyle Width="50%" />
                            <HeaderTemplate>
                                <asp:Label ID="lblSurnameHeader" runat="server" Text="Surname"></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblSurname" runat="server" Text='<%#Eval("Surname")%>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="true" />
                    <Scrolling ScrollHeight="120px" AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
            </telerik:RadGrid>
        </td>
    </tr>
</table>


Code Behind:
public partial class GridTest : System.Web.UI.Page
   {
       List<MyClass> lst = new List<MyClass>();
 
       protected void Page_Load(object sender, EventArgs e)
       {
           this.lst.Add(new MyClass("Andrew", "Dimech"));
           this.lst.Add(new MyClass("Rachel", "Smith"));
           this.lst.Add(new MyClass("James", "Black"));
 
           this.grd.DataSource = this.lst;
           this.grd.DataBind();
       }
   }
 
   public class MyClass
   {
       public MyClass(string name, string surname)
       {
           this.Name = name;
           this.Surname = surname;
       }
 
       private string name;
 
       public string Name
       {
           get { return name; }
           set { name = value; }
       }
 
       private string surname;
 
       public string Surname
       {
           get { return surname; }
           set { surname = value; }
       }
 
   }
Tsvetoslav
Telerik team
 answered on 18 Mar 2011
0 answers
190 views

Hi,

i have a grid with hyperlink column and which open the download.aspx page and file.
 <telerik:GridHyperLinkColumn
                                            DataNavigateUrlFields="FilePath" 
                                            DataTextField="FileName" 
                                            DataNavigateUrlFormatString="{0}" 
                                            Visible="true"
                                            HeaderText="File Name"
                                            Target="_blank"
                                            HeaderStyle-Width="300px"
                                        >
                                        </telerik:GridHyperLinkColumn>

now here "FilePath"  field is coming from db which is as follow...Test&Doc
but the querystring passing to downlaod.aspx page is only Test
i cannot able to do HttpUtility.UrlEncode as it is not supported.

if i write the column as  DataNavigateUrlFields=HttpUtility.UrlEncode("FilePath")

it gives error and not working,....


please help.


bharat kumar
Top achievements
Rank 1
 asked on 18 Mar 2011
2 answers
169 views
Hello,
        I am using RadUpload control with my application.

       When i select the File after browsing through my PC, when i click on Button.
        - I want the full path in which drive the file is being located. I have used the code as below :

         
MailMessage objmail = new MailMessage(); 
 
          if (RadUpload1.UploadedFiles.Count > 0) 
            { 
                foreach (UploadedFile file in RadUpload1.UploadedFiles) 
                { 
                    string strPath = string.Empty; 
                    strPath = file.FileName; 
                    System.Net.Mail.Attachment objattachment = new System.Net.Mail.Attachment(strPath); 
                    objmail.Attachments.Add(objattachment); 
                } 
            } 

  Now, when i RUN the page & DEBUG using FireFox,
        I get the strPath = "SubModule.txt"
      and get the error,
{System.IO.FileNotFoundException: Could not find file 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\SubModule.txt'. 
File name: 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\SubModule.txt' 
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) 
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) 
   at System.Net.Mail.AttachmentBase.SetContentFromFile(String fileName, String mediaType) 
   at System.Net.Mail.Attachment..ctor(String fileName) 
   at User_SendDocMail.btnsendmail_Click(Object sender, EventArgs e) in e:\Projects\ISalesPro\ISalesProWeb\User\SendDocMail.aspx.cs:line 53} 
 

But, When i Run with IE,
         I get the strPath = "C:\Documents and Settings\OM\Desktop\SubModule.txt"     
which works perfectly alright.


Please help me to sort out this Error in Firefox.

Thanks,
Kunal Govani
 

Genady Sergeev
Telerik team
 answered on 18 Mar 2011
2 answers
73 views
I have a rad grid that I have set the AllowAutomaticDeletes, Updates, and Inserts to False. This in the MsterTableView has a DetailTable.  So it is Hierarchy gid.  The top level works fine when I Insert or Update the grid comes out of editmode, and when I edit the DetailTable grid it will leave edit mode with no issue.  The problem is when I insert a new record in the DetailTable on save it stays in edit mode.  The data is saveed becuase when I hit the cancel button it shows the new record under the parent.

I'm I missing something

<telerik:RadGrid ID="rgSoftware" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="false"
        AllowSorting="false" GridLines="Both" AllowPaging="false" EnableViewState="true" Skin="WebBlue" 
        ShowHeader="true" EnableAJAXLoadingTemplate="True" LoadingTemplateTransparency="50" ShowStatusBar="True" 
        AllowAutomaticDeletes="false" AllowAutomaticUpdates="False" AllowAutomaticInserts="False"        
        OnNeedDataSource="rgSoftware_NeedDataSource" OnInsertCommand="rgSoftware_InsertCommand" OnUpdateCommand="rgSoftware_UpdateCommand"
        OnDetailTableDataBind="rgSoftware_DetailTableDataBind" OnItemCommand="rgSoftware_ItemCommand" OnDataBound="rgSoftware_DataBound">
        <MasterTableView Font-Names="Helvetica, Arial, Verdana, sans-serif" Font-Size="10px"
            DataKeyNames="SoftwareID" Name="SoftwareGroup" Width="100%" runat="server" EditMode="InPlace"
            CommandItemDisplay="Top">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="LicenseInfoID" Name="LicenseInfoID" Width="100%"
                    runat="server" Font-Size="10px" EditMode="InPlace" CommandItemDisplay="Top" AllowAutomaticInserts="true"
                    AllowAutomaticUpdates="true">
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="~/Images/Grid/Save.gif"
                            EditImageUrl="~/Images/Grid/Edit.gif" InsertImageUrl="~/Images/Grid/Save.gif"
                            CancelImageUrl="~/Images/Grid/Cancel.gif" />
                        <telerik:GridBoundColumn DataField="LicenseInfoID" Visible="false" />
                        <telerik:GridTemplateColumn HeaderText="Key" UniqueName="Key">
                            <ItemTemplate>
                                <asp:Label ID="lblKey" runat="server" Text='<%# Eval("LicenseKey")%>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="tbKey" runat="server" Text='<%# Eval("LicenseKey")%>' Width="200px"
                                    Font-Size="10px" />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="# of Licenses" UniqueName="Qty">
                            <ItemTemplate>
                                <asp:Label ID="lblQty" runat="server" Text='<%# Eval("NumberOfLicenses")%>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadNumericTextBox ID="tbQty" runat="server" text='<%# Eval("NumberOfLicenses")%>'
                                    Width="30px" NumberFormat-DecimalDigits="0" ShowSpinButtons="false" Font-Size="10px" />
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridCheckBoxColumn UniqueName="chkActive" DataField="Active" HeaderText="Active" />
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="~/Images/Grid/Save.gif"
                    EditImageUrl="~/Images/Grid/Edit.gif" InsertImageUrl="~/Images/Grid/Save.gif"
                    CancelImageUrl="~/Images/Grid/Cancel.gif" />
                <telerik:GridBoundColumn DataField="SoftwareID" Visible="false" />
                <telerik:GridTemplateColumn HeaderText="Software" UniqueName="SoftwareName">
                    <ItemTemplate>
                        <asp:Label ID="lblSoftwareName" runat="server" Text='<%# Eval("SoftwareName")%>' />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="tbSoftwareName" runat="server" Text='<%# Eval("SoftwareName")%>'
                            Width="250px" Font-Size="10px" />                        
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Location" UniqueName="LocationOfSoftware">
                    <ItemTemplate>
                        <asp:Label ID="lblLocationOfSoftware" runat="server" Text='<%# Eval("LocationOfSoftware")%>' />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="tbLocationOfSoftware" runat="server" Text='<%# Eval("LocationOfSoftware")%>'
                            Width="250px" Font-Size="10px" />                        
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridCheckBoxColumn HeaderText="Active" DataField="Active" UniqueName="SoftwareActive" />
            </Columns>
        </MasterTableView>
        <ClientSettings AllowRowsDragDrop="true">
        </ClientSettings>
        <FilterMenu EnableEmbeddedSkins="False">
        </FilterMenu>
    </telerik:RadGrid>




protected void rgSoftware_InsertCommand(object source, GridCommandEventArgs e)
       {
           AssetDataDataContext db = new AssetDataDataContext();
           GridEditableItem editedItem = e.Item as GridEditableItem;
           if ("SoftwareGroup".Equals(e.Item.OwnerTableView.Name))
           {                
               Software nSoftware = new Software();
               SaveSoftwareGroup(nSoftware, editedItem);
               db.Softwares.InsertOnSubmit(nSoftware);                
           }
           else if ("LicenseInfoID".Equals(e.Item.OwnerTableView.Name))
           {
               GridDataItem parentItem = (GridDataItem)e.Item.OwnerTableView.ParentItem;
               LicenseInfo nLicense = new LicenseInfo();
                              
               nLicense.SoftwareID = Int32.Parse(parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["SoftwareID"].ToString());
               SaveLicenseInfo(nLicense, editedItem);                
               db.LicenseInfos.InsertOnSubmit(nLicense);
           }
           db.SubmitChanges();
             
       }
       protected void rgSoftware_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
       {
           AssetDataDataContext db = new AssetDataDataContext();
           GridEditableItem editedItem = e.Item as GridEditableItem;
           if ("SoftwareGroup".Equals(e.Item.OwnerTableView.Name))
           {                
               Int32 SoftwareID = Int32.Parse(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["SoftwareID"].ToString());                
               Software nSoftware = db.Softwares.SingleOrDefault(s => s.SoftwareID == SoftwareID);
               SaveSoftwareGroup(nSoftware, editedItem);
           }
           else if ("LicenseInfoID".Equals(e.Item.OwnerTableView.Name))
           {
               //Get the primary key value using the DataKeyValue.     
               Int32 LicenseInfoID = Int32.Parse(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["LicenseInfoID"].ToString());
               LicenseInfo nLicense = db.LicenseInfos.SingleOrDefault(l => l.LicenseInfoID == LicenseInfoID);
               SaveLicenseInfo(nLicense, editedItem);   
           }
           db.SubmitChanges();
           rgSoftware.MasterTableView.ClearEditItems();
       }
Eric Klein
Top achievements
Rank 1
 answered on 18 Mar 2011
1 answer
80 views
Good afternoon,

I have a RadTreeView in which I am using code similar to the Drag-n-Drop demo to do client-side rearranging of nodes.

The treeview is initially populated in the code-behind with values from a database in Page_Init, with each node containing different controls and text (imagebuttons, hyperlinks, etc.) based on database values.

Using the code from the demo, the drag-n-drop functionality works great, but the node appears to be losing its controls collection after the drop.  Source node is moved to destination OK, but after the move, node contains only the text and not the controls that existed in the source.

What do I need to do to ensure the node's control's innerHTML is kept?
Veronica
Telerik team
 answered on 18 Mar 2011
1 answer
88 views
I have a RadComboBox, fill it with some emails and I have RadComboPartici.AutoCompleteSeparator = ""; I need is to have the "@" without any postback as achievement?
Veronica
Telerik team
 answered on 18 Mar 2011
16 answers
313 views

Hello,

Using Sitefinity and RadMenu I can see the Expand Item Image (arrow) appears on parent menu items.

But the Arrow does not appear on parent menu items that belong to the root level of the menu.

How can I make the arrow appear for root menu items that have children?

Regards,

Mark.


Kate
Telerik team
 answered on 18 Mar 2011
2 answers
102 views

I have a ListBox and each time one item is selected a RadCombo is added to my page with the ID = Selected value in the listbox. On server side my code verifies to not duplicate the Radcombo. There is a button for each RadCombo to remove it from the page. The delete action is made on client side with Jquery code and it just empty the div containing radcombo and other controls. Unfortunately Telerik doesn’t remove the RadCombo from its collection, and I verified there is still some div hidden with the same ID,  and still continue to work with the RadCombo and getting the following error shown in FireBug:

header is null (header is the class of div containing the RadCombo)

_

evt = Object { type="click", rawEvent=, more...}
(?)()
 
browserHandler(e=click clientX=393, clientY=182) e = click clientX=393, clientY=182
 
var index = header._index;

 

My question is how can I remove the control on client site in order to not get the error.

 

I added the following code on pageLoad event

combos = Telerik.Web.UI.RadComboBox.ComboBoxes;
 
//First of all how do I get the Id of each combo?
$.each(combos, function(){this.??? // Get Name or ID});

 

The javascript is an external file and cannot use <% =control.ClientID%>

 

I hope that I was clear to define my issue, and would really appreciated any help.

 

 

 

Helen
Telerik team
 answered on 18 Mar 2011
3 answers
479 views
Hi;
I am using RadTreeView in my project along with asp checkbox.
We have an unusal requirement that consider a scenario where you have RadTreeView and in the
bottom there is Checkbox having text SelectAll. On Checking or Selecting on the Checkbox I should be able to show all the nodes
selected manner in TreeView. and On UnChecking or deSelecting I should be able to show all the nodes
Unselected manner in TreeView . please let me know how can I achive this functionality either from ClientSide or from Server Side.
For more information on requirement please see the attached image file 
Kate
Telerik team
 answered on 18 Mar 2011
2 answers
102 views
Hello!

I work with javascript google map api and would like to use radtooltips there when i click to some specified map position (marker). I handle click and call web service method where i try to create and show tooltip from code...

        [WebMethod]
        public void ShowToolTip(int locationId)
        {
            RadToolTip radToolTip = new RadToolTip();
            radToolTip.ShowEvent = ToolTipShowEvent.FromCode;
            radToolTip.RelativeTo = ToolTipRelativeDisplay.Mouse;
            radToolTip.Position = ToolTipPosition.Center;
            radToolTip.ShowDelay = 0;
            radToolTip.Animation = ToolTipAnimation.Slide;
            radToolTip.RenderInPageRoot = true;
            radToolTip.Title = "fdfdf";
            radToolTip.Text = "ffff";
            radToolTip.Show();
        }

Rad tool tip isn't showed in this case.

Please tell me is it possible to do something this way, without depending to some control. Because i can't link tooltip to some map position. Marker it's not an asp.net control, it doesn't have id, it's just like an icon.
Svetlina Anati
Telerik team
 answered on 18 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?