Telerik Forums
UI for ASP.NET AJAX Forum
17 answers
178 views
Hello,

I am using a ComboBox within a RadGrid that uses DbContext to get its data from a table of States. While in edit mode I wish to have the ComboBox display the State from the Customers table if exists and/or be able to select a State if needed. Currently the ItemTemplate shows the current State selected for a customer just fine but while in edit mode the ComboBox is not populated with current State or a selection of States. Here is my code:

Customer.aspx
<telerik:GridTemplateColumn HeaderText="State" EditFormColumnIndex="2">
    <ItemTemplate>
        <%#DataBinder.Eval(Container.DataItem, "State")%>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadComboBox ID="selectState" runat="server" Skin="Web20" DataTextField="stateName" DataValueField="stateCode" />
    </EditItemTemplate>
</telerik:GridTemplateColumn>

Customer.aspx.cs
protected void RadGrid1_EditCommand(object source, GridCommandEventArgs e)
 {
 
     if (e.Item is GridEditableItem && e.Item.IsInEditMode)
     {
         GridEditableItem edititem = (GridEditableItem)e.Item;
         DropDownList ddlStates = (DropDownList)edititem.FindControl("selectState");
         ddlStates.DataSource = DbContext.States;
         ddlStates.DataTextField = "stateName";
         ddlStates.DataValueField = "stateCode";
         ddlStates.DataBind();
     }
 
}

Please let me know what I have done incorrectly or what I am missing. Thanks for the help!



ADAPT
Top achievements
Rank 2
 answered on 07 Aug 2013
2 answers
160 views
Hi!

I am populating my data in my RadComboBox by using a ObjectDataSource, everything works fine.

Now when I want to delete items from the RadCombobox and the database it doesnt work. 

It gets removed from the database successfully, but it still remains in my combobox, even though I refresh the page it still remains, The only thing that works is to shutdown the whole debugging and start it again, then it repopulates the data from the database.

Any idea what to do to repopulate the data? Ive tried doing a full post back, with no luck. I have searched forum and tried several propsals with no luck.

I am starting to think its because its saved in cached or in memory somehow? (clientsided)

Appreciate any help!
Nicklas
Top achievements
Rank 1
 answered on 07 Aug 2013
4 answers
215 views
Hello. We need your help in issue connected with how exacly we need to assign DataSource to RadTreeList control. (ASP.NET WEB FORMS)
We followed several scenarios:

1)  Tried to handle NeedDataSource event like in manual page. By using LinqDataSourse or SqlDataSource, or just list of samle data (about 4000 rows) it starts to be really slow.

2)  As far as I am concerned, the above scenatio is known as Advanced Binding (handling needdatasource event). So, Is it a good approach to use simple binding scenario to get component work faster. 

3) Do we need to add RadTreeList into RadAjaxPanel to make it faster or it does not matter?

4)  Is it possible to use treelist without re-binding / re-assigning DataSource or it is a core feature of this component ?



Merry Christmas,
looking forwar to hearing from you,
Tafrov Vadim

  
Pavlina
Telerik team
 answered on 07 Aug 2013
3 answers
2.6K+ views
I have been plagued on more than one occasion dealing with scrollbars on the grid and in the past I gave up.  Fortunately I have found a resolution today which seems to work all the time.  I figured I would share this to help anyone else having problems.

Problems:  
    - Horizontal scrollbar is present when you enable scrolling.
    - Documentation recommendations don't really explain how to fix the problem. 
    - I don't use auto generation of columns. Who does??  Is this something people really use for production applications?
    - Setting widths of columns not to exceed grid width doesn't work and misleading.

Solution: 
    - To remove the horizontal scrollbar when NOT USING auto generate columns.  

    - Set grid width to 100%
    - DO NOT set the Master Table View width.
    - Assign all of your columns a fixed width except for 1 and apply 50% or other large % to it.
        * Make sure this is done in the <headerstyle> elements on ALL columns 
    - Make sure you do not set any widths in the <itemStyle> elements.
    - Enable scrolling using static headers.
    - If any hidden columns are present set the widths to 0px.

Post if this helped you.

-Robert
Venelin
Telerik team
 answered on 07 Aug 2013
2 answers
174 views
I am pulling a aspx page through a radwindow onto my page via a <a href onclick> 

the window shows and everything comes up great, the problem is when I go to click on it agian the window will not show agian, and I have no clue why, but if I refresh the page it works fine again.  is there something else i need to set in the properties to enable this window toi be opened multiple times on a page if need be.  Originall I had a a mouse over but that got annoying in swiping mouse over label accidentally so I changed to onclick.

<telerik:RadWindow ID="RadEducation" runat="server" AutoSize="true" DestroyOnClose="true" Animation="FlyIn" NavigateUrl="~/Admin/Educationkey.aspx" MaxHeight="600px" MaxWidth="300px" Modal="true"  SkinID="Web20" OffsetElementID="lblKey"></telerik:RadWindow>
 
 <a href="#" onclick="myMouseOver();">key</a><asp:Label ID="lblKey" runat="server"></asp:Label>
 
 
 function myMouseOver() {
               var oWnd = $find("<%=RadEducation.ClientID%>");
               oWnd.show();
           }


Kevin
Top achievements
Rank 1
 answered on 07 Aug 2013
6 answers
975 views
Hi All,

