Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
157 views

Hello All,

We have a ASP.NET AJAX based application which uses Modal RadWindow Popups.

Same application will run in different organizations and some organizations have small resolution monitors.

First I would asked that if Popup Window is quite big in small resolution monitor ant Window's caption is now shown, how can I move Window with using mouse? Are there any key combinations which would move Modal RadWindow?

Second question is that have any of you made scalable Popup Windows? Can it be done using Telerik's RadWindow?

Thanks,

Michael

Svetlina Anati
Telerik team
 answered on 18 Nov 2009
2 answers
132 views
The GridDropDownColumn is one of the most often used and yet I struggle (and many other as seen in the counless forum questions) with the fundamentls probably due to very weak documenatation and description of strategies and common approaches.

If the grid represents a data table tbl_A, then most likely the GridDropDownColumn will represent a value tbl_A_value that is taken from another list lets say tbl_B (tbl_B_value, tbl_B_description).  In the view mode, we want the grid to find description corresponding to tbl_A_value from tbl_B.  In the edit mode, we would want all the choices from tbl_B to appear in the drop down box.

I represent tbl_A and tbl_B through datasets and datatables.  Since, the tbl_B is virtually static and is the same for all the items in the collumn, I feel that there should be one place to initialize the internal GridDropDownColumn.  I really don't think that the ItemDataBound()  is the right place to do so.  I tried several approaches but none of them worked:

1) Defined  GridDropDownListColumnEditor in aspx and in PageLoad() defined its DataSource by assigning the appropriate DataTable.
2) Also in PageLoad(), I casted  grid column from MasterView to GridDropDownColumn and tried to assign appropriete values but don't know how to assign DataSource since only DataSourceID (string) is available to be set.

I guess I would like someone to post example on how to do GridDropDownColumn most efficiently using DataSet or DataTable solutions and no embedded SQL statements.

Chris

Christopher Borys
Top achievements
Rank 1
 answered on 18 Nov 2009
1 answer
92 views
When using the ImageManagerDialog (I also have a custom FileContentProvider) either from within Editor or standalone, the return value of src includes the http://server at the beginning, exactly like the href return value. I expected it to be the url from the FileBrowser which is also the save as the value or src within the outerHTML return value.

Is this the expected behaviour?

ex:

href = http://localhost/Handler.ashx?path=images/foo.jpg
outerHTML = <IMG style="WIDTH: 120px; HEIGHT: 90px" src="/Handler.ashx?path=images/foo.jpg">
src = http://localhost/Handler.ashx?path=images/foo.jpg

shouldn't src = /Handler.ashx?path=images/foo.jpg

Thanks.
Rumen
Telerik team
 answered on 18 Nov 2009
1 answer
369 views
Hello,
 
I've setup my radgrid to open a usercontrol in a popup when double clicking on a row for editing. If I edit the row using the control and save or if I cancel, all is fine. The save is being handled by an UpdateCommand event that is in my main page, the same one where the grid exist.

The UpdateCommand event function properly extracts the value, and updates the row within a beginedit/endedit pair. Right after the endedit, I call AcceptChanges on my dataset (the datasource is the business layer of a dataset that is bound using the needdatasource event).

The call to AcceptChanges triggers the grid Rowchanging event within which (on DataRowAction.Change) I call the update method of my business layer. My business layers validates the data, making sure it is ok to be updated in the database and updates the row in the database using dataadapter methods if all is ok.

This works great.

... Except when the business layer validation finds that the row is not ok. The way I have it setup is that it generates an exception with the error message (with throw new exception("error message")). This eventually goes up to the UpdateCommand function which traps it and creates a new label control to display the message at the top of the editform usercontrol and sets e.canceled to true. The label displays properly. Here is how I do it:

 

            catch (Exception ex)  
            {  
                changedRows[0].CancelEdit();  
                Label lc = new Label();  
                lc.Text="ERROR: "+ex.Message;  
                lc.ForeColor=Color.Red;  
                userControl.Controls.AddAt(0,lc);  
                e.Canceled=true;  
                e.Item.Edit = true;  
            }  
 

