Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
725 views
I am experiencing a problem where i have set the dataformatstring on my radgridnumericcolumn to {0:c} and it is appearing with a bunch of decimal digits rather than just 2 , i have also set the decimal digits property to 2 and tried {0:c2} and allowrounding. When in edit mode it displays how i want to with just 2 decimal places but on the grid itself its displaying with more than 2.

here is an example of what is being used now :

COLUMN :
<telerik:GridNumericColumn DataField="Premium" DecimalDigits="2" DataFormatString="{0:c}" DataType="System.Decimal" ColumnEditorID="PremiumEditor" HeaderText="Premium" UniqueName="Premium" SortExpression="Premium" >
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                 <ItemStyle HorizontalAlign="Left" Font-Names="Verdana" Font-Size="11px"></ItemStyle>
</telerik:GridNumericColumn>

EDITOR:
<telerik:GridNumericColumnEditor ID="PremiumEditor" runat="server">
               <NumericTextBox>
                   <NumberFormat DecimalDigits="2" />
                   <NumberFormat AllowRounding="true" />
                   <NumberFormat KeepNotRoundedValue="false" />
               </NumericTextBox>
</telerik:GridNumericColumnEditor>

Any idea what might be happening? Again it looks exactly how i want in edit mode but not on the grid itself
Vasil
Telerik team
 answered on 26 Aug 2011
3 answers
663 views
Hi, i use RadMaskedTextBox in my aspx:
<telerik:RadMaskedTextBox ID="edtNumber" runat="server" CssClass="EditBox" Width="300px"
    Mask="## #### #### #### #### #### ####"
 EnableEmbeddedSkins="false">
</telerik:RadMaskedTextBox>

But for some conditions I want to disable mask in codebehind. Is any way to do this, because this doesn't work:
edtNumber.Mask = null;
edtNumber.Mask = string.Empty;
Konrad
Top achievements
Rank 1
 answered on 26 Aug 2011
16 answers
737 views
Hi all,

I am using 2011.2.712 version.
I usually (not always) get this error and I have tried to read many articles about the issue on this forum and the others but not successfully.
Here are my 2 scenario :
1. The first page has a RadGrid which is in a RadAjaxPanel. When I interact with its paging (the number, or icon Next, Pre, etc), this error usually appears. I mean it's not always.
2. The second page has a button which used to export data into a folder on hard disk with .csv extension. I have replaced Response.Close(); by HttpContext.Current.ApplicationInstance.CompleteRequest();. It's OK. But after finishing this action, this error appears.

I really don't know how to fix this issue.
Please let me know what is the problem and how can I solve it.

Thanks in advance,
Phuc
Phuc
Top achievements
Rank 1
 answered on 26 Aug 2011
1 answer
173 views
Hello!

I downloaded the lastest telerik for asp.net (Evaluation version for developer). and used VS 2010 for my project.

My project has been
<?xml version="1.0"?> 
<configuration
  <configSections
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      <section name="SLSCommunicationPortal.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/> 
    </sectionGroup
  </configSections
  <connectionStrings
    <add name="CommonLogconnectionString" connectionString="Data Source=xxxxx;Initial Catalog=xxxx;Integrated Security=SSPI;Connect Timeout=120;Pooling=true; Min Pool Size=5;"
      providerName="System.Data.SqlClient" /> 
    <add name="xxxx" connectionString="Data Source=xxxxx;Initial Catalog=xxxxx;Integrated Security=SSPI;Connect Timeout=120;Pooling=true; Min Pool Size=5;"
      providerName="System.Data.SqlClient" /> 
  </connectionStrings
  <appSettings
    <add key="xxxxx" value="xxxxx"/> 
    <add key="xxxxx" value="xxxxx" /> 
    <add key="LogDir" value="xxxxx"/> 
    <add key="Telerik.Skin" value="Office2010Blue"/> 
    <add key="Telerik.ScriptManager.TelerikCdn" value="Disabled"/> 
    <add key="Telerik.StyleSheetManager.TelerikCdn" value="Disabled"/> 
  </appSettings
  <system.web
    <compilation debug="true" targetFramework="4.0"
      <assemblies
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
        <add assembly="System.Speech, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      </assemblies
    </compilation
    <pages
      <controls
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/> 
      </controls
    </pages
    <httpHandlers
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/> 
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/> 
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/> 
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/> 
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/> 
    </httpHandlers
    <httpModules
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule"/> 
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/> 
    </httpModules
  </system.web
  <system.webServer
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules runAllManagedModulesForAllRequests="true"
      <remove name="RadUploadModule"/> 
      <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode"/> 
      <remove name="RadCompression"/> 
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode"/> 
    </modules
    <handlers
      <remove name="ChartImage_axd"/> 
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/> 
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/> 
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/> 
      <remove name="Telerik_Web_UI_DialogHandler_aspx"/> 
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/> 
      <remove name="Telerik_RadUploadProgressHandler_ashx"/> 
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/> 
      <remove name="Telerik_Web_UI_WebResource_axd"/> 
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode"/> 
    </handlers
  </system.webServer
  <applicationSettings
    <SLSCommunicationPortal.Properties.Settings
      <setting name="xxxxxx" serializeAs="String"
        <value>xxxxx</value
      </setting
    </SLSCommunicationPortal.Properties.Settings
  </applicationSettings
