Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
155 views
I have the  Person class with the following fields which reflects the table structure.
field               datatype
Id                   long
Name             string
Title               string
Supervisor     long


I want to build a self referencing grid. I keep getting the following error

System.Data.SyntaxErrorException: Syntax error in Lookup expression: Expecting keyword 'Supervisor' followed by a single column argument with possible relation qualifier: Supervisor[(<relation_name>)].<column_name>.


I have tried the various combinations of filterexpression in the Page_load event but none seem to work.

 RadGrid1.MasterTableView.FilterExpression = "Supervisor = 0";
 RadGrid1.MasterTableView.FilterExpression = "it.Supervisor = 0";

I am populating ICollection<Person> and setting it to the RadGrid1 datasource property.

I am not sure what is causing this error. I have looked through the forums but havent found any help in this matter.

Thanks

Truong Pham
Top achievements
Rank 1
 answered on 10 Mar 2010
2 answers
152 views
I need to apply filtering for a column in my RadGrid.  The column is an int column, and the user must be able to filter multiple selections.  I want to do something like this:  select * from <table> where num in (X,Y,Z).

How can I get this filtering functionality?


EDIT:
I followed an example on http://www.telerik.com/help/aspnet-ajax/grdcustomoptionforfiltering.html to add custom filtering, and this is what I came up with.

 
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == RadGrid.FilterCommandName) 
        { 
            Pair filterPair = (Pair)e.CommandArgument; 
 
            switch (filterPair.Second.ToString()) 
            {                
                case "vendNum": 
                    TextBox tbPattern = (e.Item as GridFilteringItem)["vendNum"].Controls[0] as TextBox; 
                    if (tbPattern.Text.Contains(",")) 
                    { 
                        string[] values = tbPattern.Text.Split(','); 
                        if (values.Length >= 2) 
                        { 
                            e.Canceled = true; 
                            StringBuilder newFilter = new StringBuilder(); 
                            for (int i = 0; i < values.Length; i++) 
                            { 
                                if (i == values.Length - 1) 
                                    newFilter.Append("([vendNum]='" + values[i] + "')" ); 
                                else 
                                    newFilter.Append("([vendNum]='" + values[i] + "') OR "); 
                            } 
                            if (RadGrid1.MasterTableView.FilterExpression == "") 
                                RadGrid1.MasterTableView.FilterExpression = newFilter.ToString(); 
                            else 
                                RadGrid1.MasterTableView.FilterExpression = "((" + RadGrid1.MasterTableView.FilterExpression + ") AND (" + newFilter.ToString() + "))"; 
                            RadGrid1.Rebind(); 
                        } 
                    } 
                    break; 
                default: 
                    break; 
            } 
        } 
    } 

This is giving me an "Expression Expected" error when I try to filter that column.  Anyone have an idea as to why that is?

Thanks,
Aaron
Aaron Gravois
Top achievements
Rank 1
 answered on 10 Mar 2010
1 answer
39 views
Hello All,

I have a fix situation here, i am loading one aspx page into another take example i am loading default2.apsx in default1.aspx using basic ajax xmlhttp request . thats working, but when i am using my rad controls in default2.aspx  , they do not work in default1.aspx what should be done? new to telerik totally so need a claer concept in solving this .


Thank you All
Varsha
Pero
Telerik team
 answered on 10 Mar 2010
3 answers
163 views
Hi

How to do this with Rad Text Box:

