Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
120 views
I have a page that opens a radwindow to give the user a few choices.  Once the choices have been made & posted back, I set a label with the following text in code-behind:

lblScript.Text = string.Format("<script type='text/javascript'>Sys.Application.add_load(Delete_Clicked('{0}'));</script>", sbMsg.ToString());

Here are the javascript functions:

function Delete_Clicked(msg) {            
            var oWindow = GetRadWindow();
            var oWnd = oWindow.BrowserWindow.radalert(msg, 325, 325, 'Attention');
            oWnd.add_close(Redirect);
}
function Redirect() {
           var oWindow = GetRadWindow();
            oWindow.BrowserWindow.location.href= '<%=redirectUrl %>';
            oWindow.close()
}

Basically, I want the user to see a radalert with some confirmation message.  Once the radalert has been closed, I want the original radwindow to close and redirect the opener page to the appropriate location.  I have tried several variations but cannot get this script to work.  At this point, in IE7 I get a stack overflow and FF does not throw an error.  However, neither browser will close the orginal radwindow or redirect.

Is there anything special to make a radalert work the way I need to?  Any help is appreciated.
Fiko
Telerik team
 answered on 04 Aug 2009
10 answers
288 views
Hello,

I need to add some controls in GridGroupHeaderItems, so I am using following code
    foreach (GridGroupHeaderItem groupHeaderItem in myGrid.MasterTableView.GetItems(GridItemType.GroupHeader)){
        //some code
        groupHeaderItem.DataCell.Controls.Add(myControl);
    }
 in Radgrid DataBound event handler.

 Problem is that after ajax callbacks controls from group header are dismissed with groupHeader.text. Could I somehow prevent this behavior?
 I was trying to place my code to radgrid PreRender event handler, but I am using specific data for constructing controls like this:
    (groupHeaderItem.DataItem as DataRowView)["columnName"].ToString()
 but (groupHeaderItem.DataItem as DataRowView) is a NULL in preRender event handler.
 So - Is there a way how to preserve controls in GridGroupHeaderItems between preRender events?

Thank you
Jan
Yavor
Telerik team
 answered on 04 Aug 2009
3 answers
315 views
Please find attached all RadWindow's skins that were embedded in the Q3 2008 RadControls version. They have been adapted to be fully compatible with the Q1 2009 release. The archive also contains all other RadControls skins that were adapted for Q1

In order to use them as external skins for RadWindow, you should do the following:

Direct skin registration:
  1. Add the base and skin's specific CSS files for the RadWindow control to the head section of your page.
  2. Disable the embedded skins for the RadWindow control and the embedded base stylesheet.
  3. Set the Skin property to the name of the skin that you want to use.
    e.g.:
    <head runat="server"> 
        <title>RadWindow 2008.Q3 skins: Direct skin registration</title> 
        <!-- This example shows registration of the Default skin --> 
        <link href="Skins/Default/Window.Default.css" rel="stylesheet" type="text/css" /> 
        <link href="Skins/Window.css" rel="stylesheet" type="text/css" /> 
    </head> 
    <body> 
        <form id="form1" runat="server"> 
            <telerik:RadScriptManager ID="ScriptManager1" runat="server" /> 
            <telerik:RadWindow  
                ID="RadWindow1"  
                runat="server"  
                NavigateUrl="http://www.google.com" 
                Width="400px"  
                Height="400px"  
                VisibleOnPageLoad="true" 
                 
                EnableEmbeddedBaseStylesheet="false" 
                EnableEmbeddedSkins="false" 
                Skin="Default" 
                 
                 
                > 
            </telerik:RadWindow> 
        </form> 
    </body> 



