Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
191 views
Hello!!

This will be my first post hoping to get the answer as soon as possible...

With regards to the Subject, is there a way to Bind the Object Properties declaratively to the DetailTable of the Grid.

Lets assume this is my Object Structure

Class Person
         Property PersonName As String
         Property Hobbies As List(Of Hobby)
         Property Nationality As String
End Class

Class Hobby
         Property ID As Integer
         Property Description as String
End Class

And this is my Grid Structure

<telerik:RadGrid ID="myGrid" runat="server">
    <MasterTableView>
            <Columns>
                        <telerik:GridBoundColumn DataField="PersonName " />
                        <telerik:GridBoundColumn DataField="Nationality " />
            </Columns>
            <DetailTables>
                        <telerik:GridTableView Name="HobbyList">
                                    <Columns>
                                                            <telerik:GridBoundColumn DataField="Description" />
                                    </Columns>
                        </telerik:GridTableView>
            </DetailTables>
    </MasterTableView>
</telerik:RadGrid>

My Problem is that I want bind the whole Person object to the Grid and to the DetailTables. When I retrieve the Person object, I will the whole Person object, including all the properties [Hobbies].

Although I have an alternate solution to this, and that is to handle the DetailDataBind event and bind the Property to the Detail manually using CodeBehind.

Is there a way to do it declaratively? My purpose for this is to automate things and reduce the Codes behind.

Thank You..
AUE
Top achievements
Rank 1
 answered on 10 Mar 2011
1 answer
171 views
What's the easiest way to set the font sizes for ALL telerik control to a single value? I believe you can control fonts by modifying the CC of a specific control, but that's a pain because I am using many different control types...

Thx
Shinu
Top achievements
Rank 2
 answered on 10 Mar 2011
1 answer
449 views
I need to create a link in my grid that takes the user to an update form, the form is HUGE so I don't want to use the in-grid edit mode. So I want to do a Template column with something like this

<a href="updateform.aspx?id='<%# bind("id")%>"><%# bind("Name")%></a>

I am getting errors using the bind statement though.

Thanks!
Shinu
Top achievements
Rank 2
 answered on 10 Mar 2011
1 answer
183 views
Hi,

I am trying to set text to radcombobox in radgrid itemtemplate. I am getting an error "object reference not set to an instance of object" at

Box1.Text = Box2.SelectedValue;


ASPX:

<

 

telerik:GridTemplateColumn HeaderText = "Print Letters/Post Cards" UniqueName = "PrintLetter" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">

 

 

<ItemTemplate>

 

 

<telerik:RadComboBox ID= "Print" runat="server">

 

 

<Items>

 

 

<telerik:RadComboBoxItem runat="server" Text=""/>

 

 

<telerik:RadComboBoxItem runat="server" Text="1 Year Postcard"/>

 

 

<telerik:RadComboBoxItem runat="server" Text="1 Year Adult"/>

 

 

<telerik:RadComboBoxItem runat="server" Text="2 Years Adult"/>

 

 

<telerik:RadComboBoxItem runat="server" Text="3 Year"/>

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

</ItemTemplate>

 

 

<EditItemTemplate>

 

 

<telerik:RadComboBox ID= "PrintEdit" runat="server">

 

 

<Items>

 

 

<telerik:RadComboBoxItem runat="server" Text="1 Year Postcard"/>

 

 

<telerik:RadComboBoxItem runat="server" Text="1 Year Adult"/>

 

 

<telerik:RadComboBoxItem runat="server" Text="2 Years Adult"/>

 

 

<telerik:RadComboBoxItem runat="server" Text="3 Year"/>

 

 

</Items>

 

 

</telerik:RadComboBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 


ASPX.CS:

protected

 

void EditGrid(object sender, GridCommandEventArgs e)

 

 

{


GridEditableItem

 

dataItem = e.Item as GridEditableItem;

 


RadComboBox

 

Box1 = e.Item.FindControl("Print") as RadComboBox;

 

RadComboBox

 

Box2 = (RadComboBox)dataItem["PrintLetter"].FindControl("PrintEdit");

 

Box1.Text = Box2.SelectedValue;


}
Princy
Top achievements
Rank 2
 answered on 10 Mar 2011
1 answer
136 views
I had hoped to use some raddocks on my pages w/o any dragging or any dock zones.

I simply wanted to make use of the container UI and the ability to add commands to the title bar easily.

But I am finding that the raddocks all float up to the top as far as they can.  In fact, if I put 2 in the same div an separate them by a few <BR>s the simply display on top of one another.

Is there any way around this?  Or is this not possible to use them in this manner?

EDIT: of course as soon as I post I find a work around.

I can just wrap my raddocks in raddockzones, and I don't have to enable dragging and it seems to do what I want.
Sean
Top achievements
Rank 2
 answered on 10 Mar 2011
1 answer
113 views
Hi Telerik,