Is there any way to get the total files size (upload size) in radasyncupload ? My requirement is, 
I need to put multiple file RadAsyncUpload in my page. And have a total upload size limit (size of all files.) of 100 MB. When it reach the limit of 100 MB, it should display an error message and stops the uploading.

The code I tried,

<telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" HideFileInput="true" Skin="Hay"
                        MultipleFileSelection="Automatic" AllowedFileExtensions=".jpeg,.jpg,.png,.doc,.docx,.xls,.xlsx,.rar,.zip,.txt,.dll,.pdf"
                        OnClientFileUploadFailed="onUploadFailed" OnClientFileSelected="onFileSelected"
                        OnClientFileUploaded="onFileUploaded" 
                        OnClientProgressUpdating="checkUploadedFilesSize"/>
function OnFileUploaded(sender, args) {
    DecrementUploadsInProgress();
    var totalBytes = 0;
    var numberOfFiles = sender._uploadedFiles.length;
      
        if (isDuplicateFile) {
            sender.deleteFileInputAt(numberOfFiles - 1);
            isDuplicateFile = false;
            sender.updateClientState();
            alert("You can't add the same file twice");
            return;
        }
      
    for (var index in filesSize) {
        totalBytes += filesSize[index];
    }
    if (totalBytes > MAX_TOTAL_BYTES) {
        sender.deleteFileInputAt(numberOfFiles - 1);
        sender.updateClientState();
        alert(OVERSIZE_MESSAGE);
    }
}

This code is failing with an error "DOM is disabled".

Is there any way to do this?
Mahesh
Top achievements
Rank 1
 answered on 07 Aug 2013
1 answer
105 views
Sorry about that I had to switch to compatibluty view to see this text.

Anyway, I have having trouble getting a updateprogress to show with a radtreeview. I know I have it setup correctly since it works if I select a node, but not working during the initial load. The process to create the tree nodes are nested loops reading from an Oracle database that take about 10 seconds to complete and I want the UpdateProgress to show during this time.

The "PopulateGrid ()" below in the PageLoad event is what fills the treeview:

 

If

 

 

Not Page.IsPostBack Then

 

PopulateGrid()

RadTreeView1.ExpandAllNodes()

RadTreeView2.Nodes(0).Expanded =

 

True

 

 

 

End If

 

Kate
Telerik team
 answered on 07 Aug 2013
6 answers
119 views
I'm not sure if this is a problem for us but I thought I should mention it anyway.

We're testing an app with a fairly conventional RadGrid.  

On the machine my co-worker was using to test, the filter buttons were not visible when running in IE9, although clicking on where they should be did bring up the menu.

He is the only one so far to report this problem in IE9.  The only difference between his machine and mine (both running Windows 7) is that his machine is running a slightly older version of IE9, Update Version 9.06 while I'm running 9.10.  The app is running Telerik controls version 2012.2.607.40.

Anyone else have this problem?
Maria Ilieva
Telerik team
 answered on 07 Aug 2013
1 answer
110 views

Hi All,

Below is my code.

  
  <div>

                        <asp:Menu ID="mnManageView" runat="server" OnMenuItemClick="mnManageView_MenuItemClick" Orientation="Horizontal" SkipLinkText="">

                                <Items>
                                    <asp:MenuItem ImageUrl="~/App_Themes/Theme1/Images/CRUD/Simple/manage.gif" ToolTip="Manage Views"
                                        Value="View" Text="&amp;nbsp;" NavigateUrl="javascript:void(0);">
                                        <asp:MenuItem ImageUrl="~/App_Themes/Theme1/Images/CRUD/Simple/add.gif" Text="&amp;nbsp;&amp;nbsp;Add"
                                            Value="Add" ToolTip="Add View"></asp:MenuItem>
                                        <asp:MenuItem ImageUrl="~/App_Themes/Theme1/Images/CRUD/Simple/edit.gif" Text="&amp;nbsp;&amp;nbsp;Edit"
                                            Value="Edit" ToolTip="Edit View"></asp:MenuItem>
                                        <asp:MenuItem ImageUrl="~/App_Themes/Theme1/Images/CRUD/Simple/delete.gif" Text="&amp;nbsp;&amp;nbsp;Delete"
                                            Value="Delete" ToolTip="Delete View"></asp:MenuItem>
                                        <asp:MenuItem ImageUrl="~/App_Themes/Theme1/Images/CRUD/Simple/save.gif" Text="&amp;nbsp;&amp;nbsp;Save"
                                            Value="Save" ToolTip="Save View"></asp:MenuItem>
                                    </asp:MenuItem>
                                </Items>

                        </asp:Menu>
                </div>

                <div class="subHeaderMain noPadding" id="divContainer" style="width: 100%">
                   -- My radGrid is here.
                </div>

 

On mouse hover on the asp:menu i am getting the menu items. And in the same time my grid width is increasing automatically, this issue i am facing only in IE8.
it is working properly in IE9 and chrome.  Please help on this. i am working on this from 3days but not getting any solution. please help me.   

Advanced thanks and Regards
Kranthi.

Princy
Top achievements
Rank 2
 answered on 07 Aug 2013
1 answer
92 views
Hi telerik

Why the radbutton seems very collapsed on setting a custom height? I set Height="90px" and doubt whether its a button. Its easily replicable.

Joseph
Bozhidar
Telerik team
 answered on 07 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?