Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
933 views
Hi,

I have a CardView radgrid that shows accounts.

        <telerik:RadGrid ID="RadGridAccounts" DataSourceID="SqlDataSourceAccounts" runat="server" 
            OnItemDataBound="RadGridAccounts_OnItemDataBound" AllowPaging="True" PageSize="10" ShowHeader="false">  
           <PagerStyle Mode="NextPrevAndNumeric" /> 
           <MasterTableView><ItemTemplate>  
 
        <h4>Account # <%# DataBinder.Eval(Container.DataItem, "AccountNumber") %> </h4>     
 
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>   
        <br /> 
          
        <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder> 
        <br /> 
 
        <asp:PlaceHolder ID="PlaceHolder3" runat="server"></asp:PlaceHolder> 
                  
    </ItemTemplate> 
</MasterTableView> 
   </telerik:RadGrid> 
 

 

For each account I show different account details in three radgrids that I create dynamically.

                RadGrid1 = new RadGrid();     
                RadGrid1.Skin = "Office2007";     
                RadGrid1.Width = Unit.Percentage(100);     
                RadGrid1.AutoGenerateColumns = false;     
    
                boundColumn = new GridBoundColumn();     
                boundColumn.DataField = "Asset";     
                boundColumn.HeaderText = "Asset";     
                RadGrid1.MasterTableView.Columns.Add(boundColumn);     
    
                boundColumn = new GridBoundColumn();     
                boundColumn.DataField = "Value";     
                boundColumn.HeaderText = "Value";     
                boundColumn.DataFormatString = "{0:C}";     
                RadGrid1.MasterTableView.Columns.Add(boundColumn);     
    
                RadGrid1.DataSource = dt;     
                RadGrid1.DataBind();     
    
                PlaceHolder1.Controls.Add(RadGrid1);     
 

What I need to do is dynamically add a checkbox to each row in the radgrid. When I try this:

                GridCheckBoxColumn checkboxColumn = new GridCheckBoxColumn();  
                checkboxColumn.DataField = "Problem";  
                checkboxColumn.HeaderText = "Problem?";  
                RadGrid1.MasterTableView.Columns.Add(checkboxColumn);  
 

then the checkboxes are disabled. I guess I need to put the grid in edit mode? How would I do that? I don't want the users to edit any columns besides checking the checkboxes.

Another question is - after a user checks some checkboxes and clicks on "Save", how do I refer to the checkboxes inside the grids inside the accounts grid to save the changes to the database?

Thanks,
Julia

Pavlina
Telerik team
 answered on 26 Nov 2012
0 answers
37 views
Hi,
I am using radtreeview, i need to use ajax for binding the values based on the radtreeviewcontext menu. How i Can restrict ajax for the specific <telerik:RadTreeViewContextMenu> (for the Exporting pdf). 







Thanks

Dhamodharan
Top achievements
Rank 1
 asked on 26 Nov 2012
1 answer
84 views
I'm using RadPanelBar on a master page as a main navigation control. On some content pages I make calls to Response.Redirect() method and I want the PanelBar SelectedItem to be changed accordingly. How can I achieve this? I have to mention that I use PersistStateInCookie="true" for state persistence.
Any help?
Boyan Dimitrov
Telerik team
 answered on 26 Nov 2012
1 answer
63 views
Hello,
I an new to telerik controls and coding.
I have a task where I need to use a Radalert, that uses javacript funtion to open a new page,  from a resource file. Is it possible?? Can i use a Radlaert from a resource file? If yes please guide how can i do this?  Appreciate your answers.

Thanks
Rumen
Telerik team
 answered on 26 Nov 2012
1 answer
420 views
Hello everybody,

We have a project that uses several RadGrids in many ASP sites. We created the RadGrid in an seperate UserControl and this works very well. Now I have an issue from a customer that concerns the filtering.

Init / Problem:
We enable the filtering by default in our colums and that's works good too. So the user can enter a value, then hit the TAB or ENTER key and the RadGrid filters with it's values. Now in some cases the user would like to enter all of the filter values first and start the filtering by pressing the ENTER key.

I've searched a lot in your forums and found that some users had a similar problem. What I tested now is to add the folowing code (in the ItemDataBound event from the RadGrid) to prevent the execution of the filter by pressing the TAB key in the filter textbox or loosing it's focus.

filterBox.Attributes.Add("OnChange", "javascript:return false;")

Now this works also very well and the filtering start by pressing the ENTER button, but I figured out that this not solve my problem. Because when I enter a filter value in 2 or more colums only the last entered value will be filtered and sometimes the filter is cleared and the RadGrid is not filtered.

You can see this behavior in this demo project provided from "Tsventina" (Link: Filtering on ENTER key). Please notice that we use the last release of the Telerik Controls but the behavior is the same.