ASP.NET Themes:

  1. change the <pages> declaration in your web.config to <pages theme="SkinName"> e.g.
    <pages theme="Gray">
  2. add the following lines to the <appSettings> section of your web.config:
    <add key="Telerik.EnableEmbeddedBaseStylesheet" value="false" />
    <add key="Telerik.EnableEmbeddedSkins" value="false" />
    <add key="Telerik.Skin" value="SkinName"/>
    e.g.
    <add key="Telerik.Skin" value="Default"/>
  3. create an ASP.NET Theme, named SkinName and add the following all files and folders from the Q3-ported-skins archive:
    Skins/ Window.css
    Skins/SkinName/*
    e.g.
    Skins/Window.css
    Skins/Default/Window.Gray.css
    Skins/Default/Window/*.*


Best Regards,
Telerik team
German
Top achievements
Rank 1
 answered on 04 Aug 2009
1 answer
94 views
Below is the code in declarative format i need to dynamically build the radgrid and perform grouping. I am new to telerik so please could you help me out to convert it for code behind.


<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceI="SqlDataSource1" 
   GridLines="None" 
   AllowPaging="false" PageSize="25" 
   Skin="Outlook" DataSourceID="SqlDataSource1">  
 
 
 <MasterTableView DataSourceID="SqlDataSource1" GroupsDefaultExpanded="false"  >    
   <GroupByExpressions > 
         <telerik:GridGroupByExpression  > 
         <SelectFields> 
          <telerik:GridGroupByField  
            FieldName="name"  HeaderText=""/>  
         </SelectFields> 
           <GroupByFields> 
              <telerik:GridGroupByField  
                 FieldName="name" /> 
               </GroupByFields> 
         </telerik:GridGroupByExpression> 
         <telerik:GridGroupByExpression  > 
         <SelectFields> 
          <telerik:GridGroupByField  
            FieldName="lft"  HeaderText=""/>  
         </SelectFields> 
           <GroupByFields> 
              <telerik:GridGroupByField  
                 FieldName="lft" /> 
               </GroupByFields> 
         </telerik:GridGroupByExpression> 
   </GroupByExpressions> 
    </MasterTableView> 
   
   
</telerik:RadGrid> 
Princy
Top achievements
Rank 2
 answered on 04 Aug 2009
1 answer
123 views
We have 2 site collections on 1 server
In the WCM HTML Editor scenario, I can declare separate congifile and toolfile and CSS in the layout page
Is it still possible to do this in the Form scenario?  Thanks.

Stanimir
Telerik team
 answered on 04 Aug 2009
2 answers
109 views
Hello !

I needed a RadGrid with possibility to change data in it without pressing any Edit buttons, so i added textboxes and Save/Delete buttons directly to ItemTemplates, also added  CommandItemDisplay="Top" to insert new rows, as a result  RadGrid looks like this:

    <telerik:RadGrid ID="gvwEducations" runat="server" GridLines="None" OnItemDataBound="gvwEducations_ItemDataBound"
        AutoGenerateColumns="False" OnItemCommand="gvwEducations_ItemCommand">
        <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" EditMode="InPlace">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="IntstituteTemplate" HeaderText="Institute">
                    <ItemTemplate>
                        <telerik:RadComboBox ID="cbxInstitute" runat="server">
                        </telerik:RadComboBox>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadComboBox ID="cbxInstitute" runat="server">
                        </telerik:RadComboBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

                <telerik:GridTemplateColumn UniqueName="StartTimeTemplate" HeaderText="Start">
                    <ItemTemplate>
                        <telerik:RadTextBox ID="tbxStartYear" runat="server">
                        </telerik:RadTextBox>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadTextBox ID="tbxStartYear" runat="server">
                        </telerik:RadTextBox>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>

                <telerik:GridButtonColumn CommandName="Save" Text="Save" UniqueName="SaveColumn"
                    ShowInEditForm="true">
                </telerik:GridButtonColumn>
                <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"
                    ShowInEditForm="true">
                </telerik:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

Here comes the questions :)
is it possible to use ItemTemplate on item insert ?(at the moment edititemtemplate is just copypaste of itemtemplate) 



and one more questions about codebehind :

        protected void gvwEducations_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                RadComboBox cbxInstitute = (RadComboBox)e.Item.FindControl("cbxInstitute");
                RadTextBox tbxStart = (RadTextBox)e.Item.FindControl("tbxStartYear");
                cbxInstitute.DataSource = SomeCacheDatasource;
   cbxInstitute.DataBind();

                if (e.Item.DataItem is MyDataType)
                {
//fill textboxes with data from datasource
                }
            }
            if (e.Item is GridEditFormInsertItem) //if inserting new item, fill comboboxes
            {
                RadComboBox cbxInstitute = (RadComboBox)e.Item.FindControl("cbxInstitute");
                cbxInstitute.DataSource = SomeCacheDatasource;
                cbxInstitute.DataBind();

            }
        }

        protected void gvwEducations_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "Save")
            {
                SaveData(e);
            }
        }

when i save newly added item in gvwEducations_ItemCommand all it's controls values exist but they are empty,
am i doeing something wrong ?


Thank you !

Aleksei
Top achievements
Rank 1
 answered on 04 Aug 2009
1 answer
50 views
Hello;

I'm trying to link in the Default2006 skin for an app that I'm upgrading to Q2 2009 -- I know the skin is deprecated, but it's simple style is one our users prefer for some application without the extra graphic elements and padding of some of the newer skins.  I've downloaded the Q3 2008 ConvertedSkins.zip file, and hooked up the following to my page:

 

 

        <link type=text/css rel=stylesheet href="/RadControls/LegacySkins/Default2006/Grid.Default2006.css">  
        <link type=text/css rel=stylesheet href="/RadControls/LegacySkins/Default2006/Menu.Default2006.css">  
        <link type=text/css rel=stylesheet href="/RadControls/LegacySkins/Default2006/Input.Default2006.css">  
        <link type=text/css rel=stylesheet href="/RadControls/LegacySkins/Default2006/Calendar.Default2006.css">  
 

EnableEmbeddedSkins is set to false, and the Skin for the grid is set to Default2006.

Everything works pretty well - the grid appears as I would expect, and the dropdown menus for the filter are fine.  The pager control generally looks and behaves, with the exception of the menu that lets you control page size.  The menu is unformatted, unstyled text when it pops up and the options aren't selectable.  Instead of an image to open the option list, there is simply the word "Select".

Can anybody offer any suggestions as to what I'm missing?  I'm sure it's something simple.

Thanks in advance,
Jason

Dimo
Telerik team
 answered on 04 Aug 2009
2 answers
72 views
When grouping data i am also getting the GroupField name i dont want it, i just need the value.

Thanks a million in advance.
Ali Akbar
Top achievements
Rank 1
 answered on 04 Aug 2009
1 answer
101 views
I've created an ASCX control which uses a radToolBar and radGrid, and have then created a redistributable version of the control using the technique described here:

http://msdn.microsoft.com/en-us/library/aa479318.aspx

This works really well except that the skin setting does not work. It works fine in the test project I used to create/test/publish the control, so it must be something to do with how the control is referencing skins - maybe the path to the Skins folder?

I've added a Skin property to the control, and am passing this to the underlying controls as follows:

    private string _Skin;  
    public string Skin  
    {  
        get { return _Skin; }  
        set 
        {  
            _Skin = value;  
            RadToolBar1.EnableEmbeddedSkins = false;  
            RadToolBar1.Skin = _Skin;  
 
            RadGrid1.EnableEmbeddedSkins = false;  
            RadGrid1.Skin = _Skin;  
        }  
    }  
 

In the project where I'm using the control, its assembly is added as a reference - I'm wondering whether I need to move the control's assembly under this project's directory structure in order for it to pick up the skin properly

Any thoughts?

Thanks,

James
Schlurk
Top achievements
Rank 2
 answered on 04 Aug 2009
3 answers
203 views
Does anybody know how to get the image source path in the DeleteFile function of DBContentProvider.cs?

We have a table with all of the image names and paths in the database.  When a user uploads a new image we rename it from "MyFirstPic.jpg" to 25.jpg, where 25 is the picture id in the database.  We store the original name so that the user can see it when they look through the image manager.

I am adding code to the DeleteFile function but the variable that is getting passed is the image path with the old image name (MyFirstPic.jpg) not the new (25.jpg).  How do I get the actual name (25.jpg)?  
Thanks

Fiko
Telerik team
 answered on 04 Aug 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?