Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
269 views
I am currently using a grid with a template column on the main level and a detail table with 1 template column and 2 databound columns.

In the main level of the grid, I did 'Eval("Item")'. I tried to do the same in the detail table but it won't appear. If I put the literal "Text" instead of Eval it appears. If I put both nothing shows. I doubled checked to make sure my data was valid and it is.

Is this an issue with the grid? my setup? do I need to use a different form of Eval in my template column?

I am stumped at the moment to what I should do. Any ideas or help is appreciated.
Karl
Top achievements
Rank 1
 answered on 11 Aug 2008
5 answers
187 views
Hi ,

I'm using xmldatasource along with Radmenu control to create a navigation structure.

I've added an explicit entry for the xmlDataSource control in the web config file as follows:

<SafeControl Assembly="System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Namespace="System.Web.UI.WebControls" TypeName="XmlDataSource" Safe="true" AllowRemoteDesigner="true" /> 


But when rendered it throws error saying that XmlDatasource isallowed on the page. The type is not registered as safe.

Please provide solution to this or any pointer.

Thanks in advance!!!
jaswinder
  
Bob
Top achievements
Rank 1
 answered on 11 Aug 2008
2 answers
156 views

Can you recommend a straightforward way or tell me how to fix the workaround?

I want an ObjectDataSource to have a parameter linked to the value of a CheckBox ("chkShowInactivesInGrid") that is inside a CommandItemTemplate.
Is there any way for the ObjectDataSource to refer to this CheckBox? (I get "not found" error.)

As a workaround I use for the parameter a CheckBox "chkShowInactive" that is on the web page, NOT inside a CommandItemTemplate.

<SelectParameters>
     <asp:ControlParameter Name="DisplayInactive" ControlID="chkShowInactive" PropertyName="Checked" />
....

<CommandItemTemplate>
      <div style="padding: 10px 0px;">
       <asp:CheckBox ID="chkShowInactivesInGrid" Text="Show Inactive" runat="server" />
      </div>
 </CommandItemTemplate>

In this workaround I hope to have the CheckBox inside CommandItemTemplate ("chkShowInactivesInGrid" ) mirror the value of the other checkbox.

I can set the value of "chkShowInactivesInGrid" using the following, BUT this event fires ONLY when the page (actually the user control) is first displayed.
When the page containing the user control is refreshed, the  chkShowInactive may have a new value but this value is not transferred to chkShowInactivesInGrid because
the following event is not fired.

        protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            PopulateOnPrerender = false;
          
            if (e.Item is GridCommandItem)
            {
                GridCommandItem cmditm = (GridCommandItem)e.Item;
                CheckBox cb = (CheckBox)cmditm.FindControl("chkShowInactivesInGrid");
                cb.Checked = chkShowInactive.Checked;
            } 
        }

John Davis
Top achievements
Rank 2
 answered on 11 Aug 2008
1 answer
114 views
Hi Friends,
    Can anyone help to build RadTreeView for the values in the DataTable
    ex:- i have my table values like this
    
menuid       parentid     value     
------------ ------------ ----------
1            0            Parent
2            1            Child1
3            1            Child2
4            1            Child3
5            2            Child1-1
6            2            child1-2
7            2            child1-3
8            3            child2-1
9            3            child2-2
10           5            Child1-1-1

Thanks
Kiran
Yana
Telerik team
 answered on 11 Aug 2008