The problem: After this takes place, it seems that while the popup remains on the screen, the page has lost track of it. If I click my save button again then the updatecommand event is never called and the popup simply disappears. Other events defined in the user control also no longer take place.

It is probably something with radgrid not saving the usercontrol to viewstate. Any ideas how I can fix that?

-=-
On a somewhat related subject, while I'd very much like to find a solution to the above, I am also considering moving the editform to its own page. This is because when I double click on a row to open up the popup edit box with user control, radgrid implements that by a full postback that resends the whole grid (and page), this time including the popup right in the middle of the grid's generated html. The same thing takes place when I hit save or cancel in the edit popup. It has been suggested here that I should look at client-side databinding and editing but I'd like to avoid doing that. For now I see two options: 1) double-clicking on rows openup a new browser window with a new page or 2) I put my editform below the grid and load it and make it visible and jump to it when I double click on a row and put all of that in a radpanel so that this can be handled by an ajax request instead of a full post back.

Any thoughts on this and links to examples?

Regards,
 
Sylvain

 

Iana Tsolova
Telerik team
 answered on 18 Nov 2009
1 answer
134 views
When using usestaticheaders="True" vertical scroll jumps below header. Is it possible to use staticheaders when scroll would still go to the top?

Result is that at upper right corner there is sometimes just blank box or sometimes when header contains more than one line there is area which height equals header when it`s only one line high. I`m it doesn`t scale that header background for multi line header. In that case there is one line header background and below that white empty are and below that the scroll bar.


Pavlina
Telerik team
 answered on 18 Nov 2009
1 answer
106 views
Hi,

If I paste the following content into the RadEditor HTML view:


<!-- Start of Brightcove Player --> 
 
<div style="display: none;"> 
 
</div> 
 
<!-- 
By use of this code snippet, I agree to the Brightcove Publisher T and C  
found at http://corp.brightcove.com/legal/terms_publisher.cfm.  
--> 
 
<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script> 
 
<object class="BrightcoveExperience" id="myExperience50110418001"> 
  <param name="bgcolor" value="#FFFFFF"> 
  <param name="width" value="411"> 
  <param name="height" value="308"> 
  <param name="playerID" value="49906927001"> 
  <param name="publisherID" value="21742339001"> 
  <param name="isVid" value="true"> 
     
  <param name="@videoPlayer" value="50110418001"> 
</object> 
 
<!-- End of Brightcove Player --> 

Then switch to Design view, then back to HTML view, it becomes this:

<!-- Start of Brightcove Player --><div style="display: none;"></div><!-- 
By use of this code snippet, I agree to the Brightcove Publisher T and C  
found at http://corp.brightcove.com/legal/terms_publisher.cfm.  
--><script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script><!-- End of Brightcove Player --> 

This of course, breaks our video player you then save again.....any idea why this is happening?
Rumen
Telerik team
 answered on 18 Nov 2009
2 answers
426 views
I have a label in the radgrid command item template I want to change the text of the label to the text of the selected radtabstrip tab. However I can't seem to find the label after it is placed in the template can anyone tell me how to set the text of the label when the tabstrip is clicked. Thanks for any help.
Robert
Top achievements
Rank 1
 answered on 18 Nov 2009
3 answers
231 views
Hi!
I have my control with CheckBox <- this is my problem. I want to show panel when CheckBox is checked.
My control is used like this:

<EditFormSettings UserControlName="../UserControls/Process/StateAlert.ascx" EditFormType="WebUserControl"> 
     <EditColumn UniqueName="EditCommandColumn1"> 
     </EditColumn> 
</EditFormSettings>  

Inside control I have property:

public object DataItem 
        { 
            get 
            { 
                return dataItem; 
            } 
            set 
            { 
                if (value != null) 
                { 
                    if (value is StateJobTemplate) 
                    { 
                        StateJobTemplate template = (StateJobTemplate)value; 
                        ShowControl(true, (StateJobTypes)template.StateJobType, template); 
                        _sjtItem = template; 
                    } 
                    else 
                    { 
                        Telerik.Web.UI.GridInsertionObject newAlert = (Telerik.Web.UI.GridInsertionObject)value; 
                        StateJobTemplate template = newAlert.GetPropertyValue("JobTemplate") as StateJobTemplate; 
                        ShowControl(true, (StateJobTypes)template.StateJobType, template); 
                        _sjtItem = template; 
                    } 
                    btnCancel.Visible = true; 
                } 
                dataItem = value; 
            } 
        }  


Now, when I checked CheckBox, RadGrid and my control inside disappear.
If I place CheckBox inside UpdatePanel or AjaxPanel, I'll have fallowing error:

 
Sys.WebForms.PageRequestManagerServerErrorException: Nie mo|na wyrejestrowa elementu UpdatePanel o identyfikatorze uPanelDelay, poniewa| nie zostaB on zarejestrowany w elemencie ScriptManager. Ta sytuacja mo|e wystpi, je[li element UpdatePanel zostaB usunity z drzewa formantów, a nastpnie dodany ponownie, co nie jest obsBugiwan operacj. 
Nazwa parametru: updatePanel' when calling method: [nsIDOMEventListener::handleEvent]"  nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)"  location: "JS frame :: chrome://firebug/content/spy.js :: onHTTPSpyReadyStateChange :: line 497"  data: no] 
http://localhost:9920/ScriptResource.axd?d=1B-MRZCEFwolhXDsshMf4JjZOQs3iq1lzhqE6bwgKqGK8lEWWx8KGThf_Rfugcg6TbxwknueZdk1ek5e3cT_FYN0GGs0HIzmvczdBTv9-1E1&t=ffffffff91beb05b Line 5 

It's in Polish so I'll try to explain. Error says that UpdatePanel can't be unregistered because it wasn't registered in ScriptManager.
Please, help ;)
Adrian
Top achievements
Rank 1
 answered on 18 Nov 2009
4 answers
300 views
I'm using a RadGrid control along with the RadToolTipManager control. If you click on the row header it sorts correctly. if you click on it again, it resorts in the opposite direction. However, if you click on the up/down resort image instead it fails with an "invalid postback or callback argument" error.

I've tried explicitly setting the sort expression, but it doesn't seem to help. Here's a sample of how it's configured:

<telerik:RadGrid ID="grdScoreCard" runat="server"  
        onneeddatasource="grdScoreCard_NeedDataSource" EnableViewState="False" 
        OnItemCommand="grdScoreCard_ItemCommand" 
        AutoGenerateColumns="False" GridLines="None"    
        onitemdatabound="grdScoreCard_ItemDataBound" AllowSorting="True"> 
        <headercontextmenu enabletheming="True"> 
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </headercontextmenu> 
        <mastertableview showfooter="True" AllowMultiColumnSorting="true" AllowSorting="true"> 
            <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns>     
                <telerik:GridTemplateColumn> 
                    <ItemTemplate> 
                        <asp:HyperLink ID="lnkInfo" Text="Details" ToolTip="Info" NavigateUrl="#" runat="server"></asp:HyperLink> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn>   
<telerik:GridBoundColumn DataField="AvgContractAmount" DataFormatString="{0:c}" 
                    HeaderText="Avg. Contract $"  
                    SortExpression="AvgContractAmount" 
                    UniqueName="colAvgContractAmount"  Aggregate="Sum" FooterAggregateFormatString="{0:0,0}"> 
                    <FooterStyle HorizontalAlign="Right" /> 
                    <ItemStyle HorizontalAlign="Right" /> 
                </telerik:GridBoundColumn>           

Here's what the various bound events look like:

        protected void btnGenerate_Click(object sender, EventArgs e) 
        {            
            this.grdScoreCard.Rebind(); 
        } 
 
        protected void grdScoreCard_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
        { 
            if (e.CommandName == "Sort" || e.CommandName == "Page") 
            { 
                this.RadToolTipManager1.TargetControls.Clear(); 
            } 
 
        } 
 
        protected void grdScoreCard_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
        { 
            this.Generate(); 
        } 
 
        protected void Generate() 
        { 
            DataTable table = this.GenerateData();          
            this.grdScoreCard.DataSource = table; 
        } 
 
        protected void grdScoreCard_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
        { 
            if (e.Item.ItemType == Telerik.Web.UI.GridItemType.Item || e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem) 
            { 
                HyperLink link = e.Item.FindControl("lnkInfo") as HyperLink; 
                if (link != null) 
                { 
                    DataRowView view = (DataRowView)e.Item.DataItem; 
                    this.RadToolTipManager1.TargetControls.Add(link.ClientID, view.Row["LocationID"].ToString(), true); 
                } 
            } 
 
            if (e.Item is Telerik.Web.UI.GridDataItem) 
            {                 
                Telerik.Web.UI.GridDataItem item = e.Item as Telerik.Web.UI.GridDataItem; 
                if (item != null) 
                { 
                    int index = e.Item.ItemIndex + 1; 
                    item["colRank"].Text = index.ToString(); 
                }                 
            } 
          
            if (e.Item is Telerik.Web.UI.GridFooterItem) 
            { 
                DataTable table = this.grdScoreCard.DataSource as DataTable; 
                this.GenerateFooter(e, table); 
            } 
        } 


Any ideas about why this isn't working?
Iana Tsolova
Telerik team
 answered on 18 Nov 2009
1 answer
377 views
Hi,

I have a radtoolbar with aa combo-box (RadComboBox1) inside a template.  I want to input the value selected the combo-box to a datasource control parameter.  I'm not sure how to do it.  The combo-box control ID is not listed when I modify the datasource.

Thanks in advance for the help. 

Here's the code for the toolbar:

 

<telerik:RadToolBar ID="RadToolBar1" runat="server" Width="100%" 

 

BorderStyle="None" Skin="Sitefinity">

 

 

 

<Items>  

 

 

<telerik:RadToolBarButton runat="server" Text="New">

 

</telerik:RadToolBarButton>

 

 

 

<telerik:RadToolBarButton runat="server" Text="Filter">

 

 

 

<ItemTemplate>

 

 

 

<telerik:RadComboBox ID="RadComboBox1" AutoPostBack="True" Runat="server">

 

 

 

<Items>

 

 

 

<telerik:RadComboBoxItem runat="server" Selected="True" Text="All" Value="0" />

 

 

 

<telerik:RadComboBoxItem runat="server" Text="All Open Requests" Value="1" />

 

 

 

<telerik:RadComboBoxItem runat="server" Text="My Open Requests" Value="2" />

 

 

 

<telerik:RadComboBoxItem runat="server" Text="My Closed Requests" Value="3" />

 

 

</Items>

 

</telerik:RadComboBox>
</ItemTemplate>
</telerik:RadToolBarButton>

 

 

 

<telerik:RadToolBarButton runat="server" Text="Edit">

 

 

 

</telerik:RadToolBarButton>

 

 

 

<telerik:RadToolBarButton runat="server" Text="Print">

 

 

 

</telerik:RadToolBarButton>

 

 

 

<telerik:RadToolBarButton runat="server" Text="Search">

 

 

 

</telerik:RadToolBarButton>

 

 

 

<telerik:RadToolBarButton runat="server" Text="Refresh">

 

 

 

</telerik:RadToolBarButton>

 

 

 

</Items>

 

 

 

</telerik:RadToolBar>

 

 

 

 

 

 


Here's the code for the datasource:

<

 

asp:SqlDataSource ID="sqldsRequestsFiltered" runat="server"

 

 

 

ConnectionString=""

 

 

 

SelectCommand="csp_ith_ssl_requests_filtered" SelectCommandType="StoredProcedure">

 

 

 

<SelectParameters>

 

 

 

<asp:ControlParameter ControlID="RadComboBox1" Name="selection"

 

 

 

PropertyName="SelectedValue" Type="Int32" />

 

 

 

<asp:ControlParameter ControlID="lblUserName" Name="userid" PropertyName="Text"

 

 

 

Type="String" />

 

 

 

</SelectParameters>

 

 

 

</asp:SqlDataSource>

 

 

 

 

 

Peter
Telerik team
 answered on 18 Nov 2009
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?