Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
134 views
When 'postback' event is triggered in a page, rad grid header style is reset. What could be the cause of this issue and how to fix it?
aspx code
<asp:UpdatePanel UpdateMode="Always" ID="upGridConfig" runat="server">
                                        <ContentTemplate>
                                            <asp:HiddenField ID="hdnId" runat="server" />
                                            <asp:HiddenField ID="hdnTowerNo" runat="server" />
                                            <telerik:RadGrid ID="gridWindTurbines" ViewStateMode="Enabled" AllowPaging="true"
                                                AllowMultiRowSelection="false" AllowSorting="true" OnPageIndexChanged="gridWindTurbines_PageIndexChanged"
                                                OnNeedDataSource="gridWindTurbines_NeedDataSource" AutoGenerateColumns="false"
                                                AllowAutomaticInserts="true" GridLines="Horizontal" ClientSettings-EnableRowHoverStyle="true"
                                                OnItemDataBound="gridWindTurbines_ItemDataBound" EnableAjaxSkinRendering="false"
                                                MasterTableView-RowIndicatorColumn-ItemStyle-BorderColor="ActiveBorder" Height="264px"
                                                 runat="server">
                                                <ClientSettings Scrolling-AllowScroll="true" Selecting-AllowRowSelect="true" Scrolling-UseStaticHeaders="true"
                                                    Selecting-UseClientSelectColumnOnly="true">
                                                    <ClientEvents OnRowSelecting="enablelink" OnRowDeselecting="disablelink" />
                                                </ClientSettings>
                                                <MasterTableView AllowPaging="true" DataKeyNames="NAME,OBJID,MODEL,POWER" Visible="true"
                                                    Width="100%" TableLayout="Fixed" EnableViewState="true" HeaderStyle-HorizontalAlign="Center"
                                                    ItemStyle-HorizontalAlign="Center" AlternatingItemStyle-HorizontalAlign="Center"
                                                    ClientDataKeyNames="NAME,OBJID">
                                                    <Columns>
                                                        <telerik:GridClientSelectColumn UniqueName="CHK" ItemStyle-HorizontalAlign="Center"
                                                            HeaderStyle-Width="5%">
                                                        </telerik:GridClientSelectColumn>
                                                        <telerik:GridBoundColumn DataField="OBJID" HeaderStyle-Font-Bold="true" Visible="false"
                                                            HeaderStyle-Width="10%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="NAME" HeaderStyle-Font-Bold="true" HeaderText="WTG"
                                                            HeaderStyle-Width="10%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="MODEL" HeaderText="TYPE" HeaderStyle-Font-Bold="true"
                                                            HeaderStyle-Width="25%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn UniqueName="POWER" SortExpression="POWER" HeaderStyle-Font-Bold="true"
                                                            HeaderText="POWER">
                                                            <ItemTemplate>
                                                                <asp:Label ID="LblPower" runat="server" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn DataField="PLCCount" HeaderText="#PLC" HeaderStyle-Font-Bold="true"
                                                            HeaderStyle-Width="10%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="CCUCount" HeaderText="#CCU" HeaderStyle-Font-Bold="true"
                                                            HeaderStyle-Width="10%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="SMPCount" HeaderText="#SMP" HeaderStyle-Font-Bold="true"
                                                            HeaderStyle-Width="10%">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="DASCount" HeaderText="#DAS" HeaderStyle-Font-Bold="true"
                                                            HeaderStyle-Width="10%">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                    <HeaderStyle CssClass="GridHeader" />
                                                </MasterTableView>
                                                <PagerStyle Mode="NextPrevAndNumeric" VerticalAlign="Bottom" Position="Bottom" AlwaysVisible="true" />
                                            </telerik:RadGrid>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
Konstantin Dikov
Telerik team
 answered on 09 Apr 2014
2 answers
499 views
Hi,

Can I set images URL from a data source instead of image data field? In my situation, we save only image url in database.

Thanx 
Saeid
Saeid Kdaimati
Top achievements
Rank 2
 answered on 09 Apr 2014
1 answer
76 views
Hi,

Is there a way to enable resizing but only when in 'Preview' edit mode? At the moment, it seems that resizing only works when editor is in 'All' edit mode. When set to a specific edit mode, the bottom of the editor (which allows resizing) disappears.

Thanks.
Ianko
Telerik team
 answered on 09 Apr 2014
11 answers
485 views

Has anyone managed to create a FileBrowserContentProvider to handle physical paths outside the web app? I have a scenario where I need files to be managed outside of the application, and it appears that everything wants virtual paths!

Looking at the demo I also thought of using a httphandler for the files, however that isn’t working. I got as far as getting the directory tree to show in the left tree view however no files are being shown.

I am by no means an ASP.net expert and am still learning the ropes, so if anyone can point me in the right direction I'd be most grateful.

I Keep getting errors like below thrown up:

---------------------------
Message from webpage
---------------------------
Callback Loading error:
D:\Test\
Unrecognized escape sequence. (14): { path : &quot;D:\Test\&quot;, sortExpression : &quot;&quot;}96|/wEWCAL4tITjBwL8w9uGDALztZepDwLytZepDwL1tZepDwL0tZepDwLvtZepDwLutZepD4v1sVL6WoAl9jmHj5iuS6WymetQ
---------------------------
OK  
---------------------------

Vessy
Telerik team
 answered on 09 Apr 2014
