Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
573 views
Hi.  Could someone point me to or show me an example of how to add user controls to a RadListView in code behind please. 

I have defined the RadListView in the aspx page.  In the code behind I create a DataTable containing ID numbers.  Next, I loop through these numbers and for each one instantiate two user controls, rebind the user controls, and then add them to the RadListView.

I have the logic to do all of this except I cannot seem to figure out how to add the user controls to the RadListView.  No editing/changes will be made to the user controls, I just need to display a horizontal list of the controls for informational purposes.

Here's the aspx code:
<asp:Panel ID="rpItem" runat="server" Scrolling="Y">
<telerik:RadListView ID="RadListView1" runat="server" DataKeyNames="iItemID, iSecID"
        ItemPlaceholderID="ItemPlaceHolder1" AllowPaging="true" Skin="Windows7"
        PageSize="1" Height="325px" >
        <LayoutTemplate>
            <asp:Panel ID="ItemPlaceHolder1" runat="server" Height="300px">
            </asp:Panel>
        </LayoutTemplate>
        <ItemTemplate>
             
        </ItemTemplate>
    </telerik:RadListView>
</asp:Panel>

Here's the code behind:
Dim tblItemIDs As DataTable = GetItemIDs()
 
For Each r As DataRow In tblItemIDs.Rows
 
    Me.hfItem.Value = r("iItemID")
 
    Dim ucItemInfo As UserControl = Page.LoadControl("/controls/iItem_Info.ascx")
    Dim infoView As RadListView = DirectCast(ucItemInfo.FindControl("RadListView1"), RadListView)
    infoView.Rebind()
 
    'Need to add the ucItemInfo  user control
 
  Dim ucItemPreview As UserControl = Page.LoadControl("/controls/iItem_Preview.ascx")
  Dim listView As RadListView = DirectCast(ucItemPreview.FindControl("RadListView1"), RadListView)
    listView.Rebind()
 
  'Need to add the ucItemPreview user control
 
  RadListView1.DataBind()
 
Next


Any help would be greatly appreciated.
Thanks!
Maria Ilieva
Telerik team
 answered on 16 Apr 2013
4 answers
146 views
Hi,

I have used a telerik radgrid in mu aspx page. It has several GridTemplateColumn ans Gridbound Columns.The problem is when ever I click on the column for sorting the sort icon is displayed on the second line.Even after we have ample space(marked as Green) to accommodate the sort icon exactly next to Header text. The sort icon is displaying on the second line.Please check the attached image for more details.

Thanks,
A2H
Eyup
Telerik team
 answered on 16 Apr 2013
3 answers
217 views
Hello

I can't get items when I use the 

              Dim MyItem As GridDataItem = gDGD.MasterTableView.FindItemByKeyValue("cInstID", Integer.Parse(cInstID))


              MyItem is allways = nothing

But it find it when i do
     For Each updatedItem As GridDataItem In gDGD.Items

                If updatedItem.GetDataKeyValue("cInstID").ToString() = cInstID Then
......          

can you explain where is the problem ?

Thank you a lot for your help

Anne

Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Apr 2013
1 answer
128 views
Is it possible to manipulate 'MultipleFileSelection' property of AsyncUpload control client side? I want to toggle the fileselection functionality of AyncUpload control client side from 'Automatic' to 'Disabled'
Princy
Top achievements
Rank 2
 answered on 16 Apr 2013
1 answer
127 views
Hi, im using C# and linq

I have to store the values of the selected items from my RadComboBoxes into a database.

I have a form with 15+ comboBoxes which get populated from the database on_load, i also have a "Save" button that should be saving  selectedValues of those boxes into another database. When i enter the "Click" event for my "Save" button i do not have access to any of the comboBox objects.
And when i say i do not have access to the object,i have a Box with the ID="cboAccount", i cannot call cboAccount.SelectedValue for example.

So i tried the following just to check if i could get access to the selected values
RadComboBox oops = new RadComboBox();
 
oops.ID = "cboAccount";
 
Response.Write("<script language='javascript'>alert('" + Server.HtmlEncode(oops.SelectedValue) + "')</script>");

but once the message displays the message is blank.

I already know how to insert data into a database with linq i just need to know how can i access the actual ComboBox Objects and the selected values so i can insert the data into the database.

thanx

Shinu
Top achievements
Rank 2
 answered on 16 Apr 2013
2 answers
130 views
Hello and Thank you for your help in advance,

I am facing an issue where I have two rad windows, and each rad window contains a radcombobox.
These rad windows are opened on the client and are basically just two small forms.
There are submit buttons in each rad window which provide a post back and a stored procedure call.
The problem I am seeing is that it takes a page refresh from browser two these the results in either radcombobox - even though I have autopostback (they are set as default) set to true on both submit buttons.  Each stored procedure affects the other combo box data.
The rad windows are on the same page - and not on different pages.  I would like to keep it this way - is there any way that this result could be achieved?
Peter Filipov
Telerik team
 answered on 16 Apr 2013
1 answer
455 views
Hello,

I've the following code to bind:

var lstEmployees = employeeRepository.All.Select(employee => new { employee.Id, employee.Name });

txtEmployee.DataSource = lstEmployees.ToList();

txtEmployee.DataTextField = "Name";

txtEmployee.DataValueField = "Id";

txtEmployee.DataBind();

This code is called in the Page_Load() event inside the

if (!IsPostBack) block.

This triggers the error "The Control DataSource or (DataSourceID) is not set" when I start typing into it.
What I noticed is, when I move the binding code outside the if (!IsPostBack) block, it works correctly.

 

 

 

 

 

 

 

 

 

 

 

Princy
Top achievements
Rank 2
 answered on 16 Apr 2013
0 answers
89 views
Hi,

http://demos.telerik.com/aspnet-ajax/grid/examples/client/insertupdatedelete/defaultvb.aspx?#qsf-demo-source

I did the same thing, but the application does not work. I received the error: Microsoft JScript runtime error: 'MyWebServices' is undefined. I would ask for your help.
Thanks.
Tugba
Top achievements
Rank 1
 asked on 16 Apr 2013
6 answers
246 views
Hi,

we are using SignalR v 1.xx. And sometimes some errors bubble up in connection to Radcompression .

There are others with the same problem:
https://github.com/SignalR/SignalR/issues/1535

Fehlermeldung und Stack-Trace

Fehlermeldung: Microsoft.Owin.Host.SystemWeb: One or more errors occurred.

Stack-Trace: Server stack trace: Exception rethrown at [0]: bei Microsoft.Owin.Host.SystemWeb.Utils.<>c__DisplayClass1.

Is this a known problem?

Best 

Nils
Radoslav
Telerik team
 answered on 16 Apr 2013
1 answer
111 views
Hello,
 We want to implement the "Your Bookmarks" feature that happens when you click the Logged In User Icon.  Is that a RadControl of some sort?  Where is it located?

Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?