1- Prevent Data duplication when insert a new record (something like user name) , so say if the user entered a user name which is already exist then he ll get an error message (i know i can do that back in the database by making the column unique but then on the client side the sql error message will appear which will look ugly.

2- is there any option to make all the inputs UPPER CASE regardless the user inputs.

Thanks
Dimo
Telerik team
 answered on 10 Mar 2010
1 answer
117 views
My company has a host of custom widgets that we would like to expose to our our clients to the RadEditor control.  In order to accomplish this, we would like to have a tag like:

<c:CustomPanel Title="Title on Widget" Content="Widget Content" />

When rendered in design view, we would like to prevent the user from typing into certain places.  ie:

<Table>
<Tr>
<Td class="leftSideTitle"></td>
<td>Title on Widget</td>
<td class="rightSideTitle"></td>
</tr>
<Tr>
<td class="leftSide"></td>
<td>Widget Content</td>
<td class="rightSide"></td>
</tr>


In this example, we would like to prevent the user from typing into those left and right cells and remove the dashed lines around them.

Is there some built in functionality that would help us to accomplish this ?

Thank you very much.

-D
Rumen
Telerik team
 answered on 10 Mar 2010
1 answer
94 views
I am using LoadOnDemand to populate TreeView nodes from a webservice.

When a node calls for it, the webservice queries a database and produces xml of its child nodes that looks like the xml at the botom of this message.  If I was to call the TreeView's LoadFromXml method this would populate the entire treeview but thats not what I have to do. I need to add these items to the single node that requested them.

How can I do this?

Thanks for your help





<Tree>
  <Node Text="PART 5C - HERITAGE" Value="Part 5.xml">
    <Node Text="PART 5C - HERITAGE" Value="">
      <Node Text="5C.1 CONTENT AND STRUCTURE" Value="d1e12" />
      <Node Text="5C.2 RESOURCE MANAGEMENT ISSUES" Value="d1e104">
        <Node Text="5C.2.1 NATURAL RESOURCES" Value="d1e128" />
        <Node Text="5C.2.2 CULTURAL RESOURCES" Value="d1e190" />
        <Node Text="5C.2.3 SCIENTIFIC RESOURCES" Value="d1e218" />
      </Node>
      <Node Text="5C.3 RESOURCE MANAGEMENT OBJECTIVES AND POLICIES" Value="d1e234">
        <Node Text="5C.3.1 OBJECTIVE" Value="d1e239" />
      </Node>
      <Node Text="5C.4 RESOURCE MANAGEMENT STRATEGY" Value="d1e282">
        <Node Text="5C.4.1 NATURAL RESOURCES" Value="d1e293" />
        <Node Text="5C.4.2 CULTURAL RESOURCES" Value="d1e511" />
        <Node Text="5C.4.3 SCIENTIFIC RESOURCES" Value="d1e591" />
      </Node>
      <Node Text="5C.5 IMPLEMENTATION" Value="d1e605" />
      <Node Text="5C.6 INTERPRETATION AND DEFINITIONS" Value="d1e737" />
      <Node Text="5C.7 HERITAGE ITEMS" Value="d1e928">
        <Node Text="5C.7.1 BUILDINGS, OBJECTS, HERITAGE PROPERTIES AND PLACES OF SPECIAL VALUE" Value="d1e984">
          <Node Text="5C.7.1.1 OBJECTIVE" Value="d1e992" />
          <Node Text="5C.7.1.2 STRATEGY" Value="d1e1024" />
          <Node Text="5C.7.1.3 RULES : BUILDINGS, OBJECT, HERITAGE PROPERTIES OR PLACES OF SPECIAL VALUE" Value="d1e1278" />
        </Node>
        <Node Text="5C.7.2 CONSERVATION AREAS" Value="d1e1554">
          <Node Text="5C.7.2.1 OBJECTIVE" Value="d1e1562" />
          <Node Text="5C.7.2.2 STRATEGY" Value="d1e1588" />
          <Node Text="5C.7.2.3 RULES : CONSERVATION AREAS" Value="d1e1776" />
        </Node>
        <Node Text="5C.7.3 TREES" Value="d1e1990">
          <Node Text="5C.7.3.1 OBJECTIVE" Value="d1e1998" />
          <Node Text="5C.7.3.2 STRATEGY" Value="d1e2033" />
          <Node Text="5C.7.3.3 RULES : TREES" Value="d1e2250" />
        </Node>
        <Node Text="5C.7.4 ARCHAEOLOGICAL FEATURES" Value="d1e2790">
          <Node Text="5C.7.4.1 OBJECTIVE" Value="d1e2798" />
          <Node Text="5C.7.4.2 STRATEGY" Value="d1e2824" />
          <Node Text="5C.7.4.3 RULES : ARCHAEOLOGICAL FEATURES" Value="d1e2924" />
        </Node>
        <Node Text="5C.7.4A GEOLOGICAL FEATURES" Value="d1e3003">
          <Node Text="5C.7.4A.1 OBJECTIVE" Value="d1e3011" />
          <Node Text="5C.7.4A.2 STRATEGY" Value="d1e3037" />
          <Node Text="5C.7.4A.3 RULES : GEOLOGICAL FEATURES" Value="d1e3135" />
        </Node>
        <Node Text="5C.7.5 MAORI HERITAGE SITES" Value="d1e3212">
          <Node Text="5C.7.5.1 OBJECTIVE" Value="d1e3220" />
          <Node Text="5C.7.5.2 STRATEGY" Value="d1e3242" />
          <Node Text="5C.7.5.3 RULES : MAORI HERITAGE SITES" Value="d1e3279" />
        </Node>
        <Node Text="5C.7.6 VIEWS" Value="d1e3328">
          <Node Text="5C.7.6.1 GENERAL OBJECTIVE" Value="d1e3336" />
          <Node Text="5C.7.6.2 GENERAL STRATEGY" Value="d1e3358" />
          <Node Text="5C.7.6.3 OBJECTIVES" Value="d1e3422" />
          <Node Text="5C.7.6.4 STRATEGY" Value="d1e3463" />
          <Node Text="5C.7.6.5 RULES : VOLCANIC CONES" Value="d1e3478" />
          <Node Text="5C.7.6.6 OBJECTIVE" Value="d1e3557" />
          <Node Text="5C.7.6.7 STRATEGY" Value="d1e3581" />
          <Node Text="5C.7.6.8 RULES : AUCKLAND WAR MEMORIAL MUSEUM" Value="d1e3602" />
          <Node Text="5C.7.6.9 OBJECTIVE" Value="d1e3642" />
          <Node Text="5C.7.6.10 STRATEGY" Value="d1e3665" />
          <Node Text="5C.7.6.11 RULES : NEWMARKET VIADUCT" Value="d1e3677" />
          <Node Text="5C.7.6.12 OBJECTIVE" Value="d1e3708" />
          <Node Text="5C.7.6.13 STRATEGY" Value="d1e3731" />
          <Node Text="5C.7.6.14 RULES : ONEHUNGA MOTORWAY" Value="d1e3742" />
          <Node Text="5C.7.6.15 OBJECTIVE" Value="d1e3772" />
          <Node Text="5C.7.6.16 STRATEGY" Value="d1e3798" />
          <Node Text="5C.7.6.17 RULES : DILWORTH TERRACE HOUSES" Value="d1e3810" />
          <Node Text="5C.7.6.18 OBJECTIVE" Value="d1e3839" />
          <Node Text="5C7.6.19 STRATEGY" Value="d1e3860" />
          <Node Text="5C.7.6.20 RULES : PANMURE VIEWS" Value="d1e3877" />
        </Node>
        <Node Text="5C.7.7 SCENIC WAY" Value="d1e3918">
          <Node Text="5C.7.7.1 OBJECTIVE" Value="d1e3926" />
          <Node Text="5C.7.7.2 STRATEGY" Value="d1e4020" />
          <Node Text="5C.7.7.3 RULES: SCENIC WAY" Value="d1e4180" />
        </Node>
        <Node Text="5C.7.8 SUNLIGHT ADMISSION TO PUBLIC PLACES" Value="d1e4196">
          <Node Text="5C.7.8.1 OBJECTIVE" Value="d1e4204" />
          <Node Text="5C.7.8.2 STRATEGY" Value="d1e4229" />
          <Node Text="5C.7.8.3 RULES : SUNLIGHT ADMISSION" Value="d1e4246" />
        </Node>
        <Node Text="[5C.7.9 SIGNIFICANT ECOLOGICAL AREAS 88" Value="d1e4267">
          <Node Text="5C.7.9.1 OBJECTIVE" Value="d1e4279" />
          <Node Text="5C.7.9.2 STRATEGY" Value="d1e4305" />
          <Node Text="5C.7.9.3 RULES: SIGNIFICANT ECOLOGICAL AREAS" Value="d1e4425" />
        </Node>
        <Node Text="[5C.7.10 CHARACTER OVERLAY 132" Value="d1e4728">
          <Node Text="5C.7.10.1 OBJECTIVES AND POLICIES" Value="d1e4739" />
          <Node Text="5C.7.10.2 STRATEGY" Value="d1e4808" />
          <Node Text="5C.7.10.3 RULES: CHARACTER OVERLAY AREAS" Value="d1e4981" />
        </Node>
      </Node>
    </Node>
  </Node>
</Tree>


Dimitar Milushev
Telerik team
 answered on 10 Mar 2010
4 answers
119 views
We have this extra dead space on firefox broser. Attached screen explain the same.

Please suggest a solution.

Thanks,
Shubod

Rumen
Telerik team
 answered on 10 Mar 2010
1 answer
95 views
I've noticed that when you create your own custom ContextMenu commands for the Editor and set ShowIcon="false" that the text is not aligned correctly. The text is shown over the "dark-gray" section reserved for images.

I've attached an image that shows what I'm talking about.
Dobromir
Telerik team
 answered on 10 Mar 2010
3 answers
1.2K+ views
Hello All,

re: Telerik.Web.UI 2009.3.1103.35 and the radGrid

I am using the radgrid and would like to set the default value of a few text controls and dropdownlists for the user when they click Add New Record.

I see lots of complex examples when I search, but all I want to do is just set an initial value to zero, and the user can change it if they wish.  How can I do this?

As far as I can see, the insert event happens when the user clicks update, so I guess I need to set the value prior to the form loading?  Can anyone assist in a) the event I need and b) a few lines of the code required