2 answers
99 views
I have a page that I have has a fileExplorer on it.  All seems to work except the upload.  When I upload a file I always get this error and it opens a dynamic block of code.

JavaScript runtime error: Unable to get property 'get_selectedItem' of undefined or null reference

The file still uploads but not sure why this error is happening. 
I am runner version 2013.2.717.35 on a 2.0 framework asp.net app.
Rumen
Telerik team
 answered on 09 Apr 2014
1 answer
113 views
Hi

I have implemented the custom file browser as specified in the online resources. I am using shared paths like "\\172.0.0.0\images".

Everything else seem to work except for thumnails view.

I also tried cssclass - rfethumbnails but it doesn't help.

I have implemented all 4 methods that determine thumbnails for the images.

public override string GetFileName(string url)
        {
            string fileName = Path.GetFileName(RemoveProtocolNameAndServerName(url));
            return fileName;
        }
        public override string GetPath(string path)
        {

            // First add the '~/' signs in order to use the VirtualPathUtility.GetDirectory() method ;
            string PathWithTilde = "~/" + path;
            string virtualPath = VirtualPathUtility.GetDirectory(PathWithTilde);
            virtualPath = virtualPath.Remove(0, 2);// remove the '~' signs
            return virtualPath;            
        }
        /// <summary>
        /// Verify the file selected
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        
        public override Stream GetFile(string url)
        {
            string virtualPath = RemoveProtocolNameAndServerName(url);
            string physicalPath = this.GetPhysicalFromVirtualPath(virtualPath);
            if (physicalPath == null)
                return null;

            if (!File.Exists(physicalPath))
            {
                return null;
            }

            return File.OpenRead(physicalPath);
        }
        public override string StoreBitmap(System.Drawing.Bitmap bitmap, string url, System.Drawing.Imaging.ImageFormat format)
        {
            string virtualPath = RemoveProtocolNameAndServerName(url);
            string physicalPath = this.GetPhysicalFromVirtualPath(virtualPath);
            if (physicalPath == null)
                return string.Empty;

            StreamWriter bitmapWriter = StreamWriter.Null;

            try
            {
                bitmapWriter = new StreamWriter(physicalPath);
                bitmap.Save(bitmapWriter.BaseStream, format);
            }
            catch (IOException)
            {
                string errMessage = "The image cannot be stored!";
                return errMessage;
            }
            finally
            {
                bitmapWriter.Close();
            }
            return string.Empty;
        }

Vessy
Telerik team
 answered on 09 Apr 2014
1 answer
110 views
I have
<telerik:GridNumericColumn ID
                            DataField="PricePerUnit"  
                            HeaderText="Unit Price"
                            HeaderStyle-HorizontalAlign="Center"
                            UniqueName="PricePerUnit"
                            ItemStyle-HorizontalAlign="Right"
                            DataFormatString="<%$Resources: DataFormats, PRICE_WITH_DOLLAR %>"
                            ></telerik:GridNumericColumn>

I want to catch GridNumericColumn in code behind and set read-only = true;

My scenario is:
If( !theUser.CanEditPrice)
{
  //something like this   
  // myGrid.GetGridNumericColumn("PriceID").ReadOnly = true; // maybe i needed to set ColumnEditorID ?
}
Princy
Top achievements
Rank 2
 answered on 09 Apr 2014
3 answers
153 views
Hai,

Is it any other property for setting nocolor as Transperant color?

If i set Nocolor in the RadcolorPicker it always Display in Black Color
Please Guide me to do that.

Thanks,

Regards,
Sivakumar
Slav
Telerik team
 answered on 09 Apr 2014
3 answers
99 views
Hello ! 

I'm trying to ajaxify the filter textboxes of my grid, and only them, so I don't want to use the following option : 

<telerik:AjaxSetting AjaxControlID="Grid" >
 <UpdatedControls>
  <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel2"/>
 </UpdatedControls>
</telerik:AjaxSetting>

Ideally, I would like to use the solution below, but the filter textboxes don't have a defined Id, so this is not an option either : 

<telerik:AjaxSetting AjaxControlID="FilterTextBoxId" >
 <UpdatedControls>
  <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel2"/>
 </UpdatedControls>
</telerik:AjaxSetting>

The only option I found is this one : 

protected void GridOnItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
  if (e.Item is GridFilteringItem)
  {
    GridFilteringItem dataItem = e.Item as GridFilteringItem;
    TextBox filterBox = dataItem["MyfirstColumn"].Controls[0] as TextBox;
    AjaxManager.AjaxSettings.AddAjaxSetting(filterBox, Grid, LoadingPanel2);
  }
}

But for some reason it's not working, when I set a filter on my "MyfirstColumn" the entire page is reloaded, the ajaxsetting seems to be completely ignored by the process. 

Any idea of what could be the reason ?

Thanks for your help ! 

<telerik:AjaxSetting AjaxControlID="Grid" >
 <UpdatedControls>
  <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel2"/>
 </UpdatedControls>
</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="Grid" >
 <UpdatedControls>
  <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel2"/>
 </UpdatedControls>
</telerik:AjaxSetting>

Shinu
Top achievements
Rank 2
 answered on 09 Apr 2014
10 answers
213 views
Telerik Captcha is not displaying most of the time in IE. Also it is not generating any new image , it displays grey box when clicked on "Generate New Image". I have tested in IE 9.
Slav
Telerik team
 answered on 09 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?