Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
312 views

The code below is not working for some reason. The intent is if a user clicks the main menu check the value in the cb dropdown and hide/show a menu item. But the menu item is not hiding and displaying like I expect. Any ideas?

///////////////////////////////////////////////////

<

telerik:RadMenu ID="menuSettings" runat="server" OnClientItemClicking

=MenuItemClicking>

////////////////////////////////////////////////

function MenuItemClicking()

{

debugger;

var cb= $find("<%=cb.ClientID%>");

if (cb._selectedIndex==0)

ItemVisibility(

"ShowHideEmptyBeds",false);

else

 ItemVisibility("ShowHideEmptyBeds",true);

}

function

ItemVisibility(menuText,visibility)

{

var menu = $find("<%= menuSettings.ClientID %>");

var menuItem = menu.findItemByText(menuText);

if(menuItem && (menuItem.get_visible()!=visibility))

{

menuItem.set_visible(visibility);

}

}

T. Tsonev
Telerik team
 answered on 29 Apr 2008
1 answer
133 views
Hi,

We have recently upgraded from 2007.3.1218.20 to 2008.1.415.35 of the RadChart.  In the previous version when a EmptySeriesMessage of a PlotArea was shown it also showed the default Plot Area Border.  In the current version that plot area border just disappears (though it does show up when there is data in the graph).  Is there still a way to do this I am not seeing?

Thank you,

Colin Thompkins
Giuseppe
Telerik team
 answered on 29 Apr 2008
8 answers
817 views
I'm trying to determine weather to show or hide the checkbox in a GridCheckBoxColumn inside the grid's ItemDataBound event.  I thought this would be a simple task.

Inside my ItemDataBound method:

if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = e.Item as GridDataItem;

                if (dataItem["ItemTypeName"].Text.Equals("Sponsorship"))
                {
                    CheckBox cb = (CheckBox)dataItem["column"].Controls[0];
                    //cb.Enabled = false;
                    cb.Visible = false;
                    //cb.Checked = true;
                    lbCancelEntireOrder.Visible = false;
                }
            }

the lbCancelEntireOrder.Visible line works - so I know the problem is not in the ItemDataBound itself.  Am I getting the CheckBox out of the column properly?

Thanks
DJ
Top achievements
Rank 1
 answered on 29 Apr 2008
1 answer
107 views
I have a vb.net page with 2 grids where a user can drag a record from one grid to another. I would like to know how I get access to the value of the cells which have been selected and are being dragged by the user (draggeditems) I would like to take the datakey value from this row and then carry out the relevant database updates needed on the rowdrop event.

I have it all working when values are hard coded I just need to know how to access the dragged row cell values.

Thanks in advance for any assistance.

Yavor
Telerik team
 answered on 29 Apr 2008
6 answers
375 views

I have a usercontrol with the following hierarchy

Parent.master -> CreatePeople.master -> Details.aspx -> Details.ascx

In CreatePeople.master there is a RadWindowManager.

If in Details.ascx I add a button and put code in the OnClientClick event to open a radconfirm window it works fine.

However if I add another button and in its OnClick event use the InjectScript method to run the radconfirm window it fails with a javascript error 'undefined is null or not an object'. If I debug the javascript with firefox the code seems to be having trouble finding the window manager.

I've isolated this in a mini project which just contains the files mentioned. No Ajax managers or anything like that.

Any ideas?

Code Behind:

protected void button1_Click(object sender, EventArgs e)
{
InjectScript.Text =
"<script>confirmSaveDuplicatePerson()</script>";
}