2 answers
134 views
I need to set the style of RadNumericTextBox and RadMaskedTextBox controls on my form.  When I load the page I go through all of the controls and set the styles based on the type of control.  This is in my Page_Load method.  It works fine for all standard asp.net controls, but I can't get it to do anything to the styles for the Telerik controls.  I've tried using the onblur and onfocus events.  Then I tried using the ClientEvents-OnBlur and OnFocus (setting "this.className='bla'", for example) but that didn't work either.  So then I tried setting the FocusedStyle.BorderWidth and BorderColor, but that had no affect on the controls either.  I can step through in debug and see that these properties ARE set, but the controls don't change at all on focus...  Here's the code I'm using to do this:
foreach (Control ctl in pnlMain.Controls)  
{  
    if(ctl.GetType() == typeof(TextBox))  
    {  
        ((WebControl)ctl).Attributes.Add("onfocus""this.className='textBoxActive'");  
        ((WebControl)ctl).Attributes.Add("onblur""this.className='textBox'");  
    }  
    else if(ctl.GetType() == typeof(RadNumericTextBox))  
    {  
        ((RadNumericTextBox)ctl).FocusedStyle.BorderWidth = 2;  
        ((RadNumericTextBox) ctl).FocusedStyle.BorderColor = Color.DarkSlateBlue;  
    }  
    else if(ctl.GetType() == typeof(RadMaskedTextBox))  
    {  
        ((RadMaskedTextBox)ctl).FocusedStyle.BorderWidth = 2;  
        ((RadMaskedTextBox)ctl).FocusedStyle.BorderColor = Color.DarkSlateBlue;  
    }  
}

What is the trick with this and why is it SO HARD to get this to work?  Seems like an incredibly simple to want to do, but it took me 5 minutes to do it with the asp.net controls and I've spent 2 hours on this with the Telerik controls and still can't get it working...  Frustrating.

Any help?  Thanks!!
Eddie
Princy
Top achievements
Rank 2
 answered on 11 Aug 2008
1 answer
123 views
Hello, I need to enable users to persist their personal layout of docks to a database. On page load I need to be able to retrieve the dock state for the particular user. Are there any examples of this already?

I have had a good look through the forum and found various code/db samples on here, but none seem to relate a particular userID to a particular dock layout state.

I found PortalSiteVB.zip here:
http://www.telerik.com/community/forums/thread/b311D-mkttd.aspx

But the tables in the database supplied (Pages, PageWidget and Widgets) do not have a UserID column - so the persisted state is surely not related to a particular user?

I suspect that the MyPortal sample may help me, I found it here:
http://www.telerik.com/community/forums/thread/b311D-maehh.aspx

However the database in the first sample is a standard aspnet membership database that is created by regsql.exe (I think the developer attached this by accident?) and the second download 'MyPortalDB.zip' does not open, sql management studio will not attach it due to an error and the ldf file is missing (which may be the cause).


Sophy
Telerik team
 answered on 11 Aug 2008
8 answers
339 views
I'm using VS 2008 , .NET 3.5.  I have a grid that is pulling data from one of my SQL database tables.  I create a datatable, populate it, then use the grid's datasource for this datatable.  This works just fine. 
I have another SQL table that holds an image (along with other info) that relates/links to my first table.  I want to have this second table information in the grid's detail table.  So for each entry, the table will expand and show the 2 entries from the second table that relates to the one entry in the first table.  Here's my code so far:

  Dim dt As Data.DataTable  
        dt = dbobj.CreateDT(strsql, JobMastModel.DBClasses.DBTools.DB.DW)  
        RadGrid1.DataSource = dt  
        RadGrid1.DataBind()  
        dbobj.DBConnMain.JMConnection.Close()  
 
        'Detail table (has files)  
        Dim dtFiles As Data.DataTable  
        Dim files As Telerik.Web.UI.GridTableView = New Telerik.Web.UI.GridTableView  
        Dim strFile As String 
        strFile = "SELECT * from tblDGdrawings WHERE dg_id = '" & dt.Rows(0).Item("id") & "'" 
        dtFiles = dbobj.CreateDT(strFile, JobMastModel.DBClasses.DBTools.DB.DW)  
        
        files.DataSource = dtFiles  
        RadGrid1.MasterTableView.DetailTables.Add(files) 


The grid shows the expand button, but nothing happens when I try clicking on it.  What else do I need to add?  The grid shows the expand button, but nothing happens when I try clicking on it.  What else do I need to add?
Another problem is that on line 11 I'm grabbing the files from the second table WHERE the id equals only the one number.  How do I write that SQL statement so it would relate to each individual entry in the first grid/table? Also, in the detail tables, I want the user to be able to click the row and it'll give me the option to open the file that's in the database.
 Please let me know if you need any other informaiton.