You can see the problem by testing as follows:
1. Enter value in column "ContactName" and press ENTER -> Result: RadGrid is filtered OK
2. Enter value in column "ContactName" and press TAB and then ENTER -> Result: Value in column is cleared, RadGrid is not filtered
3. Enter value in column "ContactName" go to for e.g. column "Address" and enter a second filter value and press ENTER -> Result: Value in column "ContactName" is cleared, value in column "Address" is filtered.
4. Enter value in column "ContactName" go to for e.g. column "Address" and enter a second filter value and press TAB (you're possibly in column "City") and then press ENTER -> Result: All filter values are gone, RadGrid is not filtered

I hope you're understand what I'd like to say and it would be very nice if someone of you have a workarround for me.

Thanks in advance.

Best greetings from Switzerland
Reto

PS: Maybe...sorry for my bad english :)
Kostadin
Telerik team
 answered on 26 Nov 2012
1 answer
78 views
The editable image height and width are getting '0' in firefox and other browsers.

var imgWidth = editor.getEditableImage().get_width();
 var imgHeight = editor.getEditableImage().get_height();     

image original height and width are getting only in internet explorer.how can i get original width and height using all browsers.

aspx:

 <telerik:RadImageEditor ID="rieControl" runat="server" OnImageLoading="rieControl_ImageLoading"
                        OnClientLoad="OnClientLoad" OnClientToolsDialogClosed="dialogclose" ExternalDialogsPath="ImageEditorDialogs"
                        ImageUrl="" OnClientCommandExecuted="OnClientCommandExecuted" ImageManager-EnableContentProvider="true"
                        Width="1030px" Height="700px" ToolsFile="~/XmlFiles/PbUserContentImageEditor_ToolBasic.xml">
                    </telerik:RadImageEditor> var editor = $find("<%= rieControl.ClientID %>");
script:
 function OnClientLoad(sender, args) {
            if (sender._imageKey != undefined) {
  var imgWidth = editor.getEditableImage().get_width();
                var imgHeight = editor.getEditableImage().get_height();                       
                if (!isNaN(Number(imgWidth)) && Number(imgWidth) != 0 && !isNaN(Number(imgHeight)) && Number(imgHeight) != 0) {
                    if (imgWidth > 1000 || imgHeight  > 700) {
                        var widthPercentage = (1000 * 100) / Number(imgWidth);
                        var heightPercentage = (700 * 100) / Number(imgHeight);
                        widthPercentage = Math.floor(widthPercentage);
                        heightPercentage = Math.floor(heightPercentage);
                        if (heightPercentage > widthPercentage) {
                            sender._zoomImage(widthPercentage);
                            objhdnReset.value = widthPercentage;
                        }
                        else {
                            sender._zoomImage(heightPercentage);
                       }
                    }
                }
            }
Vessy
Telerik team
 answered on 26 Nov 2012
6 answers
164 views
Hi Telerik Team,

I am facing two problems using RadGrid Grouping.
1. The RadGrid is not rendering properly when it is loaded for the first time. (Please find the screenshot.)
2. If I Drag and Drop any column to GroupPanel then it is showing below error.
     Error Message : "Expression cannot be null or empty"


I can see both the above issues only when the RadGrid is loaded for the first time.
If I do any action like ungroup the initail grouped column/ Changed the paging/ Refresh/ Sort then it is rendering properly and then onwards it is working fine as expected.

Could you please suggest me a solution for this.?
Many Thanks,
Vamsikamal
Vamsi Kamal
Top achievements
Rank 1
 answered on 26 Nov 2012
3 answers
87 views
I have RadSkinManager in my master page and have telerik button in my aspx with master page.

But the skin is not appearing on buttons in IE and it is working fine in Mozilla


What will be the issue?
Danail Vasilev
Telerik team
 answered on 26 Nov 2012
1 answer
79 views
Hello    

How can I give myown filename to the uploaded file in radasyncupload? Please help. thanks in advance

RT
Princy
Top achievements
Rank 2
 answered on 26 Nov 2012
7 answers
164 views
I have a RadGrid with the export to PDF and export to Excel buttons enabled.

Recently I added a button inside my Column Headers and now when I press the export to pdf button I get the following error:

System.InvalidCastException: Unable to cast object of type 'Telerik.Web.Apoc.Layout.BlockArea' to type 'Telerik.Web.Apoc.Layout.AreaContainer'.
at Telerik.Web.Apoc.Fo.Flow.BlockContainer.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.TableCell.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.TableRow.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.AbstractTableBody.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Table.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Block.Layout(Area area)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area, Region region)
at Telerik.Web.Apoc.Fo.Flow.Flow.Layout(Area area)
at Telerik.Web.Apoc.Fo.Pagination.PageSequence.Format(AreaTree areaTree)
at Telerik.Web.Apoc.StreamRenderer.Render(PageSequence pageSequence)
at Telerik.Web.Apoc.Fo.FOTreeBuilder.EndElement()
at Telerik.Web.Apoc.Fo.FOTreeBuilder.Parse(XmlReader reader)


When I click on the export to excel button, it puts all the page HTML into the excel spreadsheet instead of just the grid.

Any ideas?  Is there any way to ignore html controls in the grid?
Daniel
Telerik team
 answered on 26 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?