Details.ascx

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function confirmSaveDuplicatePerson()
{
radconfirm('
Are you sure?',confirmSaveCallback,330,100,null,'Duplicate');
}

function confirmSaveCallback(arg)
{
radalert(arg);
}
</script>
</
telerik:RadCodeBlock>
<asp:Label ID="InjectScript" runat="server"></asp:Label>
<
asp:Button ID="button1" runat="server" Text="click me" OnClick="button1_Click" />
<
asp:Button ID="buttonClient" runat="server" Text="Client click" OnClientClick="confirmSaveDuplicatePerson(); return false;" />




 

 

Bobby Davis
Top achievements
Rank 1
 answered on 29 Apr 2008
5 answers
169 views
Hi,

I have a RadGrid which has several columns visible:

Name, Date Added, Comment

When they go into Edit Mode, I dont want Name to be in the form as I need to capture the users logon ID from the HTTPContext and automatically store this in the underlying table rather then the name.

In other words:

In the COMMENTS table I am storing the USER_ID.

In the recordset coming back, I am joining COMMENTS to USERS table to present the Name in the RadGrid.

When they go into Edit Mode....I dont want Name to be editable, because I actually want to capture the users logon ID and pass this in.

I am using an ObjectDataSource and my Insert is failing because a method with a signature which includes a "NAME" parameter cant be found:

In My ObjectDataSource

Public Sub AddComment( _

ByVal DASHBOARD_PAGE_ID As Long, _

ByVal LOGON_ID As String, _

ByVal DATE_ADDED As String, _

ByVal COMMENTARY As String, _

ByVal LIVE As Boolean, _

ByVal PROMOTED As Boolean, _

ByVal RESPONSIBLE_PERSON As String, _

ByVal OUTCOME As String)

' Create Connection

Dim con As New SqlConnection(_conString)

'Create Command

Dim cmdText As String = "SP_CLIN_DASHBOARD_ADD_COMMENT" ' This requires a parameter of DashboardPage_ID

Dim cmd As New SqlCommand(cmdText, con)

cmd.CommandType = CommandType.StoredProcedure

cmd.Parameters.AddWithValue(

"@DASHBOARD_PAGE_ID", DASHBOARD_PAGE_ID)

cmd.Parameters.AddWithValue(

"@LOGON_ID", LOGON_ID)

cmd.Parameters.AddWithValue(

"@DATE_ADDED", DATE_ADDED)

cmd.Parameters.AddWithValue(

"@COMMENTARY", COMMENTARY)

cmd.Parameters.AddWithValue(

"@LIVE", LIVE)

cmd.Parameters.AddWithValue(

"@PROMOTED", PROMOTED)

cmd.Parameters.AddWithValue(

"@RESPONSIBLE_PERSON", RESPONSIBLE_PERSON)

cmd.Parameters.AddWithValue(

"@OUTCOME", OUTCOME)

cmd.ExecuteNonQuery()

End Sub



Where I am capturing the LOGON_ID and passing it in:

Protected Sub srcComments_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles srcComments.Inserting

e.InputParameters.Item(

"DASHBOARD_PAGE_ID") = Session("DASHBOARD_PAGE_ID")

e.InputParameters.Item(

"LOGON_ID") = HttpContext.Current.User

e.InputParameters.Item(

"DATE_ADDED") = Now()

End Sub



Thanks



Stephen
Top achievements
Rank 1
 answered on 29 Apr 2008
1 answer
178 views
Dear Telerik Support,

Is there a way to pull up a RadWindow from a desktop shortcut in a way that hides the parent window and also does not require you to click on a button from the parent window in order to pull up the RadWindow?

Here is a visual of what I am asking:

Click Here

Please advise,

Woody

Georgi Tunev
Telerik team
 answered on 29 Apr 2008
3 answers
173 views
The second page on my grid display jusy 1 row..

below a simpe code to reproduct my problem:

aspx:
<telerik:RadGrid ID="RadGrid1" runat="server"  
                 AllowPaging="true"  
                 AllowCustomPaging="true"  
                 PageSize="30"> 
</telerik:RadGrid> 


vb:
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource 
        Dim startRowIndex As Integer = (RadGrid1.CurrentPageIndex * RadGrid1.PageSize) + 1 
        Dim maximumRows As Integer = RadGrid1.PageSize 
        Dim dt As New System.Data.DataTable 
        dt.Columns.Add(New System.Data.DataColumn("a")) 
        dt.Columns.Add(New System.Data.DataColumn("b")) 
        Dim r As System.Data.DataRow 
        For i As Integer = startRowIndex To startRowIndex + maximumRows 
            r = dt.NewRow() 
            r("a") = "a" + CStr(i) 
            r("b") = "b" + CStr(i) 
            dt.Rows.Add(r) 
        Next 
        RadGrid1.DataSource = dt 
        RadGrid1.VirtualItemCount = 100000 
    End Sub 

Am I doing anything wrong?
Yavor
Telerik team
 answered on 29 Apr 2008
5 answers
300 views
Hi Guys, ive got a page with  a radcalender, and a radchart. Im trying not to display the axis labels on the chart if i navigate through the chart to a month that has no series data to display. Currently whats happening is if i navigate forwads for instance the y and x axis labels display in the middle of the chart and its not tidy, so is there a way for me to maybe show only a message (No data Available) for instance and with the axis labels not visible when the selected month on the chart has no data available for the chart series.
Giuseppe
Telerik team
 answered on 29 Apr 2008
0 answers
213 views
I get an error "there was an error rendering the control, a relative URI cannot be created because the 'uriString' parameter represents and absolute URI".  Any ideas what is the error refering to?  The RadMenu displays the information OK.  It is using  a default provider for the Site Map, AspNetSqlSiteMapProvider.  TIA.
Oscar
Top achievements
Rank 1
 asked on 29 Apr 2008
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?