Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
144 views
Hello! I have a small problem, I have a grid within a RadPane when I slide down and select a row in the grid the scroll bar is coming back up and I lose the selected row.
As I can do to stop the scroll bar fixed and prevent a return to the top?

Thanks for the help.
Best regards.

Bryan
Svetlina Anati
Telerik team
 answered on 15 Apr 2010
2 answers
253 views
Hi,

We have an issue where after closing a rad window (that is opened from a button in a grid using the ItemCommand) the page will do a post back to reload the grid after which the rad window automatically reopens.

This function used to work fine without the rad window reopening. If I remove the rebind command from the close function the rad window does not reopen, however if you then cause the grid to rebind the window will reopen afterwards.

The only changes I know have been done before it was noticed that this page now had an error, were an upgrade to the latest Telerik controls and the addtion of a method to keep the grid selections. (note that this is an Hierarchy grid and the button is on the data table not the master table)

the Item command is as follows:
       if (e.CommandName == "GenerateExhibit")
            {
                GridDataItem item = (GridDataItem)e.Item;
                //Get the primary key value using the DataKeyValue.    
                string url = "~/Modules/Dialog/GenerateNewExhibit.aspx";
                string arguments = "?Location=Chemical Lab";
                arguments += "&IncidentId=" + IncidentId.ToString();
                arguments += "&ParentExhibitId=" + item["ExhibitId"].Text;
                arguments += "&ExtraDetail=" + item["Treatment"].Text;
                RadWindow window = new RadWindow();
                window.Title = "Generate New Exhibit";
                window.ID = "rwGenerateNewExhibitDialogWindow";
                window.NavigateUrl = url + arguments;
                window.OnClientClose = "OnClientCloseGenerateNewExhibit";         
                window.Behaviors = WindowBehaviors.Close;
                window.KeepInScreenBounds = true;
                window.VisibleStatusbar = false;
                window.Modal = true;
                window.Width = 1000;
                window.Height = 750;
                window.VisibleOnPageLoad = true;
                rwmGenerateNewExhibit.Windows.Add(window);
            }

the client side close function is:
            function OnClientCloseGenerateNewExhibit(radWindow) {
                grdRelatedExhibits = $find("<%= grdRelatedExhibits.ClientID %>");
                grdRelatedExhibits.get_masterTableView().rebind();
                //alert("Closing");
            }

the methods to 'remeber selection and expantion'
protected void grdRelatedExhibits_DataBound(object sender, EventArgs e)
        {
            //Expand all items using our custom storage
            string[] indexes = new string[this.ExpandedStates.Keys.Count];
            this.ExpandedStates.Keys.CopyTo(indexes, 0);

            ArrayList arr = new ArrayList(indexes);
            //Sort so we can guarantee that a parent item is expanded before any of
            //its children
            arr.Sort();

            foreach (string key in arr)
            {
                bool value = (bool)this.ExpandedStates[key];
                if (value)
                {
                    try
                    {
                        grdRelatedExhibits.Items[key].Expanded = true;
                    }
                    catch
                    {
                    }
                }
            }

            //Select all items using our custom storage
            indexes = new string[this.SelectedStates.Keys.Count];
            this.SelectedStates.Keys.CopyTo(indexes, 0);

            arr = new ArrayList(indexes);
            //Sort to ensure that a parent item is selected before any of its children
            arr.Sort();

            foreach (string key in arr)
            {
                bool value = (bool)this.SelectedStates[key];
                if (value)
                {
                    try
                    {
                        grdRelatedExhibits.Items[key].Selected = true;
                    }
                    catch
                    {
                    }
                }
            }
        }

Item command for expand/contract/select/deselect
if (e.CommandName == RadGrid.ExpandCollapseCommandName)
            {
                //Is the item about to be expanded or collapsed
                if (!e.Item.Expanded)
                {
                    //Save its unique index among all the items in the hierarchy
                    this.ExpandedStates[e.Item.ItemIndexHierarchical] = true;
                }
                else //collapsed
                {
                    this.ExpandedStates.Remove(e.Item.ItemIndexHierarchical);
                    this.ClearExpandedChildren(e.Item.ItemIndexHierarchical);
                }
            }
            //Is the item about to be selected
            else if (e.CommandName == RadGrid.SelectCommandName)
            {
                //Save its unique index among all the items in the hierarchy
                this.SelectedStates[e.Item.ItemIndexHierarchical] = true;
            }
            //Is the item about to be deselected
            else if (e.CommandName == RadGrid.DeselectCommandName)
            {
                this.SelectedStates.Remove(e.Item.ItemIndexHierarchical);
            }

Thanks in advance
Paul



Paul Gothard
Top achievements
Rank 1
 answered on 15 Apr 2010
6 answers
458 views
I am using a RadGrid and utilizing the popup edit mode.

For simplicity sake, I have 2 DropDown lists (although these could easily be RadComboBoxes).  In the first one I have Countries, and the second one I have Cities.  Select a Country, the second DropDownList is populated with Cities.  Pretty standard functionality, nothing special here.