I have reviewed the example on how to remove a dynamically created splitbar here. I am trying to remove a RadPane and RadSplitBar from a RadSplitter on collapse.

First, during the OnClientCollapsed event I make an ajaxRequest to force a postback on the page. Then, during SaveDockLayout I perform validation on my controls and remove those controls which need to be removed. 

RadSplitter splitter = splitBarToRemove.Splitter;
splitter.Items.Remove(splitBarToRemove);
RadControlStates.SplitbarStates.Remove(splitBarToRemove.ID);

I do this inside of SaveDockLayout -- which causes an exception to be thrown later on. Presumably, this exception is being caused by the fact that I am modifying the view state (?) during a period in which it should not be modified.

By using the line "splitter.Items.Remove(splitBarToRemove)" I get the message
else{var g=this.getSplitBarByIndex(0);
var e=g.get_element();
 
Uncaught TypeError: Cannot call method 'get_element' of null
off over in a Telerik.Web.UI.WebResource -- the one for the RadSplitter, presumably. Anyway, I remove the code that brings the dynamically created SplitBar back -- so I'm not adding a new SplitBar to the RadSplitter. I've tried just disabling the control. The code doesn't know that the RadSplitBar should be removed until after the ajaxRequest has finished processing as SaveDockLayout needs to fire and an AjaxRequest is necessary to make the postback happen. Any thoughts?
Sean
Top achievements
Rank 2
 answered on 10 Mar 2011
0 answers
128 views
In EnableLoadOnDemand mode, there are some instances where the control fails to perform the dropdown refresh callback. This causes the posted data to be unpredictable when compared to what the user sees or things he has posted.

To reproduce the problem (must be done exactly in this order):
    - type something that pulls up some list items
    - select item from list
    - click on textbox (all text should now be selected)
    - press <End> then <BackSpace>; alternatively selecting a text subset with <Shift-Arrows> and then <Del>; or even <Ctrl-A> and the <Del> 

In all these instances the callback does not occur as it should. 
The problems resulting from this bug are different depending if the MarkFirstMatch is True.

If True, the selected item ID is cleared but the returned Text is different than what is shown.
If False, the ID and Text from a previous callback (before the one that was missed) are returned which is expecialy bad when you have just cleared the dropdown and one is under the impression that nothing is selected.

I think fixing the missed callbacks will fix all these issues.
Bort
Top achievements
Rank 1
 asked on 09 Mar 2011
1 answer
188 views
I am using the combobox in EnableLoadOnDemand mode. The data in the drop down has three collums (ID, Name, Address). I set my default selected item like this:
 
Me.RadComboBox.SelectedValue = "9238"
Me.RadComboBox.Text = "Smith, Jones"

I happen to have 3 "Smith, Jones"  in my database each with different IDs. When I click on the drop down, the control is smart enough to get the 3 smiths matching the text in the dropdown but the selected item in the list is always the first one. The item with the 9238 ID happens to be the third item in the list so the default selection is invalid pointing to the wrong customer confusion my users. Is there a way to get the selected item in the drop down list to match the ID that I have set as the default starting value? It seems to me this should be a default behavior.
Bort
Top achievements
Rank 1
 answered on 09 Mar 2011
1 answer
144 views
Hi,

I have export some data from Telerik Grid to Excel, it's working fine(data are available in excel sheet) but when i open the excel i got an error (Please see). while trying to import the same excel sheet i got an error (External table is not in the expected format.)

Note: The other excel sheet (Not exported from telerik) is working fine while importing

Advance Thanks & Regards,
Bala
Daniel
Telerik team
 answered on 09 Mar 2011
1 answer
122 views
Hello there

I am unable to render the tagcloud in a repeater; it generates the following exception:

Exception type: NullReferenceException

Exception message: Object reference not set to an instance of an object.

at Telerik.Web.UI.RadTagCloud.BindToEnumerableData

I have added some code below to replicate. In this example I have bound the repeater to a simple list.



<%@ Page Language="VB" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<script runat="server">
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
  
        If Not IsPostBack Then
              
            Dim oDatasource As New List(Of String)
            oDatasource.Add("Item 1")
            oDatasource.Add("Item 2")
            oDatasource.Add("Item 3")
            oDatasource.Add("Item 4")
          
            rp.DataSource = oDatasource
            rp.DataBind()
  
        End If
    End Sub
      
</script>
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Repeater ID="rp" runat="server">
            <ItemTemplate>
                <telerik:RadTagCloud ID="RadTagCloud1" runat="server" Width="400px">
                    <Items>
                        <telerik:RadTagCloudItem Text="ASP.NET" Weight="12" />
                        <telerik:RadTagCloudItem Text="AJAX" Weight="134" />
                    </Items>
                </telerik:RadTagCloud>
            </ItemTemplate>
        </asp:Repeater>
    </div>
    </form>
</body>
</html>
Pero
Telerik team
 answered on 09 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?