</configuration>
developed and tested in solution works fine.

But it throw javascript error: 'get_postBackElement().id' is null or not an object  Telerik.Web.UI.WebResource.axd when we move to dev server which use IIS7.

What cause the problem? Is there anything which we didn't install on dev server or anything not in config file?

Please help to save my energy.

Thanks in advance.

Amy
Iana Tsolova
Telerik team
 answered on 26 Aug 2011
1 answer
124 views
I want to replace default textbox with radcombo and want to remove filter icon. I got samples for google like filtering but that sample is working when there is no default gridboundcolumns defined and datafield is not attached. I want to retain my design time columns and want to those Datafields and want to apply google like filtering.

can anyone tell me how to replace textbox control with radcombo [google like filtering], below is sample grid which i am using

<telerik:RadGrid ID="rgdRefer" runat="server" GridLines="Vertical" AllowSorting="True"
                       AllowPaging="True" AutoGenerateColumns="False" EnableEmbeddedSkins="false" Skin="CustSkin"
                       PageSize="5" CellSpacing="0" OnItemCommand="rgdRefer_ItemCommand"
                       OnItemDataBound="rgdRefer_ItemDataBound" Width="1020px" OnColumnCreating="rgdRefer_ColumnCreating"
                       AllowFilteringByColumn="true"
                       onneeddatasource="rgdRefer_NeedDataSource">
                       <GroupingSettings CaseSensitive="false" />
                       <SortingSettings EnableSkinSortStyles="false" />
                       <ClientSettings>
                           <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="180px" />
                       </ClientSettings>
                       <MasterTableView AllowNaturalSort="false" DataKeyNames="Id" Width="100%">
                           <Columns>
                               <telerik:GridButtonColumn HeaderText="Select" UniqueName="ibtnEdit" ImageUrl="~/App_Themes/BDefault/images/select_icon2.png"
                                   ButtonType="ImageButton" Visible="false" CommandName="EditUser" />
<telerik:GridBoundColumn HeaderText="Custom Field 12" DataField="CTA_5" UniqueName="CTA_5"
                                   SortExpression="CTA_5" Visible="false" />
                               <telerik:GridBoundColumn HeaderText="Custom Field 13" DataField="CTA_6" UniqueName="CTA_6"
                                   SortExpression="CTA_6" Visible="false" />
                               <telerik:GridBoundColumn HeaderText="Custom Field 14" DataField="CTA_7" UniqueName="CTA_7"
                                   SortExpression="CTA_7" Visible="false" />
                           </Columns>
                       </MasterTableView>
                   </telerik:RadGrid>
same code i copied in my page.
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid

but its removing existing columns and binding new filtering template column
Pavlina
Telerik team
 answered on 26 Aug 2011
1 answer
133 views
Hi,
I have a rad text box in a rad window. On page load i simply try to set focus on it using radajaxmanger. It runs successfully on all other browser except for firefox3.6. Focus gets onto the text box as soon as i click on the control. I tried so many ways to set focus on it(client side as well) but it didn't prove any fruitful result. Is it something related to browser behavior or i need to look onto controls. Please help asap.
Thanks in advance.
Johny
Top achievements
Rank 1
 answered on 26 Aug 2011
1 answer
160 views
Hi,