Oh, here's a simplified version of my table structures
Table 1(tblDGinfo) - id, drawing_number, school_name, dealer, lab_type, etc.
Table2(tblDGdrawings) - id, dg_id, attachment(image), type, length, etc.
tblDGinfo.id relates to tblDGdrawings.dg_id
Bruno
Top achievements
Rank 2
 answered on 11 Aug 2008
1 answer
136 views
I've got  an ajaxified master page that loads web user controls in the "body" panel when click events occur.  One web user control has a checkbox list that displays and filters a repeater item template.  In the item template I have hyperlinks that I want to open  windows that display editable data according to an ID value:

<href="#" onclick="openRadWindow('<%# Eval("EntryId") %>'); return false;">Details</a> 

The javascript used is:

<script type="text/javascript">  
 function OpenPositionedWindow(oButton, url, windowName)  
 {  
   var oWnd = window.radopen(url,windowName);    
 }  
 function openRadWindow(EntryId)  
 {  
    var oWnd = radopen("Questions.aspx?ID=" + EntryId, "RadWindow1" );  
    oWnd.Center();  
 }  
            
</script> 

There is a RadWindowsManager instance with no windows listed.  This example is from Telerik RadGrid archive and I was hoping it would wok for my repeater.  Object Expected error occurs when the "Details" link is clicked.
Any ideas are appreciated.
Veselin Vasilev
Telerik team
 answered on 11 Aug 2008
1 answer
99 views

I have a large rad tree view that is fully expanded with checkboxes enabled.

The problem I have is that this type of UI makes it hard for users to see which items are checked. The checkbox is small and the text does not show as being selected so the user has to scan each item to see if it is checked.

So I want to hightlight the checked nodes.

There appears to be a difference between the Server + Client setting of the CSS for nodes. On page load I set the css class by ServerSide and then when the user checks or unchecks on the client side I set it using client side events.

Server Side
RadTreeNode node = RadTreeView1.FindNodeByValue(ID);
node.CssClass = "RadNodeSelected";

Client Side
var node = eventArgs.get_node();
node.set_cssClass("RadNodeSelected");

If you make the cssClass "RadNodeSelected" have something like the following you really see the issue I have.

.RadNodeSelected
{
 font-weight: bold;
 color: Purple;
 border : Red dotted 5px;
}

This is what is rendered from the server side - as you can see the setting of the cssClass only applies to the SPAN for the text of the node.

<DIV class=rtTop><SPAN class=rtSp></SPAN><SPAN class=rtMinus></SPAN><INPUT
class=rtChk type=checkbox CHECKED><SPAN
class="rtIn RadNodeSelected">Trimble</SPAN> </DIV>

and when using the client side to set the CSS it applies to the DIV tag of the node and not the SPAN for the text.

node.set_cssClass("RadNodeSelected");

<DIV class="rtTop rtSelected RadNodeSelected"><SPAN class=rtSp></SPAN><SPAN
class=rtMinus></SPAN><INPUT class=rtChk type=checkbox CHECKED><SPAN
class="rtIn RadNodeSelected">Trimble</SPAN> </DIV>

and client side to remove the CSS

node.set_cssClass(null);

<DIV class="rtTop rtSelected"><SPAN class=rtSp></SPAN><SPAN
class=rtMinus></SPAN><INPUT class=rtChk type=checkbox><SPAN
class="rtIn RadNodeSelected">Trimble</SPAN> </DIV>

I am using RadControls for ASPNET AJAX Q1 2008 and I just noticed a new update for Q2 so I will pull that down and see if it has the same problem.

Am I just using the wrong methods to do what I want or is this a bug?

Chris

 

Simon
Telerik team
 answered on 11 Aug 2008
3 answers
110 views
Hi there, I have a RadGrid with editcommand column.

If the user clicks the edit icon, then clicks it again before the grid row has changed to edit mode, the RadAjaxLoadingPanel we are using will not disappear, and you have to reload the whole page to get rid of it.

Is there anything you can think I have done which may have caused this? Or how can I ensure the panel disappears?
Yavor
Telerik team
 answered on 11 Aug 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?