I would like to bind the selected values to an object's properties.  Lets say an Address object's .CountryID and .CityID properties for sake of argument.

<telerik:RadComboBox ID="ddlCountries" Runat="server" SelectedValue='<%#Bind("CountryID") %>' AutoPostBack="true" DataSourceID="countriesDataSource"  DataTextField="Country" DataValueField="CountryID"/>  
 
<telerik:RadComboBox ID="ddlCities" Runat="server" SelectedValue='<%#Bind("CityID") %>' DataSourceID="citiesDataSource"  DataTextField="City" DataValueField="CityID"/> 

ddlCountries can bind to the object fine in either edit or insert mode.  The problem lies in when ddlCities attempts to bind to the object.  I forget the exception that is thrown at this point, but it has something to do with ddlCities not being a bindable object.

I have figured out a solution to get this to work.  Admittedely, it is far more hackish than I hoped it to be.  I basically have to populate ddlCities manually after ddlCountries has changed and manually populate ddlCities with values (can't use a DataSource object).  What's worse is that I have to handle a few RadGrid events to manually select the City that should bind to the object's City property, rather than allow the elegance of the Bind() method to perform its work.  Again, it works, but it's quite an ugly solution.

Has anyone experienced this and have a code sample that they'd like to share?  I can share mine to upon request.

Thanks!
Pavlina
Telerik team
 answered on 15 Apr 2010
2 answers
164 views
So what I want to achieve is to display the rad editor as a textbox...no tools, nothing.
I've tried this multiple times, and can't seem to do this right.
I want to display it as this so I can pull the text without html .

Nate
Nate
Top achievements
Rank 1
 answered on 15 Apr 2010
0 answers
416 views

Hi
i have one RadioButtonList as below...

 

<asp:RadioButtonList id="rblType" runat="server"

 

 

style="z-index: 103; left: 465px; position: absolute; top: 120px;

 

 

width: 150px; height: 16px; vertical-align: middle;"

 

 

RepeatDirection="Horizontal" AutoPostBack="false"

 

onmousedown

 

="getCheckedRadio()"

 

 

 

 

 

 

 

OnSelectedIndexChanged="rblType_SelectedIndexChanged">

 

 

 

<asp:ListItem Text="St" Value="St" Selected="True"></asp:ListItem>

 

 

<asp:ListItem Text="TC" Value="TC"></asp:ListItem>

 

 

 

</asp:RadioButtonList>

now i want to change the text of textbox using the selected lsititem in radiobuttonlist using javascript.

 

function getCheckedRadio()
{

    var rblType= document.getElementsByName("ctl00_messagePanelsContent_contentPlaceHolder_fvAllotmentDetail_rblType");
//some loop here on rblType and then 
for(int i=0; i < rblType.length; i++ )
{
    if (rblType.item[i] == "checked")
      {       
            alert("You checked ");
        }
}
   
}

but the above javascript code is not working.
could anyone please help me to how to get the selected listitem using javascript.
thanks in advance...

waiting for reply.

bharat kumar
Top achievements
Rank 1
 asked on 15 Apr 2010
3 answers
176 views
We took the latest 2010Q1 release, and as always are going through the site to find the bugs.

One small one is that icon in the upper left of the rad window popups changed from a yellow/white to a green/light green icon.  It sticks out as the popup boarder is blue, yet there is this green icon. 

We are using the built in skins - I think Vista for the popup.

Is this a known issue and is there a suggestion on how to correct?

Thanks

Tim
Jeff
Top achievements
Rank 1
 answered on 15 Apr 2010
2 answers
339 views
Dear Sir,
i m using Scheduler Control. I want to change Appointment Back Colour Condition Wise

In Appointment Template i Have a Label i have Just bound it to database and through This Label Value i want to Change Appointment Back Color.

Like If Label Value = "U" Then Appointment Color ="Red"
If Label Value = "P" Then Appointment Color ="Blue"
If Label Value = "A" Then Appointment Color ="Pink"

Like This. When i use Appointment Databound Event For Colour Changing Then How can i get Appointment Template Control Field Value on Appointment Databound.

And When i Use Appointment Created Event Then that Time Label Value Is Blank.

How Can I Achive this Problem.

Some Code Sample Like As


protected

 

void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e)

 

{

 

 

 

Label lblStatus = (Label)e.Container.FindControl("lblStatus");

 

 

 

 

if (lblStatus.Text == "U")

 

{

e.Appointment.BackColor = System.Drawing.

 

 

Color.Yellow;

 

}

 

 

 

else if (lblStatus.Text == "A")

 

{

e.Appointment.BackColor = System.Drawing.

 

 

Color.Blue;

 

}

 

 

 

else if (lblStatus.Text == "P")

 

{

e.Appointment.BackColor = System.Drawing.

 

 

Color.Green;

 

}

 

 

 

//checkbox1.Checked = true;

 

 

 

}



//////////////////////////////////////////////////////// aspx


<

 