I have a Rad grid on my page With fetures like, Column Resize, Filter, Sorting, Expand/Collapse , NestedViewTemplate etc enabled .
Everything is working fine except one scenario.

When I make a column resize first, and then if i try to sort any column, the grid width is Automatically expanding out of the box after the postback caused by sorting , What i can see here is when i resize one column in client side, the other column widths are automatically reduced to maintain the grid's width. But after the postback the other columns default widths what i set while design time are retained back and the expanded column maintains its new width, and hence the entire grid's width is expanding.

I tried with Resizing-ResizeGridOnColumnResize="false"/ setting fixxed width to grid etc. But no use
Need Help urgently.
Thanks
Galin
Telerik team
 answered on 26 Aug 2011
1 answer
119 views
Hello!

Let's go straight to the problem.

I have two gridviews from which one generates the data source to another one. Both gridviews have ability to edit the item (row), but editing only works in first gridview (the one that generates data for the other one), when I click on edit in the second gridview nothing happens. I've been searching the web for a while and (I believe) found out that what I need is AJAX Manager.

I've checked couple of examples/Demos from Telerik's site, but I'm still not sure how to make editing in the second gridview work.

Both gridviews have edit forms inside and both gridview's edit form types are "WebUserControl".

Could someone help me out with some suggestions. Any help would be appreciated.

Radoslav
Telerik team
 answered on 26 Aug 2011
1 answer
135 views

We are evaluating the Grid and will need to access the grid in an unbound fashion, adding, hiding rows, columns, etc as well as getting and setting the values of specific cells from both the client and/or server side at run time.

Is this possible?  Does anyone have a quick and easy sample of how to do this?
Veli
Telerik team
 answered on 26 Aug 2011
1 answer
155 views
This is default page code:
protected void grdFiles_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.DownloadAttachmentCommandName)
        {
            
                GridDownloadAttachmentCommandEventArgs args = e as GridDownloadAttachmentCommandEventArgs;
                string fileName = args.FileName;
                int attachmentId = (int)args.AttachmentKeyValues["ProjectFileId"];
                ProTrakEntities objEntity = new ProTrakEntities();
                ProjectFile objFile = (from type in objEntity.ProjectFiles where type.ProjectFileId == attachmentId select type).First();
                string filename = objFile.FileName;
                string Filetype = objFile.FileType;
                byte[] binaryData = (byte[])objFile.FileData;
             
                Response.Clear();
                Response.ContentType = Filetype;
                Response.AddHeader("content-disposition", "attachment; filename=" + fileName);
                Response.BinaryWrite(binaryData);
                Response.End();
            
        }
    }

**Uploaded file Code**
 protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        if (DetailsView1.CurrentMode == DetailsViewMode.Insert)
        {
            if (Session["ProjectId"] != null)
            {
                int Projectid = Convert.ToInt32(Session["ProjectId"]);
                string Description = (DetailsView1.FindControl("RadEditor1") as RadEditor).Content;
                RadAsyncUpload radAsyncUpload = DetailsView1.FindControl("RadAsyncUpload1") as RadAsyncUpload;
                UploadedFile file = radAsyncUpload.UploadedFiles[0];
                string s = file.FileName;
                string path = System.IO.Path.GetFileName(s);
                    string Contenttype = radAsyncUpload.UploadedFiles[0].ContentType;
                int fileSize = radAsyncUpload.UploadedFiles[0].ContentLength;
                float length = float.Parse(fileSize.ToString());
                byte[] fileData = new byte[file.InputStream.Length];
                file.InputStream.Read(fileData, 0, (int)file.InputStream.Length);
                        ProTrakEntities objEntity = new ProTrakEntities();
                        ProjectFile objFile = new ProjectFile();
                        objFile.ProjectId = Projectid;
                        objFile.FileName = s;
                        objFile.FileType = Contenttype;
                        objFile.FileSize = length;
                        objFile.CreatedBy = "admin";
                        objFile.CreatedDate = DateTime.Now;
                        objFile.Description = Description;
                        objFile.FileData = fileData;
                        objEntity.AddToProjectFiles(objFile);
                        objEntity.SaveChanges();
                
            }
         }
    }
I'm saving the data in database in binaryfromat.i data was not downloading from sever when i click the attachmentcolumn.
Veli
Telerik team
 answered on 26 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?