Thanks in advance for your assistance,

PS As usual I have a demo tomorrow and am trying to get this going today!

Mark


Mark Breen
Top achievements
Rank 1
 answered on 10 Mar 2010
3 answers
303 views
I am trying to understand what is happening and I need a lifecycle explanation. 

I have an RadAjaxPanel where on page load, I dynamically creat and populate three comboboxes.  Combobox 1 drives the data in combobox 2 and combobox 3.  I have set the autopostback to true on these controls.  Combobox 1 defaults to Item A, Combobox 2 defaults to Item M, Combobox 3 defaults to Item X.

If I change Combobox 1 to Item B, this change is not see during the page load event because the control is being created.  Therefore, combobox 2 and combobox 3 are filled with the items that correspond to Item A in combobox 1.  Since "viewstate" has not been applied at this time, the combobox 1 thinks its value is Item A.

During the SelectedItem event, the viewstate has loaded and the combobox now has item B.  I assume that at this point I can clear out and re-load combobox 2 and 3 to have their data on the page updated.

Just for fun, I decided to fill combobox 2 with different data on the page load event if the page was in a postback.  Imagine my surprise when the combobox 2 showed the original data that was loaded the first time in the page and not the "New" data I forced in during the postback.  Why is this?  Is the viewstate holding all of the valid data items for this control and resetting it after the page load event?




Iana Tsolova
Telerik team
 answered on 10 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?