telerik:RadScheduler AllowInsert="false" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" OnAppointmentCreated="RadScheduler1_AppointmentCreated"

 

 

 

 

 

runat="server" ID="RadScheduler1" Skin="Office2007" Height="551px" CustomAttributeNames="AppointmentStatus"

 

 

 

 

 

Width="690px" ShowFooter="false" SelectedDate="2010-03-18" DayStartTime="07:00:00"

 

 

 

 

 

DayEndTime="21:00:00" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableDescriptionField="true"

 

 

 

 

 

ShowNavigationPane="false" OnAppointmentDelete="RadScheduler1_AppointmentDelete"

 

 

 

 

 

DataSubjectField="1" DataStartField="1" DataEndField="1" ShowAllDayRow="false"

 

 

 

 

 

OnClientAppointmentContextMenuItemClicked="A" OnClientAppointmentClick="ShowExisting1"

 

 

 

 

 

OnTimeSlotContextMenuItemClicked="RadScheduler1_TimeSlotContextMenuItemClicked" AllowDelete="false"

 

 

 

 

 

OnAppointmentContextMenuItemClicked="RadScheduler1_AppointmentContextMenuItemClicked"

 

 

 

 

onnavigationcommand="RadScheduler1_NavigationCommand">

 

 

 

 

 

<AppointmentContextMenuSettings EnableDefault="false" />

 

 

 

 

 

<TimelineView UserSelectable="false" />

 

 

 

 

 

<AppointmentTemplate>

 

 

 

 

<%

# Eval("Subject")%>

 

 

 

 

<asp:Label ID="lblStatus" runat="server" Text=<%#Eval("AppointmentStatus") %>></asp:Label>

 

 

 

 

 

</AppointmentTemplate>

 

 

 

 

<

 

TimeSlotContextMenuSettings EnableDefault="False" />

 

 

 

 

 

</telerik:RadScheduler>

 

 

 

 






Please Help Me.
Thanks
Chandan Kumar.
Chandan Kumar
Top achievements
Rank 1
 answered on 15 Apr 2010
2 answers
157 views
Hi

I have implemented a Custom Content Filter that converts web control-like tags <tag:xslfile /> to an image and back.

I want to run this filter on load, so that the images are displayed in Design view, but the original tag is displayed in Html view.

The hacky way is to do this:

editor.set_mode(2);
editor.set_mode(1);

But this makes the editor flicker.

Is there a nicer way?

Thanks
--Jakob
Jakob Christensen
Top achievements
Rank 1
 answered on 15 Apr 2010
2 answers
174 views
hi

     i am using Rad menu control for my horizontal menu and i am using black css
the issue is when mouse over the first root menu the hover image is not aligned properly please give me the solution for this issue
i attached issue screenshot please refer
sathish venkat
Top achievements
Rank 2
 answered on 15 Apr 2010
1 answer
103 views
Hi everybody,
I'm testing Telerik controls in order to use them in a wss/moss custom application. I need help passing data between different Panels.

My final goal is to make refreshing different web parts when i click on a control on a single web part passing some data to the other web parts before they render again.

I designed my app with 2 panel: a menu area and a content area.
The idea was to customize the master page where I put:

  • 1 asp:ScriptManager
  • 1 telerik:RadAjaxManager
    <asp:ScriptManager runat="server" ID="ScriptManagerMain" /> 
     <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="CustomPanelMenu"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxLoadingPanelMain"></telerik:AjaxUpdatedControl> 
                    <telerik:AjaxUpdatedControl ControlID="CustomPanelMain"  /> 
                 </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="CustomPanelMain"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxLoadingPanelMain"/> 
                    <telerik:AjaxUpdatedControl ControlID="CustomPanelMenu" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
 


  • 1 asp:Panel to be used for menu purposes
                <asp:Panel ID="CustomPanelMenu" runat="server"> 
                    <WebParts:TestMenu001 runat="server" ID="TestMenu001_1" Title="MenuSx" __MarkupType="vsattributemarkup" __WebPartId="{0ce525f0-089d-4f57-902a-78d4b87b34b9}" WebPart="true" __designer:IsClosed="false" /> 
              </asp:Panel> 
 



  • 1 asp:Panel where I put the standard moss content placeholder "PlaceHolderMain" for main content web parts
  • 1 telerik:RadAjaxLoadingPanel to make the application more interactive
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelMain" runat="server"/> 
 
<asp:Panel ID="CustomPanelMain" runat="server"> 
    <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server"> 
    </asp:ContentPlaceHolder> 
</asp:Panel> 
 

As you can see in the first code block, I configured the RadAjaxManager in order to update the panels.
I had to pass data between the web part I will put in the panels:
For example: when I click on a control in the web part put in the menu panel I want the web part put in the CustomPanelMain will refresh with the id I chose.

I try to put data in the Page.Session, but I tested that the refresh on the main web part will start before the data is written in the menu web part.
What am I wronging? What do you suggest to do that?

Many thanks,
RF







Tsvetoslav
Telerik team
 answered on 15 Apr 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?